Trying to monitor the CPU ready time (hypervisor.cpu_ready_time_ppm) | Nutanix Community
Skip to main content

Hi,

I am trying to monitor the CPU ready time (hypervisor.cpu_ready_time_ppm) for the VMs on AHV but the metrics available via the API does not provide this particular metric.

The host metrics available via the API are

Host_hypervisor_avg_io_latency_usecs
Host_hypervisor_avg_read_io_latency_usecs
Host_hypervisor_avg_write_io_latency_usecs
Host_hypervisor_cpu_usage_ppm
Host_hypervisor_io_bandwidth_kbps
Host_hypervisor_memory_usage_ppm
Host_hypervisor_num_io
Host_hypervisor_num_iops
Host_hypervisor_num_read_io
Host_hypervisor_num_read_iops
Host_hypervisor_num_received_bytes
Host_hypervisor_num_transmitted_bytes
Host_hypervisor_num_write_io
Host_hypervisor_num_write_iops
Host_hypervisor_read_io_bandwidth_kbps
Host_hypervisor_timespan_usecs
Host_hypervisor_total_io_size_kbytes
Host_hypervisor_total_io_time_usecs
Host_hypervisor_total_read_io_size_kbytes
Host_hypervisor_total_read_io_time_usecs
Host_hypervisor_write_io_bandwidth_kbps

How can I report on this metric?


Thanks.

 

Hm, let me take a look at this. I know @Detho was able to pull this one out some time ago. It seemed as if it was a VM-scope metric rather then host one. Maybe he will be able to share his method in the meantime.


API v1 has stats as part of the VMs

[…]
  "entities": "
    {
      "vmId": “xxxxxxxxxxxxxx”,
      "uuid": “xxxxxxx”,
      "powerState": "off",
      "vmName": “abcd”,
      "guestOperatingSystem": null,
      "ipAddresses": n],
      "hypervisorType": "kKvm",
      "hostName": null,
      "hostId": null,
      "hostUuid": null,
      "containerIds":
        “xxxxxx8"
      u…]
      "stats": {
        "hypervisor_avg_io_latency_usecs": "-1",
        "num_read_iops": "-1",
        "hypervisor_write_io_bandwidth_kBps": "-1",
        "timespan_usecs": "-1",
        "controller_num_read_iops": "-1",
        "controller.storage_tier.ssd.usage_bytes": "97837056",
        "read_io_ppm": "-1",
        "controller_num_iops": "-1",
        "hypervisor_memory_assigned_bytes": "-1",
        "total_read_io_time_usecs": "-1",
        "controller_total_read_io_time_usecs": "0",
        "controller.storage_tier.ssd.configured_pinned_bytes": "0",
        "hypervisor_num_io": "-1",
        "controller_total_transformed_usage_bytes": "0",
        "hypervisor_cpu_usage_ppm": "0",
        "controller_num_write_io": "-1",
        "avg_read_io_latency_usecs": "-1",
        "guest.memory_swapped_in_bytes": "-1",
        "controller_total_io_time_usecs": "0",
        "memory_usage_ppm": "0",
        "controller_total_read_io_size_kbytes": "0",
        "controller_num_seq_io": "-1",
        "controller_read_io_ppm": "-1",
        "controller_total_io_size_kbytes": "0",
        "hypervisor.cpu_ready_time_ppm": "-1",
        "controller_num_io": "0",
        "hypervisor_avg_read_io_latency_usecs": "-1",
        "num_write_iops": "-1",
        "controller_num_random_io": "0",
        "num_iops": "-1",
        "guest.memory_usage_ppm": "0",
        "hypervisor_num_read_io": "-1",
        "hypervisor_total_read_io_time_usecs": "-1",
        "controller_avg_io_latency_usecs": "-1",
        "num_io": "-1",
        "controller_num_read_io": "0",
        "hypervisor_num_write_io": "-1",
        "controller_seq_io_ppm": "-1",
        "guest.memory_usage_bytes": "0",
        "controller_read_io_bandwidth_kBps": "-1",
        "controller_io_bandwidth_kBps": "-1",
        "hypervisor_num_received_bytes": "0",
        "hypervisor_timespan_usecs": "-1",
        "hypervisor_num_write_iops": "-1",
        "total_read_io_size_kbytes": "-1",
        "hypervisor_total_io_size_kbytes": "-1",
        "avg_io_latency_usecs": "-1",
        "hypervisor_num_read_iops": "-1",
        "hypervisor_swap_in_rate_kBps": "-1",
        "controller_write_io_bandwidth_kBps": "-1",
        "controller_write_io_ppm": "-1",
        "controller_user_bytes": "9475319296",
        "hypervisor_avg_write_io_latency_usecs": "-1",
        "hypervisor_num_transmitted_bytes": "0",
        "hypervisor_total_read_io_size_kbytes": "-1",
        "read_io_bandwidth_kBps": "-1",
        "guest.memory_swapped_out_bytes": "-1",
        "hypervisor_memory_usage_ppm": "0",
        "hypervisor_num_iops": "-1",
        "hypervisor_io_bandwidth_kBps": "-1",
        "controller_num_write_iops": "-1",
        "total_io_time_usecs": "-1",
        "controller_random_io_ppm": "-1",
        "controller.storage_tier.das-sata.usage_bytes": "13925916672",
        "controller_avg_read_io_size_kbytes": "-1",
        "hypervisor_swap_out_rate_kBps": "-1",
        "total_transformed_usage_bytes": "-1",
        "avg_write_io_latency_usecs": "-1",
        "num_read_io": "-1",
        "write_io_bandwidth_kBps": "-1",
        "hypervisor_read_io_bandwidth_kBps": "-1",
        "hypervisor_consumed_memory_bytes": "0",
        "random_io_ppm": "-1",
        "total_untransformed_usage_bytes": "-1",
        "hypervisor_total_io_time_usecs": "-1",
        "num_random_io": "-1",
        "controller_avg_write_io_size_kbytes": "-1",
        "controller_avg_read_io_latency_usecs": "-1",
        "controller.storage_tier.das-sata.configured_pinned_bytes": "0",
        "num_write_io": "-1",
        "total_io_size_kbytes": "-1",
        "controller.storage_tier.cloud.usage_bytes": "0",
        "io_bandwidth_kBps": "-1",
        "controller_timespan_usecs": "0",
        "num_seq_io": "-1",
        "seq_io_ppm": "-1",
        "write_io_ppm": "-1",
        "controller_avg_write_io_latency_usecs": "-1"
      },

 

An article with examples Getting VM Performance Metrics via API as well.


Are there plans to have all the metrics under a single API version?


As per the documentation ‘Users of the v1 API are encouraged to migrate to v2’.

So when are the metrics available via v1 also be available via v2 and v3?


I have not heard of intention to merge the API versions, unfortunately. I can see how it would be handy.