VMware Cloud Community
bolddefender
Contributor
Contributor

How do I match VMware disk to windows disk in Windows 2012 R2

I have built a couple of Windows 2012 R2 servers for exchange 2013.

I've added 4 paravirtual SCSI controllers so I can spread the disks across them.

I've added disks in the following way in VMware.

0:0     60GB

0:1     40GB

1:0     2TB

2:0     2TB

3:0     450GB

In windows they all have bus Target LUN as 0:0:0 except the 40GB disk which has 0:1:0. They are all GPT bar 60GB.

I know I can edit sizes a small bit and find out which disk is which but there should be a way to match these. One of these is on slower disk and I want to know I get the exchange DB on the fast disk.

I found this http://www.50mu.net/2014/03/12/how-to-translate-windows-disk-ids-to-storage-arrays-luns/

  • controller 0 = location 160
  • controller 1 = location 161
  • controller 2 = location 193
  • controller 3 = location 225
  • controller 4 = location 257

but this does not tally with what I see. I have 160, 160, 161, 224, 256 (no 193) plus there is a max of 4 paravirtual controller in vsphere 5.5.

Also what I see as 161 is the 450GB disk which is on SCSI 3:0.

I also found this http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=202194...

but makes very little sense when I step through it.

Anyone help on this?

Thanks

0 Kudos
3 Replies
RyanH84
Expert
Expert

Hi,

So the there is no definite way of doing this that I am aware of, unfortunately.

As you are using multiple SCSI controllers with many disks, you might have several disks that share the same Target ID. From my experience, when I've added disks to controllers, Disk 1 and Disk 2 in VMware will reflect in Windows as disk 1 and disk 2. This is unless disks have been since added and removed.

DO you have the option of shutting down the system at all? There could be a quick and dirty way of manually adding them one at a time and seeing how they are presented and document?


Edit:- With a bit of searching, there is no doubt some scripts using PowerShell to pull out the information. I haven't test it, but there is a stackoverflow post about it that might help if you want to take a look and run it?

------------------------------------------------------------------------------------------------------------------------------------------------- Regards, Ryan vExpert, VCP5, VCAP5-DCA, MCITP, VCE-CIAE, NPP4 @vRyanH http://vRyan.co.uk
bolddefender
Contributor
Contributor

Its not live yet so I could remove a disk and add again or expand by 10GB and see which is which.

I had a quick look at the link and I don't do much power shell. Any way I looked at the vmx file and saw that as the disks are on different datastores I can see the difference from datastore ID

scsi2:0.fileName = "/vmfs/volumes/5548dda1-645b9628-a785-40f2e9c2b950/MaterMail1/MaterMail1.vmdk"

scsi1:0.fileName = "/vmfs/volumes/5548de0f-ddd4c8d2-b4f2-40f2e9c2b950/MaterMail1/MaterMail1.vmdk"

In the vmx file though the scsi1.pciSlotNumber = showed

scsi2.pciSlotNumber = "256"

scsi3.pciSlotNumber = "1184"

1184!! don't know where that comes from.

Anyway I'm happy about these and that I'll be careful to add one at a a time in the future and document.

0 Kudos
Tamim02
Contributor
Contributor

This is a simple PowerShell Script I’m using:
———————————————-

$SCSI = 0

$PCIS = (1600,1700,1800,1900,1501,1601,1701,1801,1901)

$SCSIList = Get-Disk | SELECT Location

FOREACH ($PCI in $PCIS)

{

IF ($SCSIList.Location -like "*$PCI*")

{

$SCSI++

Set-Variable -Name "$PCI" -Value $SCSI

}

}

Get-Disk | SELECT `

@{Name="Win Disk Number";Expression={$_.Number}},

@{Name="VMware SCSI";Expression={$_.Location.Trim("PCIROOT(0)#PCI(").Replace(")#PCI(0000)#SAS(P00T",":").Replace("00)","").Replace("1500","0").Replace("1501",$1501).Replace("1600",$1600).Replace("1601",$1601).Replace("1700",$1700).Replace("1701",$1701).Replace("1800",$1800).Replace("1801",$1801).Replace("1900",$1900).Replace("1901",$1901).Replace(":0",":").Trim("L")}},

@{Name="Size GB";Expression={$_.Size/1GB}},

PartitionStyle | Sort-Object "Win Disk Number" | FT -AutoSize -ErrorAction Stop

———————————————-
I’m assuming that VMware and Windows are ordering de Disk Locations numbers differently and that causes the issue.

Windows: 1500,1501,1600,1601…
VMWare: 1500,1600,….1501,1601….

The PowerShell Script only works with Windows Server 2012 and higher OS versions as [Get-Disk] is not supported in older Server OS versions.

Please let me know if this works for you.
Thx

0 Kudos