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
?
Asked
Active
Viewed 388 times
0

Bani
- 19
- 6
1 Answers
0
You can do this by using the cinder
CLI or the OpenStack Dashboard (Horizon).
cinder list
cinder show <volume-id>
- Look for the field
size
which shows the total volume size in GB. - Look for the field
os-vol-host-attr:host
that shows the host's name to which the volume is attached. - 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