Obtain Compute Hosts/Hypervisor Info Using API

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

  1. The following curl command using your Management Plane's Nova API endpoint can be used to get the details of a hypervisor in Platform9 Managed OpenStack.
Copy

The above will list all the details of all the hypervisors in the environment.

  1. One can apply jq filters to obtain the required information from the list of hypervisors.
Copy

Additional Information

One can get the TOKEN and [Project Id] to be used in the command mentioned above by running the following command.

Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard