To resolve this issue and remove Stale Datastore entry, follow the steps below to reconfigure the VM device backing.
Method 1:Consolidate/Delete snapshot
A stale snapshot may be "locking" the old configuration in place, In case the VM has Snapshot, consolidate the Snapshot following the steps below.
- Right-click on the VM > Snapshots > Manage Snapshots.
- If snapshots exist, click Delete All or Consolidate to commit changes to the base disk.
- Check if the stale datastore reference disappears after consolidation. If it persists, proceed to Method 2
Method 2: Reconfigure via vSphere Client
- Right-click the VM and select Edit Settings.
- Locate the CD/DVD Drive and Floppy Drive devices.
- Change the backing type for these devices to Client Device. (Note: Ensure no ISO file from the stale datastore is selected.)
- Click ok
- Refresh the vSphere Client to see if the datastore reference is removed.
- If issue persists then proceed to Method 3
Method 3: Manually Edit the .vmx File
- Power off the VM.
- SSH into the ESXi host where the VM resides.
- Navigate to the VM folder:
cd /vmfs/volumes/CURRENT_DATASTORE/VM_NAME/
- Back up the configuration file:
cp VM_NAME.vmx VM_NAME.vmx.bak
- Open the file for editing:
vi VM_NAME.vmx
- Locate lines starting with floppy0 referencing the old datastore. Modify them to ensure the device is not present or set to "device" backing
floppy0.present = "FALSE"
floppy0.fileName = ""
floppy0.fileType = "device"
- Save and exit
Esc > : > wq!
8. Power on the Virtual Machine