Miscellaneous script - Get-VMDiskMapping

Version 2

    Did you ever got a request to extend a disk on a VM?

    Most probably you were asked by the server administrator or dba to extend Windows disk number x

    Unfortunately this Windows disk number doesn't correspond to the virtual disk number of your VM.

    Finding out which virtual disk in the VM's settings corresponds to this Windows disk can be a cumbersome task.

    Especially when you have multiple SCSI controllers and/or many disks attached to your VM.

     

    This script matches Windows disks and their VMware virtual disk counterparts.

    It uses the Invoke-VMScript cmdlet to retrieve WMI information from the Windows guest, so there is no network connection needed to the VM.

    This makes the script suitable for isolated guests too (Internal only network, DMZ, or otherwise seperated by firewall).

     

    Multiple vCenter- or ESX(i)-servers can be added to the $VCServerList array, so there's no need to know which host or vCenter manages your VM.

     

    Screenshot:

    http://www.van-lieshout.com/wp-content/uploads/2010/03/Get-VMDiskMapping.png

     

     

     

     

     

    More info on the Get-VMDiskMapping script and also a VESI/PowerGUI PowerPack version can be found here:

    http://www.van-lieshout.com/2010/02/powercli-match-vm-and-windows-harddisks-part-2/

     

     

    More info on retrieving WMI info using Invoke-VMScript cmdlet:

    http://www.van-lieshout.com/2010/01/powercli-get-wmi-info-from-isolated-guests/

     

     

    Screenshot from the PowerPack version:

    http://www.van-lieshout.com/wp-content/uploads/2010/02/Get-DiskMapping-VESI.jpg