VMware Cloud Community
wiehanw
Contributor
Contributor
Jump to solution

Mapping from vmdk and drive letter on Guest OS

Hi,

If I mount few vmdk with the same size into to one VM and the admin want to expand one of the drive; how can we know which vmdk that I need expand?

Thank you so much in advanced for your suggestions J

Best regards,

Wiehan

0 Kudos
1 Solution

Accepted Solutions
SantoshKumar36
Enthusiast
Enthusiast
Jump to solution

It would be in this sequence, an example, In the VMware console , Edit the VM --> Select the Hard Disk -> In the right pane, you wil find 'Virtual Device Node', under that, you will find in the below way.

Hard Disk 1 : SCSI 0:0

Hard Disk 2 : SCSI 0:1

Hard Disk 2 : SCSI 0:2

Note down this, in the guest OS, open disk mgmt -> The Disk XX no's will be presented and where you will find the Disk no identical to last digit in the SCSI option

Santosh K | If my answer resolved or helped you, please mark it as Correct or Helpful to award points.

View solution in original post

0 Kudos
7 Replies
Rob_Bohmann1
Expert
Expert
Jump to solution

I would create a txt file within the os with the drive letter.  Then go into disk management on each disk and explore it to read the txt file to confirm the drive letter.

0 Kudos
wiehanw
Contributor
Contributor
Jump to solution

Hi Rob.Bohmann,

Thank you for your prompt response.

So far what I can do is:

“C:\Program Files (x86)\VMware\VMware Virtual Disk Development Kit\bin\vmware-mount.exe” [driveletter:] [path-to-virtual-disk]

  • Run dir to displays a list of files and subdirectories in a directory.

So it will time consumming to download the vmdk file from SAN just to view if that the correct file that I need to expand Smiley Sad

Best regards,

Wiehan

0 Kudos
SantoshKumar36
Enthusiast
Enthusiast
Jump to solution

It would be in this sequence, an example, In the VMware console , Edit the VM --> Select the Hard Disk -> In the right pane, you wil find 'Virtual Device Node', under that, you will find in the below way.

Hard Disk 1 : SCSI 0:0

Hard Disk 2 : SCSI 0:1

Hard Disk 2 : SCSI 0:2

Note down this, in the guest OS, open disk mgmt -> The Disk XX no's will be presented and where you will find the Disk no identical to last digit in the SCSI option

Santosh K | If my answer resolved or helped you, please mark it as Correct or Helpful to award points.
0 Kudos
wiehanw
Contributor
Contributor
Jump to solution

Hi SantoshKumar36,

Thank you so much for your answer. So we just need to take a look on Bus Number and Target ID only (we don't care the LUN, is that correct?).

I also found some script to spit out the Location (port, bus, scsi target id, lun id), size (in GB) and Device ID (also known as disk number in the windows gui) into a file as mention on http://www.networksydney.com.au/?p=122 Smiley Happy

Get-WmiObject Win32_DiskDrive | select-object DeviceID,{$_.size/1024/1024/1024},scsiport,scsibus,scsitargetid,scsilogicalunit | out-file -FilePath c:\output.txt

Thanks and regards,

Wiehan

0 Kudos
SantoshKumar36
Enthusiast
Enthusiast
Jump to solution

You really do need to care about the LUN ID in this view, If some user asked you to extend the partition, he will just say d:\ or f:\, being a VM admin, we need to find this in Disk mgmt and make the note and come to VM console, look for SCSI ID and extend the Hard Disk.

Did you run this script successfully..?

Santosh K | If my answer resolved or helped you, please mark it as Correct or Helpful to award points.
0 Kudos
wiehanw
Contributor
Contributor
Jump to solution

I still not test the script on the real environment Smiley Happy but i test in on one of my Windows 2012 hyper-v server and give me the attached result.

0 Kudos
SantoshKumar36
Enthusiast
Enthusiast
Jump to solution

Looks good!! Certainly will help when there will be miss arrangement in order. An ex:

Hard Disk 1 : SCSI 0:0

Hard Disk 2 : SCSI 0:1

Hard Disk 3 : SCSI 0:2

Hard Disk 4 : SCSI 0:3

When deleted the Hard Disk 3 : but the SCSi 0:2 will remains unused in Vmware side but inside the guest OS, the disk order will be decreased by 1(in Disk Mgmt). Later If you add a disk, either u can get it mapped in same SCSI 0:2 or different one. If SCSI0:2 is same one, then disk order will be changed as it was like earlier in guest OS(Before removing the Hard Disk 3)

Hope you are clear on this!!

Santosh K | If my answer resolved or helped you, please mark it as Correct or Helpful to award points.
0 Kudos