0

In OpenStack, is there a way to view the used space of a volume? In another words, what is the equivalent of the virt-df <domain> --human command in OpenStack api?

Bani
  • 19
  • 6

1 Answers1

0

You can do this by using the cinder CLI or the OpenStack Dashboard (Horizon).

  1. cinder list
  2. cinder show <volume-id>
  3. Look for the field size which shows the total volume size in GB.
  4. Look for the field os-vol-host-attr:host that shows the host's name to which the volume is attached.
  5. SSH into the host and df -h <mount-point>
Hawshemi
  • 302
  • 5
  • Thanks. Is there also `api` to get the `used` space of the volume? – Bani Mar 19 '23 at 07:31
  • `GET /volumes/{volume_id}/stats` `GET /os-volumes/{volume_id}/usage` This will return a JSON object containing information about the volume usage, including the total number of reads and writes, the number of bytes read and written, and the last time the volume was accessed. – Hawshemi Mar 19 '23 at 07:36
  • It returns null to me. would you please give me a link to its documentation? – Bani Mar 19 '23 at 14:06
  • https://docs.openstack.org/api-ref/block-storage/ – Hawshemi Mar 19 '23 at 14:16
  • Sorry, the link you mentioned does not have the APIs you said before. – Bani Mar 19 '23 at 14:45