none
Hyper-V Performance counter

    Question

  • Hi All,

    Unlike the functions/commands used, I would like to know is there any way to fetch the below information through performance counters available with the Hyper-V system.

    1. To fetch the name of all VM instances that resides in the Hyper-V system
    2. To fetch the GUID of all VM instances that resides in the Hyper-V system

    Thanks,

    Dinesh

    Wednesday, May 03, 2017 1:12 PM

All replies

  • The information you are looking for are not generally obtained through performance counters, because it is not a performance value.

    The PowerShell cmdlet, Get-VM, will get the name of all VM instances from one or more Hyper-V hosts.  One of the values returned is the VMid, which is the GUID used by Hyper-V to identify the VM.


    tim


    Wednesday, May 03, 2017 10:46 PM
  • Hi Sir,

    >>I would like to know is there any way to fetch the below information through performance counters available with the Hyper-V system.

    Do you mean the performance counters listed in Perfmon ?

    If yes , please consider the following commands:

    $a = (get-counter -Counter "\Hyper-V Dynamic Memory VM(*)\Smart Paging Working Set Size").countersamples | ?{$_.path -like "*xxx*"}
    $a.cookedvalue

    Please replace the counter name and "xxx" (vm name) .

    Best Regards,

    Elton


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, May 05, 2017 4:23 AM
    Moderator