none
Double vRAM per VM

    Question

  • Hi,

    I tried to get vRAM per VM by powershell for stats but faced with strange thing for SOME VMs:

    gwmi -Query "select ElementName,NumberOfBlocks,Name from Msvm_Memory where NOT ElementName LIKE 'Memory of NUMA node%'" -Namespace root\virtualization\v2
    
    
    __GENUS          : 2
    __CLASS          : Msvm_Memory
    __SUPERCLASS     :
    __DYNASTY        :
    __RELPATH        :
    __PROPERTY_COUNT : 3
    __DERIVATION     : {}
    __SERVER         :
    __NAMESPACE      :
    __PATH           :
    ElementName      : The aggregate memory on the host
    Name             : Microsoft:4764334E-E001-4176-82EE-5594EC9B530E\Aggregate
    NumberOfBlocks   : 55284
    PSComputerName   :
    
    __GENUS          : 2
    __CLASS          : Msvm_Memory
    __SUPERCLASS     :
    __DYNASTY        :
    __RELPATH        :
    __PROPERTY_COUNT : 3
    __DERIVATION     : {}
    __SERVER         :
    __NAMESPACE      :
    __PATH           :
    ElementName      : Memory
    Name             : 2C94BF25-7CF8-4E76-9AA0-6A8DC95537B8
    NumberOfBlocks   : 18944
    PSComputerName   :
    
    __GENUS          : 2
    __CLASS          : Msvm_Memory
    __SUPERCLASS     :
    __DYNASTY        :
    __RELPATH        :
    __PROPERTY_COUNT : 3
    __DERIVATION     : {}
    __SERVER         :
    __NAMESPACE      :
    __PATH           :
    ElementName      : Memory
    Name             : 2C94BF25-7CF8-4E76-9AA0-6A8DC95537B8
    NumberOfBlocks   : 9472
    PSComputerName   :
    All VMs have static RAM however some of them return two values - real value (bigger) and value/2 (NumberOfBlocks). You can see this for VM with ID 2C94BF25-7CF8-4E76-9AA0-6A8DC95537B8. Could you tell me why?

    Thank you!

    Tuesday, January 17, 2017 9:10 AM

All replies

  • Hi Sintez,

    I just tested in my lab. It returned only one values for about 20 VMs.

    Did you get the same if you run the command again?

    >>All VMs have static RAM however some of them return two values

    Are there any differences between the VMs?

    Best Regards,

    Leo


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

    Wednesday, January 18, 2017 3:13 AM
    Moderator
  • Hi Leo,

    Thank you for your answer. I configure Splunk for VMs statistics. This means that the query runs every minute. And problem is still here. Today I make query again in powershell and found that I have three values per VM! I collected some info for you:

    CLUSTER:
    10 nodes [Hyper-V Hosts, 2012R2]

    QUERY:

    gwmi -Namespace root\virtualization\v2 -query "SELECT ElementName,NumberOfBlocks,Name FROM Msvm_Memory WHERE NOT ElementName LIKE 'Memory of NUMA node%'" | select Name,NumberOfBlocks

    Host E2 (6 VMs):

    Name                                                             NumberOfBlocks
    ----                                                             --------------
    Microsoft:4764334E-E001-4176-82EE-5594EC9B530E\Aggregate         32756
    04A2C10C-00D9-4394-A93A-9E548F4BA270                             4096
    46256936-935A-44AE-B46B-95A1BDCDB8C2                             5120
    4A7DAC0F-67C8-4A57-A02E-652D66B55EF2                             512
    7E255DC1-7D4B-4747-A726-A4923BC0FB22                             4096
    BF4BE038-6D66-4A93-87CB-1D198CF09FCC                             4096
    F8F7039D-35B0-4779-9370-08763ADE97A2                             8192

    You can see that host and their VMs are in normal state. However, if I get stats from another host in a cluster:

    Host E8 (3 VMs):

    Name                                                            NumberOfBlocks
    ----                                                            --------------
    Microsoft:4764334E-E001-4176-82EE-5594EC9B530E\Aggregate        98292
    21446C85-FA5F-4715-B201-193D11D9301F                            22016
    21446C85-FA5F-4715-B201-193D11D9301F                            11008
    21446C85-FA5F-4715-B201-193D11D9301F                            11008
    2C19BB77-84AD-42BC-B64F-C8C23D66269C                            22016
    E050DB71-EED5-43A9-ABB2-7F7ABE6307DE                            22016
    E050DB71-EED5-43A9-ABB2-7F7ABE6307DE                            11008
    E050DB71-EED5-43A9-ABB2-7F7ABE6307DE                            11008
    

    The biggest digit is a true value. Ok, let's go closer to VMs on E8:

    PS> Get-Vm
    Name  State   CPUUsage(%) MemoryAssigned(M) Uptime     Status
    ----  -----   ----------- ----------------- ------     ------
    RDSH4 Running 27          22016             1.15:47:47 Operating normally
    RDSH5 Running 23          22016             1.15:46:56 Operating normally
    RDSH8 Running 15          22016             1.15:47:30 Operating normally
    

    RDSH8 has ID 2C19BB77-84AD-42BC-B64F-C8C23D66269C from upper list. Its value of vRAM looks good. I try to get params of this VM:

    PS> Get-Vm RDSH8 | fl * -F
    VMName                      : RDSH8
    VMId                        : 2c19bb77-84ad-42bc-b64f-c8c23d66269c
    Id                          : 2c19bb77-84ad-42bc-b64f-c8c23d66269c
    Name                        : RDSH8
    State                       : Running
    IntegrationServicesState    : Up to date
    OperationalStatus           : {Ok}
    PrimaryOperationalStatus    : Ok
    SecondaryOperationalStatus  :
    StatusDescriptions          : {Operating normally}
    PrimaryStatusDescription    : Operating normally
    SecondaryStatusDescription  :
    Status                      : Operating normally
    Heartbeat                   : OkApplicationsHealthy
    ReplicationState            : Disabled
    ReplicationHealth           : NotApplicable
    ReplicationMode             : None
    CPUUsage                    : 18
    MemoryAssigned              : 23085449216
    MemoryDemand                : 0
    MemoryStatus                :
    SmartPagingFileInUse        : False
    Uptime                      : 1.15:49:18
    IntegrationServicesVersion  : 6.3.9600.18398
    ResourceMeteringEnabled     : False
    ConfigurationLocation       : C:\ClusterStorage\RDSH_L2_61\RDSH8
    SnapshotFileLocation        : C:\ClusterStorage\RDSH_L2_61\RDSH8
    AutomaticStartAction        : Nothing
    AutomaticStopAction         : Save
    AutomaticStartDelay         : 0
    SmartPagingFilePath         : C:\ClusterStorage\RDSH_L2_61\RDSH8
    NumaAligned                 : True
    NumaNodesCount              : 1
    NumaSocketCount             : 1
    Key                         : Microsoft.HyperV.PowerShell.VirtualMachineObjectKey
    IsDeleted                   : False
    ComputerName                : E8
    Version                     : 5.0
    Notes                       : #CLUSTER-INVARIANT#:{9ee94698-84af-4058-bb2d-d0282f1d46ab}
    Generation                  : 2
    Path                        : C:\ClusterStorage\RDSH_L2_61\RDSH8
    CreationTime                : 17.11.2015 12:01:57
    IsClustered                 : True
    SizeOfSystemFiles           : 90400
    ParentSnapshotId            :
    ParentSnapshotName          :
    MemoryStartup               : 23085449216
    DynamicMemoryEnabled        : False
    MemoryMinimum               : 536870912
    MemoryMaximum               : 1099511627776
    ProcessorCount              : 7
    RemoteFxAdapter             :
    NetworkAdapters             : {Network Adapter}
    FibreChannelHostBusAdapters : {Fibre Channel Adapter}
    ComPort1                    : Microsoft.HyperV.PowerShell.VMComPort
    ComPort2                    : Microsoft.HyperV.PowerShell.VMComPort
    FloppyDrive                 :
    DVDDrives                   : {DVD Drive on SCSI controller number 0 at location 1}
    HardDrives                  : {Hard Drive on SCSI controller number 0 at location 0}
    VMIntegrationService        : {Time Synchronization, Heartbeat, Key-Value Pair Exchange, Shutdown...}
    
    PS> Get-VMMemory RDSH8 | fl * -F
    
    Startup              : 23085449216
    DynamicMemoryEnabled : False
    Minimum              : 536870912
    Maximum              : 1099511627776
    Buffer               : 20
    Priority             : 50
    MaximumPerNumaNode   : 22822
    ResourcePoolName     : Primordial
    ComputerName         : E8
    Name                 : Memory
    Id                   : Microsoft:2C19BB77-84AD-42BC-B64F-C8C23D66269C\4764334d-e001-4176-82ee-5594ec9b530e
    IsDeleted            : False
    VMId                 : 2c19bb77-84ad-42bc-b64f-c8c23d66269c
    VMName               : RDSH8
    VMSnapshotId         : 00000000-0000-0000-0000-000000000000
    VMSnapshotName       :
    Key                  :
    

    Now I try to get params of RDSH4. Its ID is E050DB71-EED5-43A9-ABB2-7F7ABE6307DE:

    PS> Get-Vm RDSH4 | fl * -F
    
    VMName                      : RDSH4
    VMId                        : e050db71-eed5-43a9-abb2-7f7abe6307de
    Id                          : e050db71-eed5-43a9-abb2-7f7abe6307de
    Name                        : RDSH4
    State                       : Running
    IntegrationServicesState    : Up to date
    OperationalStatus           : {Ok}
    PrimaryOperationalStatus    : Ok
    SecondaryOperationalStatus  :
    StatusDescriptions          : {Operating normally}
    PrimaryStatusDescription    : Operating normally
    SecondaryStatusDescription  :
    Status                      : Operating normally
    Heartbeat                   : OkApplicationsHealthy
    ReplicationState            : Disabled
    ReplicationHealth           : NotApplicable
    ReplicationMode             : None
    CPUUsage                    : 22
    MemoryAssigned              : 23085449216
    MemoryDemand                : 0
    MemoryStatus                :
    SmartPagingFileInUse        : False
    Uptime                      : 1.15:54:35
    IntegrationServicesVersion  : 6.3.9600.18398
    ResourceMeteringEnabled     : False
    ConfigurationLocation       : C:\ClusterStorage\RDSH_L1_60\RDSH4
    SnapshotFileLocation        : C:\ClusterStorage\RDSH_L1_60\RDSH4
    AutomaticStartAction        : Nothing
    AutomaticStopAction         : Save
    AutomaticStartDelay         : 0
    SmartPagingFilePath         : C:\ClusterStorage\RDSH_L1_60\RDSH4
    NumaAligned                 : True
    NumaNodesCount              : 2
    NumaSocketCount             : 2
    Key                         : Microsoft.HyperV.PowerShell.VirtualMachineObjectKey
    IsDeleted                   : False
    ComputerName                : E8
    Version                     : 5.0
    Notes                       : #CLUSTER-INVARIANT#:{574807a2-d2f2-4307-acc4-338b23bfb560}
    Generation                  : 2
    Path                        : C:\ClusterStorage\RDSH_L1_60\RDSH4
    CreationTime                : 02.05.2015 22:08:11
    IsClustered                 : True
    SizeOfSystemFiles           : 104592
    ParentSnapshotId            :
    ParentSnapshotName          :
    MemoryStartup               : 23085449216
    DynamicMemoryEnabled        : False
    MemoryMinimum               : 15032385536
    MemoryMaximum               : 28991029248
    ProcessorCount              : 7
    RemoteFxAdapter             :
    NetworkAdapters             : {External (v25)}
    FibreChannelHostBusAdapters : {Fibre Channel Adapter}
    ComPort1                    : Microsoft.HyperV.PowerShell.VMComPort
    ComPort2                    : Microsoft.HyperV.PowerShell.VMComPort
    FloppyDrive                 :
    DVDDrives                   : {DVD Drive on SCSI controller number 0 at location 1}
    HardDrives                  : {Hard Drive on SCSI controller number 0 at location 0}
    VMIntegrationService        : {Time Synchronization, Heartbeat, Key-Value Pair Exchange, Shutdown...}
    
    PS> Get-VMMemory RDSH4 | fl * -F
    
    Startup              : 23085449216
    DynamicMemoryEnabled : False
    Minimum              : 15032385536
    Maximum              : 28991029248
    Buffer               : 20
    Priority             : 50
    MaximumPerNumaNode   : 17238
    ResourcePoolName     : Primordial
    ComputerName         : E8
    Name                 : Memory
    Id                   : Microsoft:E050DB71-EED5-43A9-ABB2-7F7ABE6307DE\4764334d-e001-4176-82ee-5594ec9b530e
    IsDeleted            : False
    VMId                 : e050db71-eed5-43a9-abb2-7f7abe6307de
    VMName               : RDSH4
    VMSnapshotId         : 00000000-0000-0000-0000-000000000000
    VMSnapshotName       :
    Key                  :
    

    I found that param "MaximumPerNumaNode" is different. I checked the same value on another host from one problem VM and one normal - it was the same for both VMs. I think it's not core of issue.

    I have 3 VMs with wrong params in cluster. I can choose only the biggest values of vRAM per VM for stats but I'm afraid of deeper issues with hosts or VMs. Is it a big problem?

    Thank you!

    Wednesday, January 18, 2017 9:55 AM
  • Hi Sintez,

    >>Is it a big problem?

    Not sure. Did you get any other issues when the VM is running?

    If you create new VMs with the VHD files of the problematic, is still the same issue?

    Best Regards,

    Leo


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

    Thursday, January 19, 2017 6:38 AM
    Moderator
  • Hi Leo,

    >>Not sure. Did you get any other issues when the VM is running?

    Nope. I found the issue only because of worked with wmi. Not because of problems =)

    >>If you create new VMs with the VHD files of the problematic, is still the same issue?

    I'm sorry I don't have lab for a test and possibility to stop the VM. I decided to skip wrong values by Splunk and choose the biggest. Thanks.

    Thursday, January 19, 2017 8:51 AM