VMs registered to old datastore with no data related to the virtual machines
book
Article ID: 394926
calendar_today
Updated On:
Products
VMware vSphere ESXi
Issue/Introduction
Multiple virtual machines indicate they are attached to datastores with no data related to the VMs and no indication of attachment in VM settings via the UI. This is preventing removal and decommissioning of the storage.
Environment
VMware vCenter Server 8.x
VMware vCenter Sever 7.x
VMware vSphere ESXi 8.x
VMware vSphere ESXi 7.x
Cause
The association between the virtual machines and datastores exist due to virtual floppy drive configured to the VM.
Searching for the problematic datastore UUIDs in the associated VM vmx files shows that a floppy drive is configured which references the datastore. As long as the VM configuration references the datastore it will remain visible in the vCenter UI with an association to the virtual machines referencing it.
Resolution
Gracefully shutdown or power off the virtual machine(s) in question.
Connect to either an ssh session or direct host client to the host with the VM registered
Remove the floppy reference:
If using the host client:
Right click on the VM and choose edit settings
Choose the X next to the entry for Floppy Drive to remove
Click on Save to finalize the removal
Verify the entry is no longer present in the vCenter UI for the VM
If using command line:
cd into the virtual machine directory
Edit the vmx file with vi
Locate the lines related to the floppy drive (depending on virtual hardware version there may be differing numbers of lines per floppy drive from 2-4)
Comment out the lines
Save and exit the vi editor
Locate the VM ID with vim-cmd vmsvc/getallvms | grep -i <vmname>
Reload the VM configuration with vim-cmd vmsvc/reload <VM ID>
Verify the datastore is no longer present under the VM in the vCenter UI
Additional Information
See KB 323058 for other potential causes of the additional datastore entry