Learn how to map Linux disk to vmware disk for virtual machine hosted on vmware. This ensures you are treating correct disk on virtualization layer.
Its always an challenge to identify correct disk physically when its being used in virtualization layer. Since disk or hardware is attached to Host physically and made visible to guest server. Any activity related to physical attribute which is to be done on guest machine, seeks perfect mapping of hardware from guest to host. In other post we already explained mapping iVM disks to host disks in HPUX (HPUX virtualization). In this post we will be seeing how to map Linux disk to vmware disk (vmware virtualization).
Like HPUX, we do not have direct command to see mapping of disks. In HP, both hardware (server), OS software (HPUX) and virtualization technology (iVM) all three products is owned/developed by HP. This makes it possible to integrate task in single command. Since vmware, Linux is not single vendor configuration, I think its noot yet possible to get things done with single line command.
To map vmware disks to Linux VM, we need to check and relate SCSI id of disks.
In vmware :
Check VM settings and identify disk SCSI id.
As highlighted in above screenshot, identify your SCSI id. Here its 0:0
In Linux VM:
Now login to Linux VM and execute below command :
# dmesg | grep -i 'Attached SCSI disk'
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi disk sdb at scsi0, channel 0, id 1, lun 0
We are filtering disk messages from syslog to get disk SCSI id identified by kernel. This will show us disk names along with 4 numbers. Every disk has 4 numbers displayed in output. scsi, channel, id and lun. We are interested here in channel and id numbers.
For example: disk sda in above output has numbers 0:0:0:0 whereas disk sdb has 0:0:1:0. Look at second and third number i.e. 0:0:0:0 or 0:0:1:0.
Now match this SCSI id with id you got from vmware console (VM settings panel). 0:0 is matching that means disk sda in Linux is what we are looking at in vmware Hard Disk 1.
If you have any other method to get this task done, please drop us in comments!