Files
windows_exporter/docs/collector.hyperv.md
T
2026-10-16 22:54:44 +02:00

56 KiB

hyperv collector

The hyperv collector exposes metrics about the Hyper-V hypervisor

Metric name prefix hyperv
Source Performance counters, Hyper-V WMI (root/virtualization/v2), virtdisk.dll
Enabled by default? No

Flags

--collector.hyperv.enabled

Comma-separated list of collectors to use, for example: --collector.hyperv.enabled=datastore,dynamic_memory_balancer,dynamic_memory_vm,host,hypervisor_logical_processor,hypervisor_root_partition,hypervisor_root_virtual_processor,hypervisor_virtual_processor,legacy_network_adapter,replica_vm,virtual_hard_disk,virtual_machine_health_summary,virtual_machine_vid_partition,virtual_network_adapter,virtual_network_adapter_drop_reasons,virtual_smb,virtual_storage_device,virtual_switch,vm_state,wmi_health

--collector.hyperv.virtual-hard-disk.refresh-interval

Interval at which the virtual_hard_disk sub-collector reads the disks in the background, for example 10m. Scrapes publish the values of the last refresh. Default: 5m.

Metrics

Hyper-V Datastore

Sub-collector datastore. It reads the Hyper-V DataStore performance counter set. Each virtual machine has its own instances, named after the VM GUID, for example <VM GUID> configuration file and <VM GUID> runtime file. They describe the files in which Hyper-V keeps the configuration and runtime state of the virtual machine (.vmcx, .vmrs, see virtual machine file types), for example their fragmentation, free space in their tables and the reads and writes to them. All metrics are prefixed with windows_hyperv_datastore.

Note

A Hyper-V DataStore is not a storage volume, unlike a datastore in VMware vSphere. These metrics don't report the capacity or usage of the volumes that hold the virtual machines. For Cluster Shared Volumes, use the shared_volumes sub-collector of the mscluster collector. For volumes of a single host, use the logical_disk collector.

The counter set has no instances on a host without virtual machines. The sub-collector then exports no windows_hyperv_datastore_* series and doesn't report an error.

Metric Name Description Type Labels
windows_hyperv_datastore_fragmentation_ratio Represents the fragmentation ratio of the DataStore. gauge datastore
windows_hyperv_datastore_sector_size_bytes Represents the sector size of the DataStore in bytes. gauge datastore
windows_hyperv_datastore_data_alignment_bytes Represents the data alignment of the DataStore in bytes. gauge datastore
windows_hyperv_datastore_current_replay_log_size_bytes Represents the current replay log size of the DataStore in bytes. gauge datastore
windows_hyperv_datastore_available_entries Represents the number of available entries inside object tables. gauge datastore
windows_hyperv_datastore_empty_entries Represents the number of empty entries inside object tables. gauge datastore
windows_hyperv_datastore_free_bytes Represents the number of free bytes inside key tables. gauge datastore
windows_hyperv_datastore_data_end_bytes Represents the data end of the DataStore in bytes. gauge datastore
windows_hyperv_datastore_file_objects Represents the number of file objects in the DataStore. gauge datastore
windows_hyperv_datastore_object_tables Represents the number of object tables in the DataStore. gauge datastore
windows_hyperv_datastore_key_tables Represents the number of key tables in the DataStore. gauge datastore
windows_hyperv_datastore_file_data_size_bytes Represents the file data size in bytes of the DataStore. gauge datastore
windows_hyperv_datastore_table_data_size_bytes Represents the table data size in bytes of the DataStore. gauge datastore
windows_hyperv_datastore_names_size_bytes Represents the names size in bytes of the DataStore. gauge datastore
windows_hyperv_datastore_number_of_keys Represents the number of keys in the DataStore. gauge datastore
windows_hyperv_datastore_reconnect_latency_seconds Represents the reconnect latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_disconnects_total Represents the disconnect count of the DataStore. counter datastore
windows_hyperv_datastore_write_to_file_byte_latency_seconds Represents the write-to-file byte latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_write_to_file_bytes_total Represents the write-to-file byte count of the DataStore. counter datastore
windows_hyperv_datastore_write_to_file_operations_total Represents the write-to-file count of the DataStore. counter datastore
windows_hyperv_datastore_read_from_file_byte_latency_seconds Represents the read-from-file byte latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_read_from_file_bytes_total Represents the read-from-file byte count of the DataStore. counter datastore
windows_hyperv_datastore_read_from_file_operations_total Represents the read-from-file count of the DataStore. counter datastore
windows_hyperv_datastore_write_to_storage_byte_latency_seconds Represents the write-to-storage byte latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_write_to_storage_bytes_total Represents the write-to-storage byte count of the DataStore. counter datastore
windows_hyperv_datastore_write_to_storage_operations_total Represents the write-to-storage count of the DataStore. counter datastore
windows_hyperv_datastore_read_from_storage_byte_latency_seconds Represents the read-from-storage byte latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_read_from_storage_bytes_total Represents the read-from-storage byte count of the DataStore. counter datastore
windows_hyperv_datastore_read_from_storage_operations_total Represents the read-from-storage count of the DataStore. counter datastore
windows_hyperv_datastore_commit_byte_latency_seconds Represents the commit byte latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_commit_bytes_total Represents the commit byte count of the DataStore. counter datastore
windows_hyperv_datastore_commits_total Represents the commit count of the DataStore. counter datastore
windows_hyperv_datastore_cache_update_operation_latency_seconds Represents the cache update operation latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_cache_update_operations_total Represents the cache update operation count of the DataStore. counter datastore
windows_hyperv_datastore_commit_operation_latency_seconds Represents the commit operation latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_commit_operations_total Represents the commit operation count of the DataStore. counter datastore
windows_hyperv_datastore_compact_operation_latency_seconds Represents the compact operation latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_compact_operations_total Represents the compact operation count of the DataStore. counter datastore
windows_hyperv_datastore_load_file_operation_latency_seconds Represents the load file operation latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_load_file_operations_total Represents the load file operation count of the DataStore. counter datastore
windows_hyperv_datastore_remove_operation_latency_seconds Represents the remove operation latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_remove_operations_total Represents the remove operation count of the DataStore. counter datastore
windows_hyperv_datastore_query_size_operation_latency_seconds Represents the query size operation latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_query_size_operations_total Represents the query size operation count of the DataStore. counter datastore
windows_hyperv_datastore_set_operation_latency_seconds Represents the set operation latency in seconds of the DataStore. gauge datastore
windows_hyperv_datastore_set_operations_total Represents the set operation count of the DataStore. counter datastore

Hyper-V Dynamic Memory Balancer

Some metrics explained: https://learn.microsoft.com/en-us/archive/blogs/chrisavis/monitoring-dynamic-memory-in-windows-server-hyper-v-2012

Name Description Type Labels
windows_hyperv_dynamic_memory_balancer_available_memory_bytes Represents the amount of memory left on the node. gauge balancer
windows_hyperv_dynamic_memory_balancer_available_memory_for_balancing_bytes Represents the available memory for balancing purposes. gauge balancer
windows_hyperv_dynamic_memory_balancer_average_pressure_ratio Represents the average system pressure on the balancer node among all balanced objects. gauge balancer
windows_hyperv_dynamic_memory_balancer_system_current_pressure_ratio Represents the current pressure in the system. gauge balancer

Hyper-V Dynamic Memory VM

Name Description Type Labels
windows_hyperv_dynamic_memory_vm_added_total Represents the cumulative amount of memory added to the VM. counter vm
windows_hyperv_dynamic_memory_vm_pressure_current_ratio Represents the current pressure in the VM. gauge vm
windows_hyperv_dynamic_memory_vm_guest_available_bytes Represents the current amount of available memory in the VM (reported by the VM). gauge vm
windows_hyperv_dynamic_memory_vm_guest_visible_physical_memory_bytes Represents the amount of memory visible in the VM. gauge vm
windows_hyperv_dynamic_memory_vm_pressure_maximum_ratio Represents the maximum pressure band in the VM. gauge vm
windows_hyperv_dynamic_memory_vm_add_operations_total Represents the total number of add operations for the VM. counter vm
windows_hyperv_dynamic_memory_vm_remove_operations_total Represents the total number of remove operations for the VM. counter vm
windows_hyperv_dynamic_memory_vm_pressure_minimum_ratio Represents the minimum pressure band in the VM. gauge vm
windows_hyperv_dynamic_memory_vm_physical_bytes Represents the current amount of memory in the VM. gauge vm
windows_hyperv_dynamic_memory_vm_removed_bytes_total Represents the cumulative amount of memory removed from the VM. counter vm

Windows reports no instance name for VMs managed by the Host Compute Service, such as the WSL 2 VM. The first such VM has vm="(unknown)", further ones vm="(unknown)#1", vm="(unknown)#2" and so on. VMs with the same name get the same suffixes, here and in the VM Vid Partition, Hypervisor Virtual Processor and Replica VM performance counter metrics, and so do virtual switches with the same name. All cores of one VM share its suffix; this relies on Windows listing the virtual processors of a VM together, starting with core 0. The suffix only keeps the series unique and does not identify the VM across scrapes or between these metric groups.

Hyper-V Host

Metrics about the host's CPU allocation. Processor counts per virtual machine are read from the Host Compute Service API; the logical processor count comes from the Hyper-V Hypervisor Logical Processor performance counter object. The Host Compute Service API requires Windows Server 2019 or later; on older versions the sub-collector is skipped with a warning.

Metric Name Description Type Labels
windows_hyperv_host_logical_processors Number of logical processors on the host gauge None
windows_hyperv_vm_processors Number of virtual processors assigned to the VM gauge vm_id, vm
windows_hyperv_assigned_vm_processors Total number of virtual processors assigned to all VMs gauge None

The CPU allocation ratio can be computed in PromQL. Virtual cores per logical host core:

windows_hyperv_assigned_vm_processors / windows_hyperv_host_logical_processors

Where hyper-threading (SMT) is enabled, the host reports two logical cores per physical core. Multiply by the number of threads per core to get the ratio per physical core.

Hyper-V Hypervisor Logical Processor

Name Description Type Labels
windows_hyperv_hypervisor_logical_processor_time_seconds_total Time that processor spent in different modes (hypervisor, guest, idle) counter core,state
windows_hyperv_hypervisor_logical_processor_total_run_time_seconds_total Time that processor spent counter core
windows_hyperv_hypervisor_logical_processor_context_switches_total The rate of virtual processor context switches on the processor. counter core

Hyper-V Hypervisor Root Partition

Name Description Type Labels
windows_hyperv_root_partition_address_spaces The number of address spaces in the virtual TLB of the partition gauge None
windows_hyperv_root_partition_attached_devices The number of devices attached to the partition gauge None
windows_hyperv_root_partition_deposited_pages The number of pages deposited into the partition gauge None
windows_hyperv_root_partition_device_dma_errors An indicator of illegal DMA requests generated by all devices assigned to the partition gauge None
windows_hyperv_root_partition_device_interrupt_errors An indicator of illegal interrupt requests generated by all devices assigned to the partition gauge None
windows_hyperv_root_partition_device_interrupt_mappings The number of device interrupt mappings used by the partition gauge None
windows_hyperv_root_partition_device_interrupt_throttle_events_total The number of times an interrupt from a device assigned to the partition was temporarily throttled because the device was generating too many interrupts counter None
windows_hyperv_root_partition_gpa_pages The number of pages present in the GPA space of the partition (zero for root partition) gauge None
windows_hyperv_root_partition_gpa_space_modifications_total The number of modifications to the GPA space of the partition counter None
windows_hyperv_root_partition_io_tlb_flush_seconds_total The time spent processing I/O TLB flushes. Divide its rate by the rate of windows_hyperv_root_partition_io_tlb_flushes_total for the average time per flush counter None
windows_hyperv_root_partition_io_tlb_flushes_total The number of flushes of I/O TLBs of the partition counter None
windows_hyperv_root_partition_recommended_virtual_tlb_size The recommended number of pages to be deposited for the virtual TLB gauge None
windows_hyperv_root_partition_skipped_timer_ticks_total The number of timer interrupts skipped for the partition counter None
windows_hyperv_root_partition_1g_device_pages The number of 1G pages present in the device space of the partition gauge None
windows_hyperv_root_partition_1g_gpa_pages The number of 1G pages present in the GPA space of the partition gauge None
windows_hyperv_root_partition_2m_device_pages The number of 2M pages present in the device space of the partition gauge None
windows_hyperv_root_partition_2m_gpa_pages The number of 2M pages present in the GPA space of the partition gauge None
windows_hyperv_root_partition_4k_device_pages The number of 4K pages present in the device space of the partition gauge None
windows_hyperv_root_partition_4k_gpa_pages The number of 4K pages present in the GPA space of the partition gauge None
windows_hyperv_root_partition_virtual_tlb_flush_entries_total The number of flushes of the entire virtual TLB counter None
windows_hyperv_root_partition_virtual_tlb_pages The number of pages used by the virtual TLB of the partition gauge None

Hyper-V Hypervisor Root Virtual Processor

Name Description Type Labels
windows_hyperv_hypervisor_root_virtual_processor_time_seconds_total Time in seconds that processor spent in different modes (state: guest_run, hypervisor, remote) counter core,state
windows_hyperv_hypervisor_root_virtual_processor_total_run_time_seconds_total Time in seconds that processor spent running counter core
windows_hyperv_hypervisor_root_virtual_processor_cpu_wait_seconds_total The time spent waiting for a virtual processor to be dispatched onto a logical processor. Divide its rate by the rate of windows_hyperv_hypervisor_root_virtual_processor_dispatches_total for the average wait per dispatch counter core
windows_hyperv_hypervisor_root_virtual_processor_dispatches_total The number of times the virtual processor was dispatched onto a logical processor counter core

Hyper-V Legacy Network Adapter

Name Description Type Labels
windows_hyperv_legacy_network_adapter_bytes_dropped_total Bytes Dropped is the number of bytes dropped on the network adapter counter adapter
windows_hyperv_legacy_network_adapter_bytes_received_total Bytes received is the number of bytes received on the network adapter counter adapter
windows_hyperv_legacy_network_adapter_bytes_sent_total Bytes sent is the number of bytes sent over the network adapter counter adapter
windows_hyperv_legacy_network_adapter_frames_dropped_total Frames Dropped is the number of frames dropped on the network adapter counter adapter
windows_hyperv_legacy_network_adapter_frames_received_total Frames received is the number of frames received on the network adapter counter adapter
windows_hyperv_legacy_network_adapter_frames_sent_total Frames sent is the number of frames sent over the network adapter counter adapter

Hyper-V Replica VM

Sub-collector replica_vm, enabled by default. The performance counter metrics come from the Hyper-V Replica VM counter set and only exist for virtual machines with Hyper-V Replica enabled. The health and state metrics come from the Msvm_ReplicationRelationship WMI class in the root/virtualization/v2 namespace and exist for every virtual machine, including those without replication.

Name Description Type Labels
windows_hyperv_replica_vm_average_replication_latency_seconds The average time taken to replicate the virtual machine gauge vm
windows_hyperv_replica_vm_average_replication_size_bytes The average size of the replicated data gauge vm
windows_hyperv_replica_vm_compression_efficiency The compression efficiency of the replicated data gauge vm
windows_hyperv_replica_vm_last_replication_size_bytes The size of the last replicated data gauge vm
windows_hyperv_replica_vm_network_received_bytes_total The total number of bytes received over the network for replication counter vm
windows_hyperv_replica_vm_network_sent_bytes_total The total number of bytes sent over the network for replication counter vm
windows_hyperv_replica_vm_replications_total The total number of replication cycles counter vm
windows_hyperv_replica_vm_replication_latency_seconds The time taken by the last replication of the virtual machine gauge vm
windows_hyperv_replica_vm_resynchronized_bytes_total The total number of bytes sent during resynchronization counter vm
windows_hyperv_replica_vm_health The replication health of the virtual machine, see below gauge vm, vm_id, relationship
windows_hyperv_replica_vm_state The replication state of the virtual machine, see below gauge vm, vm_id, relationship

The relationship label is primary for the primary replication relationship and extended for extended replication. The vm_id label is the ID of the virtual machine, which keeps virtual machines with the same name apart.

Values of windows_hyperv_replica_vm_health:

Value Health
0 Not applicable
1 OK
2 Warning
3 Critical

Values of windows_hyperv_replica_vm_state:

Value State
0 Disabled
1 Ready for replication
2 Waiting to complete initial replication
3 Replicating
4 Synced replication complete
5 Recovered
6 Committed
7 Suspended
8 Critical
9 Waiting to start resynchronization
10 Resynchronizing
11 Resynchronization suspended
12 Failover in progress
13 Failback in progress
14 Failback complete
15 Disk update in progress
16 Disk update critical
17 Unknown
18 Repurpose replication in progress
19 Prepared for sync replication
20 Prepared for group reverse replication
21 Fire drill in progress

Example alert:

- alert: HyperVReplicationCritical
  expr: windows_hyperv_replica_vm_health == 3
  for: 15m
  labels:
    severity: critical
  annotations:
    summary: Hyper-V replication of {{ $labels.vm }} is critical on {{ $labels.instance }}

Hyper-V Hypervisor Virtual Processor

Name Description Type Labels
windows_hyperv_hypervisor_virtual_processor_mode_time_seconds_total Time in seconds that processor spent in different modes (state: hypervisor, guest, remote) counter vm, core, state
windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total Time in seconds that processor spent running counter vm, core
windows_hyperv_hypervisor_virtual_processor_cpu_wait_seconds_total The time spent waiting for a virtual processor to be dispatched onto a logical processor. Divide its rate by the rate of windows_hyperv_hypervisor_virtual_processor_dispatches_total for the average wait per dispatch counter vm, core
windows_hyperv_hypervisor_virtual_processor_dispatches_total The number of times the virtual processor was dispatched onto a logical processor counter vm, core

Hyper-V Virtual Network Adapter

Name Description Type Labels
windows_hyperv_virtual_network_adapter_received_bytes_total Represents the total number of bytes received per second by the network adapter counter adapter
windows_hyperv_virtual_network_adapter_sent_bytes_total Represents the total number of bytes sent per second by the network adapter counter adapter
windows_hyperv_virtual_network_adapter_incoming_dropped_packets_total Represents the total number of dropped packets per second in the incoming direction of the network adapter counter adapter
windows_hyperv_virtual_network_adapter_outgoing_dropped_packets_total Represents the total number of dropped packets per second in the outgoing direction of the network adapter counter adapter
windows_hyperv_virtual_network_adapter_received_packets_total Represents the total number of packets received per second by the network adapter counter adapter
windows_hyperv_virtual_network_adapter_sent_packets_total Represents the total number of packets sent per second by the network adapter counter adapter

Hyper-V Virtual Network Adapter Drop Reasons

Name Description Type Labels
windows_hyperv_virtual_network_adapter_drop_reasons_total Number of packets dropped by a Hyper-V virtual network adapter, by drop reason and direction counter adapter,reason,direction

Hyper-V Virtual SMB

The vm label holds the instance name of the Hyper-V Virtual SMB performance counter object unchanged. Microsoft does not document its format (virtual machine name or ID), and the test hosts have no Virtual SMB instances, so it was not verified.

Name Description Type Labels
windows_hyperv_virtual_smb_direct_mapped_sections Represents the number of direct-mapped sections in the virtual SMB` gauge vm
windows_hyperv_virtual_smb_direct_mapped_pages Represents the number of direct-mapped pages in the virtual SMB` gauge vm
windows_hyperv_virtual_smb_rdma_write_bytes_total Represents the total number of bytes written using RDMA in the virtual SMB` counter vm
windows_hyperv_virtual_smb_write_bytes_total Represents the total number of bytes written in the virtual SMB` counter vm
windows_hyperv_virtual_smb_rdma_read_bytes_total Represents the total number of bytes read using RDMA in the virtual SMB` counter vm
windows_hyperv_virtual_smb_read_bytes_total Represents the total number of bytes read in the virtual SMB` counter vm
windows_hyperv_virtual_smb_flush_requests_total Represents the total number of flush requests in the virtual SMB` counter vm
windows_hyperv_virtual_smb_rdma_write_requests_total Represents the total number of write requests using RDMA in the virtual SMB` counter vm
windows_hyperv_virtual_smb_write_requests_total Represents the total number of write requests in the virtual SMB` counter vm
windows_hyperv_virtual_smb_rdma_read_requests_total Represents the total number of read requests using RDMA in the virtual SMB` counter vm
windows_hyperv_virtual_smb_read_requests_total Represents the total number of read requests in the virtual SMB` counter vm
windows_hyperv_virtual_smb_current_pending_requests Represents the current number of pending requests in the virtual SMB` gauge vm
windows_hyperv_virtual_smb_open_files Represents the current number of open files in the virtual SMB` gauge vm
windows_hyperv_virtual_smb_tree_connects_total Represents the total number of tree connects in the virtual SMB` counter vm
windows_hyperv_virtual_smb_requests_total Represents the total number of requests in the virtual SMB` counter vm
windows_hyperv_virtual_smb_sent_bytes_total Represents the total number of bytes sent in the virtual SMB` counter vm
windows_hyperv_virtual_smb_received_bytes_total Represents the total number of bytes received in the virtual SMB` counter vm

Hyper-V Virtual Switch

Name Description Type Labels
windows_hyperv_vswitch_broadcast_packets_received_total Represents the total number of broadcast packets received per second by the virtual switch counter vswitch
windows_hyperv_vswitch_broadcast_packets_sent_total Represents the total number of broadcast packets sent per second by the virtual switch counter vswitch
windows_hyperv_vswitch_bytes_total Represents the total number of bytes per second traversing the virtual switch counter vswitch
windows_hyperv_vswitch_bytes_received_total Represents the total number of bytes received per second by the virtual switch counter vswitch
windows_hyperv_vswitch_bytes_sent_total Represents the total number of bytes sent per second by the virtual switch counter vswitch
windows_hyperv_vswitch_directed_packets_received_total Represents the total number of directed packets received per second by the virtual switch counter vswitch
windows_hyperv_vswitch_directed_packets_send_total Represents the total number of directed packets sent per second by the virtual switch counter vswitch
windows_hyperv_vswitch_dropped_packets_incoming_total Represents the total number of packet dropped per second by the virtual switch in the incoming direction counter vswitch
windows_hyperv_vswitch_dropped_packets_outcoming_total Represents the total number of packet dropped per second by the virtual switch in the outgoing direction counter vswitch
windows_hyperv_vswitch_extensions_dropped_packets_incoming_total Represents the total number of packet dropped per second by the virtual switch extensions in the incoming direction counter vswitch
windows_hyperv_vswitch_extensions_dropped_packets_outcoming_total Represents the total number of packet dropped per second by the virtual switch extensions in the outgoing direction counter vswitch
windows_hyperv_vswitch_learned_mac_addresses_total Represents the total number of learned MAC addresses of the virtual switch counter vswitch
windows_hyperv_vswitch_multicast_packets_received_total Represents the total number of multicast packets received per second by the virtual switch counter vswitch
windows_hyperv_vswitch_multicast_packets_sent_total Represents the total number of multicast packets sent per second by the virtual switch counter vswitch
windows_hyperv_vswitch_number_of_send_channel_moves_total Represents the total number of send channel moves per second on this virtual switch counter vswitch
windows_hyperv_vswitch_number_of_vmq_moves_total Represents the total number of VMQ moves per second on this virtual switch counter vswitch
windows_hyperv_vswitch_packets_flooded_total Represents the total number of packets flooded by the virtual switch counter vswitch
windows_hyperv_vswitch_packets_total Represents the total number of packets per second traversing the virtual switch counter vswitch
windows_hyperv_vswitch_packets_received_total Represents the total number of packets received per second by the virtual switch counter vswitch
windows_hyperv_vswitch_packets_sent_total Represents the total number of packets send per second by the virtual switch counter vswitch
windows_hyperv_vswitch_purged_mac_addresses_total Represents the total number of purged MAC addresses of the virtual switch counter vswitch

Hyper-V Virtual Storage Device

Name Description Type Labels
windows_hyperv_virtual_storage_device_errors_total Represents the total number of errors that have occurred on this virtual device. counter device
windows_hyperv_virtual_storage_device_read_bytes_total Represents the total number of bytes that have been read on this virtual device. counter device
windows_hyperv_virtual_storage_device_operations_read_total Represents the total number of read operations that have occurred on this virtual device. counter device
windows_hyperv_virtual_storage_device_written_bytes_total Represents the total number of bytes that have been written on this virtual device. counter device
windows_hyperv_virtual_storage_device_operations_written_total Represents the total number of write operations that have occurred on this virtual device. counter device
windows_hyperv_virtual_storage_device_io_latency_seconds_total Represents the total IO transfer latency for this virtual device. counter device
windows_hyperv_virtual_storage_device_throughput_total Represents the total number of IO transfers completed by this virtual device. counter device
windows_hyperv_virtual_storage_device_normalized_throughput_total Represents the total number of IO transfers completed by this virtual device, normalized to 8KB transfers. counter device
windows_hyperv_virtual_storage_device_lower_io_latency_seconds_total Represents the total IO transfer latency on the underlying storage subsystem for this virtual device. counter device
windows_hyperv_virtual_storage_device_io_quota_replenishment_total Represents the IO quota replenishment counter for this virtual device. Use rate() for the replenishment rate. counter device

Latency and queue length

The Latency, Lower Latency, Queue Length and Lower Queue Length performance counters are averages that Windows computes from two samples. Their raw values only grow: the sum of all IO latencies in ticks of the counter time base (usually 10 MHz), and the raw queue length values are the same as the raw latency values. windows_exporter publishes them as the *_io_latency_seconds_total counters:

# Average IO latency in seconds
rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total[5m])
  / rate(windows_hyperv_virtual_storage_device_throughput_total[5m])

# Average queue length
rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total[5m])

Hyper-V VM Vid Partition

Name Description Type Labels
windows_hyperv_vid_physical_pages_allocated The number of physical pages allocated gauge vm
windows_hyperv_vid_preferred_numa_node_index The preferred NUMA node index associated with this partition gauge vm
windows_hyperv_vid_remote_physical_pages The number of physical pages not allocated from the preferred NUMA node gauge vm

Hyper-V VM State

Sub-collector vm_state, enabled by default. The performance counter objects only have instances for running virtual machines, so a VM that is off, saved or paused is missing from all other metrics. This sub-collector lists every virtual machine registered on the host with one WQL query per scrape (SELECT Name, ElementName, EnabledState FROM Msvm_ComputerSystem) against the root/virtualization/v2 namespace. The query times out after 5 seconds; a failed or timed-out query fails the hyperv collector (windows_exporter_collector_success{collector="hyperv"} is 0), like the replica_vm sub-collector. On a failover cluster, each node reports the virtual machines it currently owns.

Name Description Type Labels
windows_hyperv_vm_state The state of the virtual machine, 1 if the current state, 0 otherwise gauge vm, vm_id, state

Every virtual machine has one series per state: running, off, starting, stopping, saving, saved, pausing, paused, resuming, reset and unknown. The value is 1 for the current state and 0 for the others. state is read from Msvm_ComputerSystem.EnabledState. A fast-saved VM is reported as saved, a VM in a critical state (for example RunningCritical) as its base state, and a value without a mapping as unknown.

Replica VMs on a Hyper-V Replica server are turned off and show as state="off"; use the windows_hyperv_replica_vm_* metrics to tell them apart.

vm is the name of the virtual machine and vm_id its GUID, the same keys as the windows_hyperv_replica_vm_* and windows_hyperv_virtual_hard_disk_* metrics. VM names don't have to be unique, vm_id keeps the series apart.

Virtual machines that are turned off:

windows_hyperv_vm_state{state="off"} == 1

Number of virtual machines per state and host:

sum by (instance, state) (windows_hyperv_vm_state)

Example alert for a virtual machine that is expected to run:

- alert: HyperVVMNotRunning
  expr: windows_hyperv_vm_state{vm="web01", state="running"} == 0
  for: 10m
  annotations:
    summary: Hyper-V VM {{ $labels.vm }} is not running on {{ $labels.instance }}

Hyper-V WMI Health

Sub-collector wmi_health, enabled by default. It runs a minimal WQL query (SELECT Name FROM Msvm_ComputerSystem WHERE Name = '<computer name>') against the root/virtualization/v2 namespace on every scrape, so remove it from --collector.hyperv.enabled if you don't need it.

Name Description Type Labels
windows_hyperv_wmi_health Hyper-V WMI health status. 1 if the Hyper-V WMI namespace is responding, 0 if it is broken or not responding gauge None

WMI can stop responding while the host and the exporter otherwise keep running. On a Hyper-V cluster node, Failover Cluster Manager generally cannot connect to the host in that state, and recovery often requires a reboot. The query times out after 5 seconds and is then reported as 0.

Example alert:

- alert: HyperVWMIUnhealthy
  expr: windows_hyperv_wmi_health == 0
  for: 5m
  labels:
    severity: critical
  annotations:
    summary: Hyper-V WMI is not responding on {{ $labels.instance }}

Hyper-V Virtual Hard Disk

Sub-collector virtual_hard_disk, enabled by default. It reports the size and provisioning type of every virtual hard disk (VHD, VHDX, checkpoint AVHDX) attached to a virtual machine on this host. The disks are listed with two WQL queries against the root/virtualization/v2 namespace (Msvm_ComputerSystem and Msvm_StorageAllocationSettingData); the sizes are read with virtdisk.dll, the API behind Get-VHD. On a failover cluster, each node reports the virtual machines it currently owns.

The disks are read in the background every --collector.hyperv.virtual-hard-disk.refresh-interval (default 5m), so a scrape only publishes the last values and a slow or unreachable disk doesn't block the hyperv collector. The values can be up to one interval old. A disk that can't be read is logged and counted in windows_hyperv_virtual_hard_disk_read_errors; only a failed disk listing fails the collector.

Name Description Type Labels
windows_hyperv_virtual_hard_disk_size_bytes Maximum size of the virtual hard disk, as seen by the VM gauge vm, vm_id, path, type, device
windows_hyperv_virtual_hard_disk_file_size_bytes Size of the virtual hard disk file on storage gauge vm, vm_id, path, type, device
windows_hyperv_virtual_hard_disk_read_errors Number of attached virtual hard disks that could not be read in the last refresh gauge None
windows_hyperv_virtual_hard_disk_last_refresh_timestamp_seconds Time of the last successful refresh gauge None

type is fixed (thick provisioned), dynamic (thin provisioned), differencing (checkpoint or child disk) or unknown.

For a VM with checkpoints, path is the current .avhdx and file_size_bytes only counts that file. The parent disks aren't reported, so summing file_size_bytes per VM undercounts its storage.

device is the instance name of the disk in the Hyper-V Virtual Storage Device counter set, the same value as the device label of windows_hyperv_virtual_storage_device_*. It joins the I/O metrics with the virtual machine. The right-hand side is turned into 1 first, so the join only adds the vm label and keeps the values:

rate(windows_hyperv_virtual_storage_device_io_latency_seconds_total[5m])
  * on (instance, device) group_left (vm)
  (0 * windows_hyperv_virtual_hard_disk_size_bytes{device!=""} + 1)

The instance names are read from the counter set on every refresh and matched to path (Hyper-V replaces \ with - and (…) with […]). device is empty when the disk has no instance, which is the case for virtual machines that aren't running. The instance of a VHD-format checkpoint (.avhd) is named after the base disk of its chain; device is then that name. VHDX checkpoints (.avhdx) have their own instance.

Space promised to thin provisioned disks but not yet allocated:

sum by (instance) (
  windows_hyperv_virtual_hard_disk_size_bytes{type="dynamic"}
  - windows_hyperv_virtual_hard_disk_file_size_bytes{type="dynamic"}
)

Disks that could not be read, and stale data:

- alert: HyperVVirtualHardDiskReadErrors
  expr: windows_hyperv_virtual_hard_disk_read_errors > 0
  for: 30m
- alert: HyperVVirtualHardDiskStale
  expr: time() - windows_hyperv_virtual_hard_disk_last_refresh_timestamp_seconds > 3 * 300

Hyper-V Virtual Machine Health Summary

Name Description Type Labels
windows_hyperv_virtual_machines Number of virtual machines by health state gauge state

Example metric

This collector does not yet have explained examples, we would appreciate your help adding them!

Useful queries

Percent of physical CPU resources used per VM (on instance "localhost")

sum by (vm) (rate(windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total{instance="localhost"}[1m])) / ignoring(vm) group_left max (windows_cpu_logical_processor{instance="localhost"}) * 100

Percent of physical CPU resources used by all VMs (on all monitored hosts)

(sum by (instance)(rate(windows_hyperv_hypervisor_virtual_processor_run_time_seconds_total{}[1m]))) / max by (instance)(windows_cpu_logical_processor{}) * 100

Percent of physical CPU resources by the hosts themselves (on all monitored hosts)

(sum by (instance)(rate(windows_hyperv_hypervisor_root_virtual_processor_total_run_time_seconds_total{}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) * 100

Percent of physical CPU resources by the hypervisor (on all monitored hosts)

(sum by (instance)(rate(windows_hyperv_hypervisor_logical_processor_time_seconds_total{state="hypervisor"}[1m]))) / sum by (instance)(windows_cpu_logical_processor{}) * 100

Alerting examples

This collector does not yet have alerting examples, we would appreciate your help adding them!