How Are My VHD’s/Passthough Disk’s Connected To My Virtual Machine?
Updated 2/23 – Added VHD File Size and Fixed a Few Bugs.
This is a follow up on my previous post on Hyper-V WMI: What VHD’s/Physical Disks Are Associated With a Virtual Machine?. I had been getting questions about how to better identify what disks are connected to what bus location/controller. Specifically I have been getting a lot of questions about how back up or copy just the VHD that the guest sees as drive letter C or D etc… I wrote a revised script that gives a bit more information specifically the controller addresses and the Instance ID of the controller. The reason that’s interesting is that you can determine that the C volume is on Disk Number 1 and that Disk Number 1 is connected to IDE Port 0/1 and on the parent you know that IDE Port 0/1 is backed by S:\vhds\foo.vhd well then you know what to backup… So what about SCSI controller’s? Well they are a bit more challenging but not to much – if you look at the PNP ID of the controller its VMBUS\<GUID> where the GUID is the same as the first GUID in the WMI instance id for the controller on the management OS (take a look at the screen capture below). Hopefully this is helpful – Enjoy!
Here’s the Script:
|
Here’s the Output of the Script:
PS D:\> .\DiskAttachment2.ps1 VHD Connections: Virtual Hard Disk At: C:\Users\Public\Documents\Hyper-V\Virtual hard disks\SERVER2008-ENT-64-6001.18000.080118-1840_amd64fre_ServerEnterprise_en-us_VL.vhd Virtual Hard Disk Connected To: IDE Controller 0 Controller Index: 0 Controller Instance ID: Microsoft:4DA5F246-7501-49B3-AE41-B1B5B4FCF57F\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0 Disk Location On Controller: 0 Virtual Hard Disk At: C:\vhd\VHD on Local Storage.vhd Virtual Hard Disk Connected To: IDE Controller 0 Controller Index: 0 Controller Instance ID: Microsoft:4DA5F246-7501-49B3-AE41-B1B5B4FCF57F\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0 Disk Location On Controller: 1 Virtual Hard Disk At: S:\Vhds\VHD on LUN.vhd Virtual Hard Disk Connected To: SCSI Controller Controller Index: Controller Instance ID: Microsoft:4DA5F246-7501-49B3-AE41-B1B5B4FCF57F\B090A115-B8E6-4706-BE6C-C8ECDDC4A90B\0 Disk Location On Controller: 1 Virtual Hard Disk At: S:\Vhds\Disk on SCSI 2.vhd Virtual Hard Disk Connected To: SCSI Controller Controller Index: Controller Instance ID: Microsoft:4DA5F246-7501-49B3-AE41-B1B5B4FCF57F\87617569-E20C-4982-AC44-04A4251C82BA\0 Disk Location On Controller: 0 Physical Disk Connections: Passthrough Disk At: Disk 3 Passthrough Disk Drive Number: 3 Virtual Hard Disk Connected To: SCSI Controller Controller Index: Controller Instance ID: Microsoft:4DA5F246-7501-49B3-AE41-B1B5B4FCF57F\B090A115-B8E6-4706-BE6C-C8ECDDC4A90B\0 Disk Location On Controller: 0 |
Here’s a Screen Capture Of the PNP ID in the Guest:
Taylor Brown
Hyper-V Integration Test Lead
https://blogs.msdn.com/taylorb
Comments
Anonymous
February 23, 2009
PingBack from http://www.ditii.com/2009/02/24/how-are-my-vhd%e2%80%99spassthough-disk%e2%80%99s-connected-to-my-virtual-machine/Anonymous
December 05, 2009
<quote> if you look at the PNP ID of the controller its VMBUS<GUID> where the GUID is the same as the first GUID in the WMI instance id for the controller on the management OS </quote> I don't find any similar GUID in the screen shot? Any further calculation needed?Anonymous
January 22, 2010
The comment has been removedAnonymous
November 22, 2010
I don't see the match for the SCSI controllers guids in your sample. Am I missing something?