openstacktelemetryceilometeropenstacksdk

Does OpenstackSDK have support for usage metrics?


So...I'm facing a problem which I need the available amount of resources (and how are they being used) in the DCs (focusing on each project/server/network consume) of my Openstack (Stein) through python code (cause the other functionalities are in python and I don't like mixing languages if it have support for a functionality).

Are there any support for this on OpenstackSDK libraries? If yes, where to find the API documentation (or code examples of usage). If don't, why?


Solution

  • You can use existing Nova APIs to list down Compute capabilities and available resources.

    nova hypervisor-stats

    +----------------------+-------+
    | Property             | Value |
    +----------------------+-------+
    | count                | 2     |
    | current_workload     | 0     |
    | disk_available_least | 1378  |
    | free_disk_gb         | 1606  |
    | free_ram_mb          | 47003 |
    | local_gb             | 1606  |
    | local_gb_used        | 0     |
    | memory_mb            | 48027 |
    | memory_mb_used       | 1024  |
    | running_vms          | 0     |
    | vcpus                | 28    |
    | vcpus_used           | 0     |
    +----------------------+-------+
    

    You can automate it by wrapping it in shell or calling python-openstack lib.