Getting the statistics for VM's inside Hyper-v using WMI classes


  • I'm working on WMI classes to find out the statistics of a Hyper-v(Host) and number of VM's created inside Hyper-v using python. I'm stuck with finding classes for following statistics for VM's inside Hyper-v. In some classes i can find the attribute i want but when i query using the same it wont give me those attributes.

    Server : Windows Server 2012 R2

    For host statistics namespace : root\cimv2

    For VM statistics namespace : root\virtualization\v2

    WMI classes needed only for VM's (The "Msvm" classes) (i already have classes to query host)

    1) Number of cores

    2) Number of sockets

    3) Total RAM used

    4) RAM available

    5) Disk total size

    6) Used Disk size

    7) Total available Disk space

    8) Read and Write bytes/sec (for disk and memory)

    please help finding classes for the above.

    Note : Tried these classes

    Msvm_VirtualHardDiskSettingData (class only not working)

    Msvm_VirtualHardDiskInfo (gives back the command line, wont print anything)

    Msvm_ProcessorSettingData(it has attribute SocketCount but when i query that attribute wont get printed in output)

    Win32_PerfRawData_StorageStats_HyperVVirtualStorageDevice (gives me connection failed error)


    Win32_PerfRawData_PerfDisk_LogicalDisk (these two gives read and writes of host i guess)


    Win32_PerfFormattedData_PerfNet_ServerWorkQueues (confused with these two whether they give host or VM info)

    Please help.

    Thank you

    Tuesday, February 28, 2017 11:37 AM

All replies