Symptoms:
Verification:
1. Verify the host the host the VM is registered to.
2. Open an ssh session to the host identified above.
3. Run the following command to verify the location of the VM configuration:
esxcli vm process list | grep -A 1 -i vmname
You should see output similar to the following:
Display Name: vmnameConfig File: /vmfs/volumes/XXXXXXXX-XXXXXXXX-XXXX-XXXXXXXXXXXX/vmname/vmname.vmx
4. Check the location of each vmdk in the VM's configuration
grep -i vmdk <Config_file_from_above_output>
You should see a line for each virtual disk in the VM's configuration similar to the following:
scsiX:Y.fileName = "/vmfs/volumes/XXXXXXXX-XXXXXXXX/vmname/vmname.vmdk
5. Identify the NFS datastore from the UUIDs in the identified virtual disk files (*.vmdk files):
The UUID for NFS volumes will be in the following format: XXXXXXXX-XXXXXXXX. This is often sufficient to identify the volume (e.g. if you only had one NFS datastore). Otherwise, you can run the following command to identify the datastore:
esxcli storage filesystem list
You should see output similar to:
Mount Point Volume Name UUID Mounted Type Size Free------------------------------------------------- ------------------------------------------ ----------------------------------- ------- ------ -------------- ----/vmfs/volumes/XXXXXXXX-XXXXXXXX-0000-000000000000 nfs-datastore-01 XXXXXXXX-XXXXXXXX-0000-000000000000 true NFS41 17592186044416 17424337801216/vmfs/volumes/ nfs-datastore-02 XXXXXXXX-XXXXXXXX-0000-000000000000XXXXXXXX-XXXXXXXX-0000-000000000000 true NFS41 17592186044416 17258287218688/vmfs/volumes/AAAAAAAAA-BBBBBBBB-CCCC-DDDDDDDDDDDD myhostname-local-01 AAAAAAAAA-BBBBBBBB-CCCC-DDDDDDDDDDDD true VMFS-6 822486237184 820959510528
From this output you can confirm if one or more of the UUIDs found in the vmdk filenames identified in step #4 above matches the datastore unmapped from the ESXi host. PLEASE NOTE: UUID's of NFS volumes will contain all 0's in the last 2 segments of the UUID, as shown above.
cd /vmfs/volumes/datastore/vmname
cp vmname.vmx vmname.vmx_backup
vi vmname.vmxscsi0:2.present = "true"scsi0:2.fileName = "/vmfs/volumes/XXXXXXXX-XXXXXXXX/vmname/vmname.vmdkscsi0:2.deviceType = "scsi-hardDisk"sched.scsi0:2.shares = "normal"
# scsi0:2.present = "true"# scsi0:2.fileName = "/vmfs/volumes/XXXXXXXX-XXXXXXXX/vmname/vmname.vmdk# scsi0:2.deviceType = "scsi-hardDisk"# sched.scsi0:2.shares = "normal"
NOTE: the # acts as a "comment", so effectively causes the ESXi to ignore those lines. Adding the #, rather than simply deleting the line makes it easier to recover to the original state, if needed, and reduces the possibility of accidentally deleting the wrong line.