- Connect to the ESXi host using an SSH session and root credentials.
- Find the path where the VM configuration file (.vmx) resides:
- Find the VM in the vmInventory.xml:
cat /etc/vmware/hostd/vmInventory.xml |grep -i vm_name |grep vmx
For example:
The file path is highlighted in yellow, and the VM configuration file name (*.vmx) is highlighted in blue
vim-cmd vmsvc/getallvms |grep -i vm_name
- Navigate to the VM directory from step 2:
cd configuration_file_path
- Run this command to get the names of the virtual disk files currently attached to the VM:
cat VM config file name |grep fileName
Notes:
- The output will also include such other devices as virtual floppy disks and virtual DVD/CDROMs
- Virtual disks may not be located in the same location as the .vmx file.