Score:0

How to view the used space of a volume in OpenStack

sg flag

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?

Score:0
kz flag

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>
Bani avatar
sg flag
Thanks. Is there also `api` to get the `used` space of the volume?
Hawshemi avatar
kz flag
`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.
Bani avatar
sg flag
It returns null to me. would you please give me a link to its documentation?
Hawshemi avatar
kz flag
https://docs.openstack.org/api-ref/block-storage/
Bani avatar
sg flag
Sorry, the link you mentioned does not have the APIs you said before.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.