HyperV using WMI RRS feed

  • Question

  • Hello,

    we plan to use the VHD APIs ( to manage the VMs. As per this reference guide, the api TakeSnapshotVhdSet() is supported only with Windows 2016 server.

    What API to be used for creating the checkpoint (snapshot) in windows 2008, win 2012 servers?

    Thanks in advance


    Monday, November 30, 2015 9:08 AM


All replies

  • On those platforms you would take a snapshot, and you would use the v1 namespace example:

    v2 namespace explanation:

    v1 namespace WMI example:

    Brian Ehlert
    Learn. Apply. Repeat.

    • Marked as answer by Bala_T Tuesday, December 1, 2015 7:24 AM
    Monday, November 30, 2015 5:30 PM
  • The other query are

    (1) when the snapshot is created, do we have WMI calls to perform 

    1. consolidation of delta changes (I think ApplyVirtualSystemSnapshot to be used)
    2. Destroy/remove snapshot without consolidating the delta changes (???)

    (2) Is there a way to uniquely identify the disks of the VM ? Any GUID associated with VM virtual hard disks ?

    disknames are not unique, as they can be created with the same names using hyperv manager. 

    Tuesday, December 1, 2015 7:36 AM
  • Deleting a snapshot will consolidate the delta disks.

    You can either Revert to a previous snapshot or you can apply a previous snapshot then delete the branch that remains.

    Each disk has an identifier that is unique to the virtual storage management layer.  However, the disk path is something that must also be unique.

    In Ben's blog there are WMI samples of finding all of the attached disks, using the WMI association classes.

    It also occurred to me that this post might be useful to you:

    Brian Ehlert
    Learn. Apply. Repeat.

    Tuesday, December 1, 2015 2:00 PM
  • Thanks. Appreciate your quick response.

    1. To identify the disks 

    Looks lot of the class used in the above example are obsoleted with windows 2k12.

    Do you have such script that finds the disks ?

    2. Hard disk Identifier ??

    GetVirtualHardDiskInfo method of the Msvm_ImageManagementService class - obsoleted in windows 2012. This returns Msvm_VirtualHardDiskInfo object. But this does not contain the virtual disk ID.

    But the virtual disk Id is available from windows 2012 as part of the Msvm_VirtualHardDiskSettingData class. 

    How to get the Virtual hard disk ID for the Windows 2008, 2008 R2.

    Wednesday, December 2, 2015 9:05 AM