This article describes some scenarios where datastores that don't seem to be related to the virtual machine are listed in summary tab.
Note:
Please note that this article only covers a few cases of the many possible patterns.
Symptoms
VMware vSphere ESXi, VMware vCenter Server
This is because the virtual machine still has a reference to the datastore. The datastore might seem unrelated to the virtual machine, but if a datastore is listed under Related Object tile, it suggests that the virtual machine internally holds a reference to the datastore. If you don't want the datastore to appear, you'll need to identify the references and remove it.
Note: If a Datastore ISO File or Content Library ISO File is selected, simply unchecking Connected is NOT sufficient. Even if the ISO image is not connected state, the virtual machine still remains linked to the datastore. To completely remove this association, please select the other options like Client Device.
You may observe the following situations:
In this case, a snapshot may be still retaining a reference to the datastore. To check if you are facing this problem, delete the snapshot as follows:
If neither scenario 1 nor 2 applies to you, check the VM's configuration file to find any references to the datastores.
cd /vmfs/volumes/[DATASTORE_NAME]/[VM_NAME]
grep "/vmfs/volumes" [VM_NAME].vmxHere's an example output. Note that IDs and names may vary depending on environment:
[root@esxi:/vmfs/volumes/00000000-00000000/example-vm] grep /vmfs/volumes example-vm.vmxThis output indicates that the VM resides in datastore with ID 00000000-00000000, and has a reference to datastore with the ID 00000000-00000001.
serial0.fileName = "/vmfs/volumes/00000000-00000001/downloads/example-vm-port"
sched.swap.derivedName = "/vmfs/volumes/00000000-00000000/example-vm/example-vm-XXXXXXXX.vswp"
localcli storage filesystem list --uuid [DATASTORE_ID]Here's an example of command output:
[root@esxi:/vmfs/volumes/00000000-00000000/example-vm] localcli storage filesystem list --uuid 00000000-00000001This shows that the datastore ID 00000000-00000001 corresponds to datastore2.
Mount Point Volume Name UUID Mounted Type Size Free
------------------------------- ----------- ----------------- ------- ---- -------------- --------------
/vmfs/volumes/00000000-00000001 datastore2 00000000-00000001 true NFS 70368744177664 70368744177664