Skip to content

HDDS-16042. Add support for listing disk usage info per storage policy through cli - #11420

Open
anuragp010 wants to merge 1 commit into
apache:HDDS-11233from
anuragp010:HDDS-16042
Open

anuragp010 wants to merge 1 commit into
apache:HDDS-11233from
anuragp010:HDDS-16042

Conversation

@anuragp010

Copy link
Copy Markdown
Contributor

Co-authored-by: XiChen 32928346+xichen01@users.noreply.github.com

What changes were proposed in this pull request?

With the introduction of the Storage Policy feature, a Datanode's usage can vary significantly across different StorageType's. Today, ozone admin datanode usageinfo only reports usage aggregated across all storage types per datanode, so there's no way to see how capacity is used within a single type. This PR adds a new SCM admin RPC (listStorageTypeUsageInfo) and CLI command, ozone admin storagepolicy usageinfo, that reports capacity/used/remaining/committed/freeSpaceToSpare broken down per StorageType, both as a cluster-wide summary and (with --with-datanode) a per-datanode breakdown.

Generated with Claude code.

What is the link to the Apache JIRA

HDDS-16042

How was this patch tested?

  1. Newly added Unit Tests and Integration Test.
bash-5.1$ ozone admin storagepolicy usageinfo
Cluster StorageType Usage Summary
  DISK Datanode Count    : 3
  DISK Capacity          : 315229967100 B (293.58 GB)
  DISK Ozone Used        : 13217085 B (12.60 MB)
  DISK Remaining         : 239481778176 B (223.03 GB)
  DISK Committed         : 3221156547 B (3.00 GB)
  DISK FreeSpaceToSpare  : 314572800 B (300 MB)
bash-5.1$ ozone admin storagepolicy usageinfo --with-datanode
Cluster StorageType Usage Summary
  DISK Datanode Count    : 3
  DISK Capacity          : 315229967100 B (293.58 GB)
  DISK Ozone Used        : 13217085 B (12.60 MB)
  DISK Remaining         : 239481778176 B (223.03 GB)
  DISK Committed         : 3221156547 B (3.00 GB)
  DISK FreeSpaceToSpare  : 314572800 B (300 MB)

Datanode StorageType Usage List

StorageType DISK:

  Datanode               : 88503a6d-9385-4c19-93f9-ac8ba88a6b70 (ozone-datanode-2.ozone_default, 172.18.0.4, /default-rack)
  DISK Capacity          : 105076655700 B (97.86 GB)
  DISK Ozone Used        : 4405695 B (4.20 MB)
  DISK Remaining         : 79827259392 B (74.34 GB)
  DISK Committed         : 1073718849 B (1023.98 MB)
  DISK FreeSpaceToSpare  : 104857600 B (100 MB)

  Datanode               : a604d537-e725-4e30-9181-6dc6f422ad60 (ozone-datanode-3.ozone_default, 172.18.0.9, /default-rack)
  DISK Capacity          : 105076655700 B (97.86 GB)
  DISK Ozone Used        : 4405695 B (4.20 MB)
  DISK Remaining         : 79827259392 B (74.34 GB)
  DISK Committed         : 1073718849 B (1023.98 MB)
  DISK FreeSpaceToSpare  : 104857600 B (100 MB)

  Datanode               : 28396f46-2315-4529-bf68-640612c01e85 (ozone-datanode-1.ozone_default, 172.18.0.8, /default-rack)
  DISK Capacity          : 105076655700 B (97.86 GB)
  DISK Ozone Used        : 4405695 B (4.20 MB)
  DISK Remaining         : 79827259392 B (74.34 GB)
  DISK Committed         : 1073718849 B (1023.98 MB)
  DISK FreeSpaceToSpare  : 104857600 B (100 MB)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant