Skip to content

(missing) HyperV in guest CPU usage #2326

@Dominik-esb

Description

@Dominik-esb

Problem Statement

Currently there is no way to get a Taskmgr like CPU utlliization for hyper-v VM in guest.

We have following metrics availible:

windows_hyperv_hypervisor_virtual_processor_mode_time_total	Time that processor spent in different modes (hypervisor, guest_run, guest_idle, remote)	counter	vm, core, state
windows_hyperv_hypervisor_virtual_processor_run_time_total	Time that processor spent	counter	vm, core 

I didnt find a way to calculate the in guest usage with this metrics.

Proposed Solution

I remember an issue some more time ago. It was about the windows CPU metrics and resulted in this new way to measure windows cpu util:

sum by (instance) (
  clamp_max(
    (
      rate(windows_cpu_processor_utility_total{
        job=~"$job",
      }[1m])
      /
      rate(windows_cpu_processor_rtc_total{
        job=~"$job",
      }[1m])
    ), 100
  )
) 

Maybe we can implement something for the in guest cpu usage.

I know hyper-v can report in guest metrics via the Measure-VM powershell command and also Windows admin center reports vm cpu metrics but I had no luck to find a winapi that help receiving this metrics.

Additional information

Maybe someone can help me find a way?

I want to use this place here to document my findings.

Acceptance Criteria

  • In guest vm CPU metric

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions