VMware vSphere 7.x
VMware vSphere 8.x
Note: This procedure is only applicable if the virtual machine has not been un-registered from the ESXi host and re-registered since the RDM went missing.
To find the VML identifiers of the RDM devices from the ESX/ESXi command line:
# vim-cmd vmsvc/getallvms |grep <vmname>
# vim-cmd vmsvc/getallvms |grep ABC
45 ABC [DATASTORE] ABC/ABC.vmx winNetEnterpriseGuest vmx-08
# vim-cmd vmsvc/device.getdevices VMid |grep -v parent |grep -A8 RawDisk
# vim-cmd vmsvc/device.getdevices 45 |grep -v parent |grep -A8 RawDisk
backing = (vim.vm.device.VirtualDisk.RawDiskMappingVer1BackingInfo) {
dynamicType = <unset>,
fileName = "[DATASTORE] ABC/ABC_1.vmdk",
datastore = 'vim.Datastore:4c1bbd6b-f0debcbd-####-################',
lunUuid = "########################################################",
deviceName = "vml.######################################################",
compatibilityMode = "physicalMode",
diskMode = "independent_persistent",
uuid = <unset>,
backing = (vim.vm.device.VirtualDisk.RawDiskMappingVer1BackingInfo) {
dynamicType = <unset>,
fileName = "[DATASTORE] ABC/ABC_2.vmdk",
datastore = 'vim.Datastore:########-########-####-############',
lunUuid = "######################################################",
deviceName = "vml.####################################################",
compatibilityMode = "physicalMode",
diskMode = "independent_persistent",
uuid = <unset>,
# esxcli vm process list | grep "Config File:"
Config File: /vmfs/volumes/62f65e58-8d4f8afe-XXXX-6805caa6eab8/ABC/ABC.vmx
# cat /
vmfs/volumes/62f65e58-8d4f8afe-XXXX-6805caa6eab8/ABC/ABC.vmx | grep -i vmdk
scsi0:0.fileName = "ABC.vmdk"
scsi1:1.fileName = "ABC_1.vmdk"
# cd /vmfs/volumes/62f65e58-8d4f8afe-XXXX-6805caa6eab8/ABC/
# vmkfstools -q "ABC_1.vmdk"
Disk ABC_1.vmdk is a Passthrough Raw Device Mapping
Maps to: vml.02000000006000eb33d6ca1e330000000000001267695343534944
# cat "ABC_1.vmdk" | grep createType
createType="vmfsRawDeviceMap" or "vmfsPassthroughRawDeviceMap" >> Means the device is RDM.
# esxcli storage core device list | egrep "Devfs\ Path:|Other\ UIDs:" | sed -e 'N;s/\n//g' | grep vml.02000000006000eb33d6ca1e330000000000001267695343534944
Devfs Path: /vmfs/devices/disks/naa.6000eb33d6ca1e330000000000001267 Other UIDs: vml.02000000006000eb33d6ca1e330000000000001267695343534944
.
You may run the below command on the ESXi host where VM is placed and get information of the VMDK
# vmware-vimdump -o /tmp/vmware-vimdump.txt
# less /tmp/vmware-vimdump.txt -i | grep -A30 '(vim.vm.device.VirtualDisk)' | egrep -i "vim.vm.device.VirtualDisk|fileName|compatibilityMode|diskMode|label" | sed -e 'N;N;N;N;s/\n//g' | sed 's/^\s*//;s/\s*$//;s/\s+/ /'
EXAMPLE OUTPUT:
(vim.vm.device.VirtualDisk) {label = 'Hard disk 1', backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) { fileName = '[DATASTORE] ########-####-####-####-############/ABC.vmdk', diskMode = 'persistent',
(vim.vm.device.VirtualDisk) {label = 'Hard disk 2', backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) { fileName = '[DATASTORE] ########-####-####-####-############/ABC_1.vmdk', diskMode = 'persistent',
(vim.vm.device.VirtualDisk) {label = 'Hard disk 1', backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) { fileName = '[DATASTORE] #######-####-####-####-############/ABC_3.vmdk', diskMode = 'persistent',