Tag Archives: windows

How to match and correlate Windows SCSI Disk IDs with VMware VMDKs

*Note: This is a repost due to moving my posts from SystemsGame.com to 2ninjas1blog.com”

This post comes from a colleague of mine who couldn’t find a great resource on how to correlate the Windows Disk in Disk Management, with the Virtual Disk presented by VMware.

When all the disks are different sizes it is easy, but sometimes they are the same…how can you be sure you are expanding the right disk?

These instructions/steps should allow you to correlate Windows Disks to VMDK Disks.

  1. RDP  to the Windows server in question and run this powershell script
Get-WmiObject Win32_DiskDrive | select-object DeviceID,{$_.size/1024/1024/1024},scsiport,scsibus,scsitargetid,scsilogicalunit | out-file -FilePath c:\OutputPhysicalDrive.txt

This script should allow you to match the OS disks to the VMDK Disks. The output will be referenced in later steps.

Example output

DeviceID : \\.\PHYSICALDRIVE3
$_.size/1024/1024/1024 : 9.99680757522583
scsiport : 3
scsibus : 0
scsitargetid : 0
scsilogicalunit : 0

DeviceID : \\.\PHYSICALDRIVE6
$_.size/1024/1024/1024 : 49.9993586540222
scsiport : 5
scsibus : 0
scsitargetid : 1
scsilogicalunit : 0

DeviceID : \\.\PHYSICALDRIVE4
$_.size/1024/1024/1024 : 19.9936151504517
scsiport : 4
scsibus : 0
scsitargetid : 0
scsilogicalunit : 0

DeviceID : \\.\PHYSICALDRIVE0
$_.size/1024/1024/1024 : 59.996166229248
scsiport : 2
scsibus : 0
scsitargetid : 0
scsilogicalunit : 0

DeviceID : \\.\PHYSICALDRIVE1
$_.size/1024/1024/1024 : 19.9936151504517
scsiport : 2
scsibus : 0
scsitargetid : 1
scsilogicalunit : 0

DeviceID : \\.\PHYSICALDRIVE2
$_.size/1024/1024/1024 : 19.9936151504517
scsiport : 2
scsibus : 0
scsitargetid : 2
scsilogicalunit : 0

DeviceID : \\.\PHYSICALDRIVE5
$_.size/1024/1024/1024 : 49.9993586540222
scsiport : 5
scsibus : 0
scsitargetid : 0
scsilogicalunit : 0

The second step is to get a list of your VMDK disk information by editing the virtual machine in question. 

The information you will be retrieving is the
Disk Name: “Hard disk 1”
Size: “60 GB”
Bus ID: 0
Disk ID: 0

SCSI (X:Y) Hard Disk under Virtual Device Node. The X:Y values are:

X = Bus ID
Y = Disk ID

Enter the Disk information for all VMDK disks into a table like the one below:

Reference OutputPhysicalDrive.txt and match up any OS disks to VMDK disk that have a unique size.

For the non unique drives you will need to match the Windows disk scsitargetid with the VMDK Disk ID.

The first 2 in the example below are both 50GB Drives.

DeviceID : \\.\PHYSICALDRIVE6
$_.size/1024/1024/1024 : 49.9993586540222
scsiport : 5
scsibus : 0
scsitargetid : 1
scsilogicalunit : 0

DeviceID : \\.\PHYSICALDRIVE5
$_.size/1024/1024/1024 : 49.9993586540222
scsiport : 5
scsibus : 0
scsitargetid : 0
scsilogicalunit : 0

The next 3 are all 20GB drives.

DeviceID : \\.\PHYSICALDRIVE2
$_.size/1024/1024/1024 : 19.9936151504517
scsiport : 2
scsibus : 0
scsitargetid : 2

DeviceID : \\.\PHYSICALDRIVE1
$_.size/1024/1024/1024 : 19.9936151504517
scsiport : 2
scsibus : 0
scsitargetid : 1
scsilogicalunit : 0

DeviceID : \\.\PHYSICALDRIVE4
$_.size/1024/1024/1024 : 19.9936151504517
scsiport : 4
scsibus : 0
scsitargetid : 0
scsilogicalunit : 0

Hope this helps anyone else having the issue. I’ll loop around and update the PowerShell script I ended up using for this soon as well.

Thank you vRad for this great guide!