locked
WMI interface for finding VHD in use RRS feed

  • Question

  • I went through WMI interfaces for Hyper-V but did not find anything relavent. Msvm_VirtualDiskInfo is the close one but it has no methods. How do we instantiate this class? Especially, how do I pass the VHD information to collect the properties defined in this class?

    Thanks

    Saturday, March 8, 2008 3:15 PM

Answers

  • We don't plan on changing the interface from returning an embedded instance.

     

    Though I'm no WMI expert (and I could be wrong) I believe there are other ways to play with embedded WMI instances.  Try MSDN or your favorite search engine.

     

    Thanks,
    Chris

     

    Monday, March 10, 2008 4:31 PM
  • Hi,

     

    According to the description, the issue seems to be related to development. This forum is dedicated to questions about Windows Server 2008 virtualization issues. As we are not the best support resource for development, It is recommend you to get further support in our MSDN forum

     

    MSDN Forum
    http://forums.microsoft.com/MSDN/default.aspx?SiteID=1
     
    Thanks for your understandings.

    Tuesday, March 11, 2008 11:04 AM

All replies

  • Check out Msvm_ImageManagementService->GetVirtualHardDiskInfo().  You pass in the fully-qualified path to the VHD and get back an embedded instance of Msvm_VirtualHardDiskInfo.

     

    I found it here: http://msdn2.microsoft.com/en-us/library/cc136797(VS.85).aspx

     

    Is that what you're looking for?

    Sunday, March 9, 2008 4:13 AM
  • Thanks for the response. I went through this class and it gives the output as one single string. Here is what I see on my system
    instance of Msvm_VirtualHardDiskInfo {Type = 3;FileSize = 2405406208;MaxInternalSize = 32212254720;InSavedState = TRUE;InUse = FALSE;};

    looks like I will have to parse this myself and get the required information. Is it not possible to get the output as the structure defined in Msvm_VirtualHardDiskInfo class? I feel that will be more meaningful


    Thanks
    Sunday, March 9, 2008 4:29 PM
  • We don't plan on changing the interface from returning an embedded instance.

     

    Though I'm no WMI expert (and I could be wrong) I believe there are other ways to play with embedded WMI instances.  Try MSDN or your favorite search engine.

     

    Thanks,
    Chris

     

    Monday, March 10, 2008 4:31 PM
  • Hi,

     

    According to the description, the issue seems to be related to development. This forum is dedicated to questions about Windows Server 2008 virtualization issues. As we are not the best support resource for development, It is recommend you to get further support in our MSDN forum

     

    MSDN Forum
    http://forums.microsoft.com/MSDN/default.aspx?SiteID=1
     
    Thanks for your understandings.

    Tuesday, March 11, 2008 11:04 AM
  • Thanks David. I did not know about the MSDN forum until you provided the link
    Tuesday, March 11, 2008 12:15 PM