Virtual hard disk management sample

This sample demonstrates how to use the Hyper-V WMI APIs and Virtual Hard Disk APIs to manage virtual hard disks.

 
 
 
 
 
5 Star
(3)
16,798 times
Add to favorites
8/15/2012
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • This is very nice but only works locally
    1 Posts | Last post May 12, 2014
    • I made a slight change to the VirtualHardDiskSettingData.cs file. The GetVirtualHardDiskSettingDataEmbeddedInstance function was modified to accept a ManagementScope scope object, and then down inside where we are using ManagementClass settingClass we just assign settingClass.Scope = scope; and now this *ought* to allow us to work with disks remotely.
      
      I've not tested this yet, but after looking at the wmiutilities functions, this seems to be the proper fix.
  • How to creating differencing VHD on Windows 2008 R2?
    1 Posts | Last post March 05, 2013
    • The sample provided work on Win 8/2012 but, how to do it on 2008 R2?
      
      CREATE_VIRTUAL_DISK_VERSION_2 is not available in 2008 R2, I tried using CREATE_VIRTUAL_DISK_VERSION_1 with params.Version1.ParentPath as a parent vhd for which i want a differencing vhd to be crated. I get a error code of 87 by CreateVirtualDisk which means incorrect parameters. 
      
      Any suggestions?