To determine which folders/files are in use by registered VMs, you can do the following:
- Verify the working directory in which the VM files of a register virtual machine are located:
- In the VM inventory, select the VM -> Edit Settings -> click the VM Options tab -> Select General. The path to the virtual machine working location appears in the "VM Working Location" text box.
- Verify to location of each VMDK file in the VM configuration:
- In the VM inventory, select the VM -> Edit Settings
- Expand each virtual disk and check the "Disk File" path.
- Verify if any of the folders/files within in the folder are in use:
- Open an ssh session to the ESXi host
- Obtain the UUID of the datastore where the folder is located:
esxcli storage vmfs extent list | grep <datastore_name> | awk '{print $2}'
-
- Run the following command:
lsof | egrep -i "Cartel|/vmfs/volumes/<datastore_uuid_from_above>/folder_name"
If any of the files in the path specified above are in use, they will be displayed in the output:
Example:
Cartel | World name | Type | fd | Description
##### vmx FILE 80 /vmfs/volumes/<datastore_uuid_from_above>/folder_name/VM_name.vmdk
NOTE:
-
-
- This only shows output if the VM the file or folder belongs to is currently running.
- You may see any number of files that are locked.
- Files other than *.vmdk files may be locked (e.g. *.vmx, *.vmsn, *.vswp).
- Do not assume if a file is not listed that it is not used. For example: virtual disks have both a descriptor file (vm_name.vmdk) and a data file (*-flat.vmdk), in addition to possible related snapshot files (*-delta.vmdk, *-sesparse.vmdk) or other metadata (*.vmsd, *.vmxf, etc), which are read at boot time, but are not be locked on an ongoing basis).
- If you find any files in the folder that are locked, you can assume the folder is in use. The files should be left alone in this case unless advised otherwise by Broadcom Technical Support for troubleshooting purposes.
- Check the date and time stamps in the datastore browser:
- From vSphere Client:
- Right-click Datastore in inventory -> Browse Files)
- You can also check from an ssh session to the host:
ls -l /vmfs/volumes/<datastore_name> (to see the date/time of the folder itself)
ls -l /vmfs/volumes/<datastore_name>/folder (to see the date/time of the files within the folder)
-
- Check both the dates/times of the folders and the files within the folders to see which ones have been used recently to help narrow down which folders/files are still used, even if not currently in use as per the
lsof command above.
- If you are still unsure which files are in use--especially if you are considering deleting the folder--please open a case with Broadcom Technical Support for further assistance.