Managed OpenStack
Latest
Frequently Asked Questions
Solution
How To
Internal Only
Templates
Powered By

Title
Message
Create new category
What is the title of your new category?
Edit page index title
What is the title of the page index?
Edit category
What is the new title of your category?
Edit link
What is the new title and URL of your link?
Obtain Compute Hosts/Hypervisor Info Using API
Copy Markdown
Open in ChatGPT
Open in Claude
Problem
A user would like to use the OpenStack API to obtain information about Hosts/Hypervisors in OpenStack environment, such as current CPU usage/allocation, Memory usage/allocation, Storage usage/allocation, etc, similar to what is shown in the Clarity UI.
Environment
- Platform9 Managed OpenStack - v3.6.0 and Higher
Procedure
- The following
curlcommand using your Management Plane's Nova API endpoint can be used to get the details of a hypervisor in Platform9 Managed OpenStack.
$ curl -s -H "X-Auth-Token: $TOKEN" https://[Management Plane FQDN]/nova/v2.1/[project id]/os-hypervisors/detail |jq '.[][]'The above will list all the details of all the hypervisors in the environment.
- One can apply
jqfilters to obtain the required information from the list of hypervisors.
$ curl -s -H "X-Auth-Token: $TOKEN" https://[Management Plane FQDN]/nova/v2.1/[project id]/os-hypervisors/detail |jq '.[][]| { cpu_information: .cpu_info, hostname: .hypervisor_hostname, Memory_Used: .memory_mb_used,Free_RAM: .free_ram_mb, Free_Disk: .free_disk_gb, CPU_util: .["OS-EXT-PF9-HYP-RES"].cpu_util_percent }'Additional Information
One can get the TOKEN and [Project Id] to be used in the command mentioned above by running the following command.
xxxxxxxxxx$ openstack token issueVariableType to search · ESC to discard
GlossaryType to search · ESC to discard
InsertType to search · ESC to discard
No matches
Last updated on
Was this page helpful?
Discard Changes
Do you want to discard your current changes and overwrite with the template?
Archive Synced Block
Message
Create new Template
What is this template's title?
Delete Template
Message