Removing Inaccessible Objects in vSAN

Reading Time: 2 minutes

While building out a new vSAN Cluster, I received an error for the vSAN object health. I clicked the “Repair Objects Immediately” button, and it thought about it for a minute – but ultimately it was a wasted effort. The “Purge Inaccessible VM Swap Objects” button was up next. But unfortunately, like its partner, it also returned with no resolution.

these objects can potentially be .vswp objects that are generated when VM’s are powered on, and are safe to delete. The first step is to get into the RVC and see what we’re working with:
Command> dvc administrator@vsphere.local:[password]@localhost
cd 0
cd 1
Now you should see your cluster name available. Run the following command which will check and refresh objects, and then list any inaccessible objects.
vsan.check_state -r [cluster name]

Now we can purge the inaccessible object that was found:
vsan.purge_inaccessible_vswp_objects [cluster name]

As you can see it was unable to purge the objects. Now this next snippet needs to be run on the owner host node(s) of the object. This was a small cluster so we can check all of them manually with minimal effort.
/usr/lib/vmware/osfs/bin/objtool getAttr --bypassDom -u 6d747759-1e15-10c6-a1d8-107d1a577dc1
And finally, we can run this command to delete the object. If successful, there will be no output.
/usr/lib/vmware/osfs/bin/objtool delete -u 6d747759-1e15-10c6-a1d8-107d1a577dc1 -f -v 10
Now re-test that cluster health again.

Success! There are no more objects in a state of “Inaccessible” and the vSAN object health alarm is back to green.

Check Out!