0

Get the quota info:

# openstack quota show
+----------------------+--------+
| Field                | Value  |
+----------------------+--------+
| gigabytes            | 40000   
| gigabytes_ceph_spec  | 20000   

Get the hypervisor stats:

# openstack hypervisor stats show
+----------------------+-------+
| Field                | Value |
+----------------------+-------+
| count                | 1     |
| current_workload     | 0     |
| disk_available_least | 491   |
| free_disk_gb         | 796   |
| free_ram_mb          | 19326 |
| local_gb             | 916   |
| local_gb_used        | 120   |
| memory_mb            | 32126 |
| memory_mb_used       | 12800 |
| running_vms          | 4     |
| vcpus                | 4     |
| vcpus_used           | 12    |
+----------------------+-------+

How could I get the gigabytes_ceph_spec or gigabytes's resource usage like openstack hypervisor stats show or other methods?

Victor Lee
  • 2,467
  • 3
  • 19
  • 37

2 Answers2

0

If your compute nodes are connected to ceph the available space is already taken into account. For reference I'll paste some information from one of my compute nodes (CephFS is mounted as shared storage for live-migration):

| disk_available_least | 64180  --> free disk space incl. cephfs (df -h)
| free_disk_gb         | 496620 --> local_gb - local_gb_used
| local_gb             | 496786 --> local disk space + ceph available space
| local_gb_used        | 166    --> "DISK_GB" allocations from placement api

My ceph cluster currently has around 470 TB available space and around 200 GB local disk space which add up to the 496 TB.

The closest thing within cinder seems to be this command:

control:~ # cinder summary --all-tenants
+-------------+---------------------------------------------------+
| Property    | Value                                             |
+-------------+---------------------------------------------------+
| metadata    | cinder.csi.openstack.org/cluster : ['kubernetes'] |
| total_count | 127                                               |
| total_size  | 5660                                              |
+-------------+---------------------------------------------------+

I don't think there's currently a way to determine this from the openstack side, you'll have to check ceph for more detailed information.

eblock
  • 579
  • 3
  • 5
0

I find a dumb method by setting a small value for the quota and get the current allocate value from the error tips.

$ openstack quota set --gigabytes 1 --volume-type ceph_spec proj_name
Quota gigabytes_ceph_spec limit must be equal or greater than existing resources.
 Current usage is 2048 and the requested limit is 1. (HTTP 400) (Request-ID: req-c1***)

Now I know that 2048G of gigabytes_ceph_spec had been used.

Victor Lee
  • 2,467
  • 3
  • 19
  • 37