VMware Cloud Community
szemet1
Contributor
Contributor
Jump to solution

How to map Windows VM drive letters back to vmdk file?

Guys,

I could not find an ESX 3.5 forum, hence posting the question here.

# vmware -v
VMware ESX Server 3.5.0 build-317866

with Windows 2003 SP2 guests and many mouted drives on the clients.

I need to know how to map the Windows drive letters back to the vmdk files on the host. e.g.

C:\> net share

Share name   Resource                        Remark

---------------------------------------------------------------------
$           R:\                             Default share
$           B:\                             Default share
$           C:\                             Default share
$           S:\                             Default share
$           X:\                             Default share
$           P:\                             Default share
$           Y:\                             Default share
$           Q:\                             Default share
$           I:\                             Default share
$           F:\                             Default share
$           W:\                             Default share
$           G:\                             Default share
$           D:\                             Default share
$           T:\                             Default share


[root@esx01 DB1]# ls -l *.vmdk
-rw-------    1 root     root     142807662592 Jun  6  2008 DB1_1-rdmp.vmdk
-rw-------    1 root     root          367 Jul 14 22:02 DB1_1.vmdk
-rw-------    1 root     root     285615325184 Jun  6  2008 DB1_2-rdmp.vmdk
-rw-------    1 root     root          367 Jul 14 22:02 DB1_2.vmdk
-rw-------    1 root     root     1073741824 Jun  6  2008 DB1_3-rdmp.vmdk
-rw-------    1 root     root          363 Jul 14 22:02 DB1_3.vmdk
-rw-------    1 root     root     142807662592 Jun  6  2008 DB1_4-rdmp.vmdk
-rw-------    1 root     root          367 Jul 14 22:02 DB1_4.vmdk
-rw-------    1 root     root     128849018880 Jun  6  2008 DB1_5-rdmp.vmdk
-rw-------    1 root     root          367 Jul 14 22:02 DB1_5.vmdk
-rw-------    1 root     root     37580963840 Sep 26 17:58 DB1-flat.vmdk
-rw-------    1 root     root          337 Jul 14 22:02 DB1.vmdk
-rw-------    1 root     root     287762808832 Nov  8  2008 FOO-DB1_1-rdm.vmdk
-rw-------    1 root     root          364 Jul 14 22:02 FOO-DB1_1.vmdk
-rw-------    1 root     root     21474836480 Apr 18  2009 FOO-DB1_2-rdmp.vmdk
-rw-------    1 root     root          374 Jul 14 22:02 FOO-DB1_2.vmdk
-rw-------    1 root     root     42949672960 Apr 18  2009 FOO-DB1_3-rdmp.vmdk
-rw-------    1 root     root          374 Jul 14 22:02 FOO-DB1_3.vmdk
-rw-------    1 root     root     429496729600 Oct 10  2009 FOO-DB1_4-rdmp.vmdk
-rw-------    1 root     root          350 Oct 10  2009 FOO-DB1_4.vmdk
-rw-------    1 root     root     429496729600 Oct 10  2009 FOO-DB1_5-rdmp.vmdk
-rw-------    1 root     root          376 Jul 14 22:02 FOO-DB1_5.vmdk
-rw-------    1 root     root     107374182400 Dec 18  2010 FOO-DB1_6-rdmp.vmdk
-rw-------    1 root     root          376 Jul 14 22:02 FOO-DB1_6.vmdk
-rw-------    1 root     root     107374182400 Dec 18  2010 FOO-DB1_7-rdmp.vmdk
-rw-------    1 root     root          376 Jul 14 22:02 FOO-DB1_7.vmdk
-rw-------    1 root     root     161061273600 Sep 27  2008 FOO-DB1-rdmp.vmdk
-rw-------    1 root     root          374 Jul 14 22:02 FOO-DB1.vmdk

I need to know which vmdk is used for which drive in the client Windows guest. I'm afraid I could not figure it from the vmware.log or hostd.log files.

Thank you!

Steve

Reply
0 Kudos
1 Solution

Accepted Solutions
PduPreez
VMware Employee
VMware Employee
Jump to solution

Hi Steve

You can not directly map the drive letter to the vmdk's but you can map the Win disk to a specific vm using the SCSI number

An easy way to map the vmdk's with Windows disks is the following:

On the VM's "edit settings", note down all the vDisks SCSI address example (Hard disk 1 = SCSI (0:1), Hard disk 2 = SCSI (2:4))

If you go to Windows disk management and right click the individual disks and select properties, you will see that disks Target and LUN ID

where for Hard disk 1 = SCSI (0:1), 0 is Target ID and 1 is LUN ID and Hard disk 2 = SCSI (2:4), 2 is Target ID and 4 is LUN ID

Then you just map the drive letters to the Hard disk numbers Smiley Happy

Please award points for helpful/correct answers :smileycool:

View solution in original post

Reply
0 Kudos
5 Replies
PduPreez
VMware Employee
VMware Employee
Jump to solution

Hi Steve

You can not directly map the drive letter to the vmdk's but you can map the Win disk to a specific vm using the SCSI number

An easy way to map the vmdk's with Windows disks is the following:

On the VM's "edit settings", note down all the vDisks SCSI address example (Hard disk 1 = SCSI (0:1), Hard disk 2 = SCSI (2:4))

If you go to Windows disk management and right click the individual disks and select properties, you will see that disks Target and LUN ID

where for Hard disk 1 = SCSI (0:1), 0 is Target ID and 1 is LUN ID and Hard disk 2 = SCSI (2:4), 2 is Target ID and 4 is LUN ID

Then you just map the drive letters to the Hard disk numbers Smiley Happy

Please award points for helpful/correct answers :smileycool:

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Discussion moved from VMware ESX™ 4 to VI: VMware ESX™ 3.5

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Unless the mentioned information in the Windows GUI does not show what you need, you can alternatively use diskpart. First run the "list disk" command for an overview and then for each disk run "sel disk #" (where # is the disk number) followed by "detail disk"

André

szemet1
Contributor
Contributor
Jump to solution

Thank you for both answers guys!

Just one more thing that I still don't understand.

ESX console > Edit VM Properties:

SCSI LSI Controller 0 - used for the boot disk (partition C)
SCSI LSI Controller 1 - used for all the other virtual disks.


DISKPART> list disk

  Disk ###  Status      Size     Free     Dyn  Gpt
  --------  ----------  -------  -------  ---  ---
  Disk 0    Online        40 GB  8033 KB
  Disk 1    Online       266 GB      0 B
  Disk 2    Online      1022 MB  2048 KB
  Disk 3    Online       133 GB      0 B
  Disk 4    Online       120 GB      0 B

 
DISKPART> select disk 4

Disk 4 is now the selected disk.

DISKPART> detail disk

DGC RAID 10 SCSI Disk Device
Disk ID: 81A9AEE9
Type   : SCSI
Bus    : 0
Target : 3
LUN ID : 0

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     B   Backup       NTFS   Partition    120 GB  Healthy

 
It is obviously the same output in diskmgmt -> SCSI Disk Device Properties on "Disk 4" (Bus Number 0, Target ID 3, LUN 0).
As per the above, it should be C1T3L0, right?

On SCSI(0:0) I have "Hard disk 2" listed, the 40 GB boot disk ("Disk 0" under diskpart).

The disk in question ("Disk 4" in diskpart) should be "SCSI (1:3)", right? Second SCSI LSI Controller, 3rd drive?
If I check the file size on ESX than it's about the size listed under Windows so I guess it should be ok, but what I still don't understand if the VM has 2 SCSI LSI Controllers attached, how the guest VM picks/displays the correct controller, target, disk number, if everything is listed under Bus 0?

e.g.

DISKPART> select disk 0

Disk 0 is now the selected disk.

DISKPART> detail disk

VMware Virtual disk SCSI Disk Device
Disk ID: CC9DCC9D
Type   : SCSI
Bus    : 0
Target : 0
LUN ID : 0

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 3     C   Win2k3       NTFS   Partition     40 GB  Healthy    System
 
 
DISKPART> select disk 4

Disk 4 is now the selected disk.

DISKPART> detail disk

DGC RAID 10 SCSI Disk Device
Disk ID: 81A9AEE9
Type   : SCSI
Bus    : 0
Target : 3
LUN ID : 0

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     B   Backup       NTFS   Partition    120 GB  Healthy

 
Or the correct controller information should be found somewhere else? It's a bit of a pain to map the partitions back to the LUNs if the infromation can be collected with this tedious manual process of assuming details that are not displayed on either the VM or the ESX. The only confirmation is that I'm probably selecting the correct drive>datastore file match is the check of the datastore file size...

Thank you!

Reply
0 Kudos
PduPreez
VMware Employee
VMware Employee
Jump to solution

You can have up to 4 LSI SCSI Controllers on a VM 0,1,2,3, depending on how many vNICs you have

Each Controller can have 15 devices attached.

The controller name is just the order it has been added and it looks like you are using 0 and 3, which is the Target ID

As soon as you assign the first hard drive on a SCSI ID (1:0), (2:0), (3:0) a new controller is automatically created.

The disk in question ("Disk 4" in diskpart) should be "SCSI (1:3)", right? Second SCSI LSI Controller, 3rd drive?
If I check the file size on ESX than it's about the size listed under Windows so I guess it should be ok, but what I still don't understand if the VM has 2 SCSI LSI Controllers attached, how the guest VM picks/displays the correct controller, target, disk number, if everything is listed under Bus 0?

All the controllers is running on the same virtual hardware Bus, which is 0

From the output on Disk 4 in DISKPART of Target ID 3 and LUN 0 this means on vSphere side it will be SCSI (3:0)

Look at each vDisk SCSI allocation from edit settings and compare

I would take a wild guess and say it might look like this

Disk 0 SCSI (0:0)

Disk 1 SCSI (0:1)

Disk 2 SCSI (0:2)

Disk 3 SCSI (0:3)

Disk 4 SCSI (3:0)

This would mean drive 0-3 is on LSI SCSI Controller 0 and Disk 4 is on SCSi Controller 1

Hope this makes sense

Please award points if this is helpful Smiley Happy