MeasureVM Error when using pass-through disks

3 min read

Hello Folks,

Today I came across a weird issue while Measuring a Virtual Machine hosted on HV 2012 R2.

Error @ Measure-VM : Object reference not set to an instance of an object…

Quick introduction:

As you already know that Hyper-V in Windows Server 2012/R2 includes Resource Metering, a feature that you can use to monitor resource consumption over time, per virtual machine or resource pool. Resource pools are logical containers that collect resources of the virtual machines. When you use resource pools, you can enable Resource Metering and query on resource use in the same way as for a single virtual machine. Resource Metering works with all Hyper-V operations. The movement of virtual machines between Hyper-V hosts, for example by using live migration, does not affect the data collection process.

Here is the scenario:

I enabled VMResourceMetering for all VMs on the host, then waited sometime to collect some data, and here is the result:

Get-VM * | Enable-VMResourceMetering 

Get-VM * | Measure-VM to get the VM resource usage info

Measure-VM Error

 :( I can see only one VM detail resources…

Let’s see if all VMs has Resource Metering Enabled

Get-VM * | Format-List Name,ResourceMeteringEnabled ResourceMeteringEnabled

Great, all VMs have ResourceMeteringEnabled… muuuu

As you can see this box is still virgin with two VMs only :)

Let’s dig deeper…

Get-VM -Name XXX | Disable-VMResourceMetering

Get-VM -Name XXX | Enable-VMResourceMetering



Get-VM * | Measure-VM

Measure-VM Error

Still No hope… :(

So what is the difference between those two VMs…???

Let’s look into the VM settings and compare…

As you can see one VM is Generation 2 and the second is Generation 1, then one VM is configured with additional SCSI hard Drive using pass-through physical disk.


SSMSVM Since In Windows Server 2012 R2 we have new storage metrics added to Resource Metering:

  1. AggregatedAverageNormalizedIOPS     
  2. AggregatedAveragelatency
  3. AggregatedDiskDataRead
  4. AggregatedDiskDataWritten

Let’s Remove the Pass-through physical disk and try again, here you go:

Bingo :)


Hopefully Hyper-V will support resource metering on Pass-through disks in future release to measure the average IOPS.

Of course when you choose to use Pass-through disks, you want to take into consideration the following limitations:

·         You cannot use differencing virtual hard disks with pass-through disks.

·         Checkpoints are not available on pass-through disks.

·         The physical disk must be set to offline state on the Hyper-V host before you can configure it as a pass-through disk for a virtual machine.

·         You cannot expand pass-through disks dynamically, unless such functionality is provided in the SAN.

·         The Hyper-V Volume Shadow Copy Service (VSS) writer cannot back up pass-through disks, and you cannot use Windows Server Backup in the parent partition to back up such disks. In such a case, you should use the backup program that is installed on the virtual machine.

·         You cannot use “Shared Nothing Live Migration” for migrations outside of a cluster because the disk is directly attached and doesn’t have a way to move between hosts.

In conclusion Pass-through disks are not flexible.

Enjoy the day!


About Charbel Nemnom 579 Articles
Charbel Nemnom is a Cloud Architect, Swiss Certified ICT Security Expert, Microsoft Most Valuable Professional (MVP), and Microsoft Certified Trainer (MCT), totally fan of the latest's IT platform solutions, accomplished hands-on technical professional with over 17 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize the performance of mission-critical enterprise systems. Excellent communicator is adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design, business continuity, and cloud security.

Be the first to comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.