Unable to delete VM folder from vSAN datastore
search cancel

Unable to delete VM folder from vSAN datastore

book

Article ID: 409471

calendar_today

Updated On:

Products

VMware vSAN

Issue/Introduction

VM has been deleted or moved via Storage vMotion from the vSAN cluster.

VM namespace folder remains visible in vCenter view, and when browsing the vSAN datastore from ESXi host command line.

 

This KB article, Remove an empty folder from vSAN datastore after VM deleted by external application, contains the steps to remove a folder in this scenario, and this is the command to use.

/usr/lib/vmware/osfs/bin/osfs-rmdir "folder name"

 

If this command fails, with an error similar to this, follow the below steps to investigate.

Deleting directory XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX in container id XXXXXXXXXXXXXXXXXXXXXXXXXXXX backed by vsan (force=False)
Failed. Search vmkernel log and osfsd log for opID 'osfsXXX-XXXXXXXXXX-XXXXXXX'.

Environment

vSAN 7.x

vSAN 8.x

vSAN 9.x

Cause

Possible causes for the above commands to fail:

  • the namespace folder is not actually empty.

  • the health of the backing vSAN object for the vSAN namespace folder is unhealthy.

Resolution

If unsure about any of these steps, please open a case with Broadcom Support to get assistance.


Method using CLI:

If there are any files in the namespace folder, confirm they are not in use, and then delete them from the ESXi host command line. Navigate into the folder, and delete the files.

  • Caution: This operation cannot be undone.
rm "file name"

 

Then, move back one level to the vSAN datastore, and try to remove the directory again.

/usr/lib/vmware/osfs/bin/osfs-rmdir "folder name"



Method using  UI:

Use Datastore browser and remove directory / file.
see Using Datastore Browser in vSphere Environment

If the backing vSAN object for the namespace is not healthy, and cannot be recovered, or if there are no obvious problems with this vSAN object, please open a support case with Broadcom.

 

Additional Information