VMware Cloud Community
usao
Enthusiast
Enthusiast
Jump to solution

ESXi 6.0 - How to match virtual disks in esxi with the devices in the OS?

I have a set of luns all defined as virtual disks in ESXi 6.0, they are all the same size and presented to the same host.

On the host side, we are deleting one of the devices, but im not sure how to match-up the correct device from ESXi editor to the device inside the OS.

I don't want to remove the wrong device.

Is there some sort of device ID or other identification I can use to make sure I "delete" the correct device from esxi?

Tags (1)
1 Solution

Accepted Solutions
aditya4k4
Contributor
Contributor
Jump to solution

You can try to identify the SCSI controller from devices :

Go to "/dev/disk/by-path" and run 'ls -l' from the list you should be able to see the disk against SCSI controller

pastedImage_2.png

pastedImage_3.png

In case of multiple SCSI controller is used you can track it using the PCI device ID:

pastedImage_0.png

pastedImage_1.png

View solution in original post

13 Replies
kishorenelvagal
VMware Employee
VMware Employee
Jump to solution

usao Hi ,

I suppose you are talking about Virtual RDM which are mapped directly to the ESXi hosts and then presented to the VMs. ( Please correct me if I am wrong ).

In this case you could go to disk management in the OS and right click on the disk and then check the properties ( See attached screen shot ).

In vsphere client or web client check the disk properties to find the SCSI id and co-relate them .

Let me know if you have any questions

Kishore N

Sincerely
Kishore N
VMware Support Moderator
Reply
0 Kudos
usao
Enthusiast
Enthusiast
Jump to solution

No, these are disks created on a Datastore inside ESXi.

From the host, they look like regular disks, but they are files stored on esxi datastore.

Ive freed up the 2 at the end, but when I look at ESXi, they all look the same and I don't see a way to identify which is which.

If I delete the wrong device from esxi, then I will corupt the filesystem this is sitting on.

[root@backup ~]# pvs

  PV         VG        Fmt  Attr PSize   PFree

  /dev/sda2  backup_vg lvm2 a--u   7.51g      0

  /dev/sdb   backup_vg lvm2 a--u 512.00g      0

  /dev/sdc   backup_vg lvm2 a--u 512.00g      0

  /dev/sdd   backup_vg lvm2 a--u 512.00g      0

  /dev/sde   backup_vg lvm2 a--u 512.00g      0

  /dev/sdf   backup_vg lvm2 a--u 512.00g      0

  /dev/sdg   backup_vg lvm2 a--u 512.00g      0

  /dev/sdh   backup_vg lvm2 a--u 512.00g      0

  /dev/sdi   backup_vg lvm2 a--u 512.00g      0

  /dev/sdj             lvm2 ---- 512.00g 512.00g

  /dev/sdk             lvm2 ---- 512.00g 512.00g

[root@backup ~]#

Reply
0 Kudos
HassanAlKak88
Expert
Expert
Jump to solution

Try the matching between LUN ID from your storage and on this Host.

Else also each LUN have a code (like WWN if FC) under Storage Devices you can find it and also match with LUN wwn on your storage.


If my reply was helpful, I kindly ask you to like it and mark it as a solution

Regards,
Hassan Alkak
Reply
0 Kudos
usao
Enthusiast
Enthusiast
Jump to solution

For example, I don't know how to identify which one of these virtual disks is /dev/sdj and /dev/sdk in the host OS.

Normally, on a SAN infrastructure, I can look at the WWID for he device, but I don't see any equivalent here since these appear to be local drives to the host.

pastedImage_0.png

Reply
0 Kudos
HassanAlKak88
Expert
Expert
Jump to solution

From windows side and on the details of any disk you can match the SCSI number SCSI(0:10). please check it.


If my reply was helpful, I kindly ask you to like it and mark it as a solution

Regards,
Hassan Alkak
Reply
0 Kudos
usao
Enthusiast
Enthusiast
Jump to solution

Just to clarify, all the disks are virtual devices. There are no WWID's, nor LUN ID's that I am aware of on the ESXi side.

All I see is the filename for the device, such as "backup_7.vmdk", and I don't konw how to match that to a /dev/sdXX device name in the VM.

How can I do that specifically? Which menues, windows or command-line commands will show me some sort of ID that I can reference inside the VM/OS?

Reply
0 Kudos
HassanAlKak88
Expert
Expert
Jump to solution

pastedImage_0.png

also try this from windows.


If my reply was helpful, I kindly ask you to like it and mark it as a solution

Regards,
Hassan Alkak
Reply
0 Kudos
usao
Enthusiast
Enthusiast
Jump to solution

When I look on the host, this is all the detail I get on the drive.

[root@backup ~]# l /dev/sd[jk]

brw-rw---- 1 root disk 8, 144 Mar 19 12:30 /dev/sdj

brw-rw---- 1 root disk 8, 160 Mar 19 12:30 /dev/sdk

[root@backup ~]# l -RA /dev/disk/by-id/ | grep sd[jk]

lrwxrwxrwx 1 root root  9 Mar 19 12:30 lvm-pv-uuid-dOct2i-p5c6-qdAe-YRD1-x4QJ-9gXE-LZ4FwN -> ../../sdj

lrwxrwxrwx 1 root root  9 Mar 19 12:30 lvm-pv-uuid-GDfLLB-YyYe-eo3r-9QHK-skHm-Ah5P-hAKnSm -> ../../sdk

[root@backup ~]# l -RA /dev/disk/by-path/ | grep sd[jk]

lrwxrwxrwx 1 root root  9 Mar 19 12:30 pci-0000:00:10.0-scsi-0:0:10:0 -> ../../sdj

lrwxrwxrwx 1 root root  9 Mar 19 12:30 pci-0000:00:10.0-scsi-0:0:11:0 -> ../../sdk

[root@backup ~]# fdisk -l /dev/sdk

Disk /dev/sdk: 549.8 GB, 549755813888 bytes

255 heads, 63 sectors/track, 66837 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Reply
0 Kudos
HassanAlKak88
Expert
Expert
Jump to solution

Kindly try the tasks on the following: How to match and correlate Windows SCSI Disk IDs with VMware VMDKs - 2ninjas1blog.com


If my reply was helpful, I kindly ask you to like it and mark it as a solution

Regards,
Hassan Alkak
Reply
0 Kudos
aditya4k4
Contributor
Contributor
Jump to solution

You can try to identify the SCSI controller from devices :

Go to "/dev/disk/by-path" and run 'ls -l' from the list you should be able to see the disk against SCSI controller

pastedImage_2.png

pastedImage_3.png

In case of multiple SCSI controller is used you can track it using the PCI device ID:

pastedImage_0.png

pastedImage_1.png

usao
Enthusiast
Enthusiast
Jump to solution

In your example, only 1 digit matches out of 4:

SCSI(0:1) -> 0:0:1:0

SCSI(1:0) -> 0:0:0:0

How does this work if you have some disks which have the same digit?

I don't think I have this exact situation, but this is more general question on how to distinguish when you do have more than 15 disks and have duplicate digits...

Reply
0 Kudos
usao
Enthusiast
Enthusiast
Jump to solution

Thanks, but this is Linux not Windows.

Reply
0 Kudos
aditya4k4
Contributor
Contributor
Jump to solution

you need to identify the SCSI controller from the PCI controller address,  :

lrwxrwxrwx. 1 root root  9 Mar 20 03:11 pci-0000:00:10.0-scsi-0:0:1:0 -> ../../sdb

lrwxrwxrwx. 1 root root  9 Mar 20 03:16 pci-0000:02:02.0-scsi-0:0:0:0 -> ../../sdc