2

What I am trying to accomplish is to correlate hard drive in vCenter to the disks in the Linux guest. So here it goes

Opening up settings for the guest in vCenter and moving to hardware tab, shows the lists of hard drives i.e. the .vmdk files. The SCSI id representation is generic - disk 1 is 0:0, disk 2 is 0:1 and so on.

On the guest, I checked the dmesg and found the sd* devices with their bus and target number. From there, I tried to deduce the relation but I am not sure whether this is the right approach or rather right thing.

[root@blah /]# grep -i attached /var/log/dmesg 
sd 0:0:0:0: Attached scsi disk sda
sd 0:0:1:0: Attached scsi disk sdb
sd 0:0:2:0: Attached scsi disk sdc
sd 0:0:3:0: Attached scsi disk sdd
sd 0:0:4:0: Attached scsi disk sde

Now I am trying to relate this disks with the hard drive information that vCenter tells me. I confirmed the h:b:t:l mapping with /proc/scsi/scsi and it looks sane to me.

1 Answer 1

5

This is correct... kinda.

Use lsscsi. The SCSI device nodes correspond to the controller/target/device naming you see in VMware.

Extreme example:

root@vdp1:~/#: lsscsi
[0:0:0:0]    disk    VMware   Virtual disk     1.0   /dev/sda
[0:0:1:0]    disk    VMware   Virtual disk     1.0   /dev/sdb
[0:0:4:0]    disk    VMware   Virtual disk     1.0   /dev/sdj
[0:0:5:0]    disk    VMware   Virtual disk     1.0   /dev/sdk
[0:0:8:0]    disk    VMware   Virtual disk     1.0   /dev/sdm
[0:0:9:0]    disk    VMware   Virtual disk     1.0   /dev/sdn
[0:0:10:0]   disk    VMware   Virtual disk     1.0   /dev/sdo
[1:0:0:0]    disk    VMware   Virtual disk     1.0   /dev/sdc
[1:0:1:0]    disk    VMware   Virtual disk     1.0   /dev/sdd
[2:0:0:0]    disk    VMware   Virtual disk     1.0   /dev/sde
[2:0:1:0]    disk    VMware   Virtual disk     1.0   /dev/sdf
[3:0:0:0]    disk    VMware   Virtual disk     1.0   /dev/sdg
[4:0:0:0]    cd/dvd  NECVMWar VMware IDE CDR00 1.00  /dev/sr0

enter image description here

2
  • Danke good sir. You are doing human kind a great service :) Obviously I knew lsscsi but never thought to apply at that point. Jul 1, 2014 at 15:16
  • I had tried this option before I stumbled upon your answer but in my case the drives are no corresponding correctly to the scsi device nodes and we are unsure why. So now we are going down the route of enabling disk.EnableUUID and checking the UUID with sg_vpd. Then checking the UUID from the esxi console with vmkfstools to see if they match. Do you have any thoughts on why the scsi device nodes may not be lining up?
    – Squashman
    Aug 10, 2023 at 21:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .