vSAN has been around for a long time now and its very easy to work with as well.
You don’t have to be a storage administrator to manage vSAN clusters in vCenter in my experience.
Once in a while after maintenance activity or after hard reboot of the ESXi hosts, we see warning alerts in vSAN which is caused by inaccessible files.
Note: My case is not production, its my home lab and i must have switched off the nested ESXi host without waiting for shutdown!
“Inaccessible virtual objects” are stale or corrupted file for which vSAN cluster has no more reference by a configuration file or a directory index.
Agenda: How to delete these files and before deleting ensure it doesn’t impact health of any VM and To find the whereabouts of these files, we follow a simple process from vCSA over SSH.
Step 1: Login to vCSA using ssh and move to “Ruby vSphere Console (RVC)”.
Ruby vSphere Console is a user interface for VMware ESXi and Virtual Center and is a member of VMware CLI family and is based on the popular RbVmomi Ruby interface to the vSphere API. RbVmomi was created with the goal to dramatically decrease the amount of coding required to perform simple tasks, as well as increase the efficiency of task execution, all the while still allowing for the full power of the API when needed.
Step 2: The scope of the below steps is to navigate to the spot to find the details of these files:
– cd to datacenter
– cd to host level
– cd to required host cluster
– check vSAN state check by using command
vsan.check_state -r .
Following steps are performed by the command:
– Step1 of the state checks against the inaccessible file and shows the list
– Step 2, perform a check if there are any inaccessible VM’s
– Step 3, perform a check if any VM’s VMX file is out of sync
as none of the above test could find any related VM to which these files belong, that means they are just stale file and can be deleted!
Step 3: Now we are good to delete them, but still we don’t know the location of these files!
using following syntax, we can find the location:
vsan.cmmds_find -u <file_UUID> <location_of_the_file>
the output in owner column shows the name of the ESXi host on which the files are available.
In my case, owner name is “esxi01.learningfingers.com”.
Please note, in my case both the files are owned by same ESXi host.
Step 4: Let’s take ssh session of the ESXi host and remove the files:
/usr/lib/vmware/osfs/bin/objtool delete -u <file_UUID> -f -v 10
Confirmation:
After the inaccessible files are deleted, my cluster came back to healthy state and shows all the objects.
- How to Implement Hytrust KMS and enable vSAN encryption? - 16/10/2022
- How to delete Inaccessible objects in vSAN datastore? - 16/09/2022
- Availability options with vROPs 8. - 04/07/2022