In this vSAN find and delete unassociated or inaccessible objects blog post, I will discuss an issue I had a couple of weeks ago. I had a vSAN with some issues with some inaccessible objects and could not resync or fix them using the vSAN. Even detach and reattach the ESXi host did not fix the problem.
So this work needs to be done manually and delete the inaccessible objects. The first issue, I was able to find in which ESXi these objects belong.
To be able to fix this, we need to use the rvc tool.
Note: Guide for rvc tool HERE.
From vCenter console
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
root@vCenter [ ~ ]# rvc [DEPRECATION] This gem has been renamed to optimist and will no longer be supported. Please switch to optimist as soon as possible. Install the "ffi" gem for better tab completion. WARNING: Nokogiri was built against LibXML version 2.9.8, but has dynamically loaded 2.9.10 Host to connect to (user@host): administrator@vsphere.local@localhost password: Welcome to RVC. Try the 'help' command. 0 / 1 localhost/ |
First, let us check the vSAN Cluster state.
Note: Do not forget first in rvc to enter the computer’s directory to run your commands.
1 2 3 4 5 6 |
/localhost/vCenterName/computers> vsan.check_state -r ClusterName 2021-09-16 16:28:57 +0200: Step 1: Check for inaccessible vSAN objects Detected 5fbafd60-9210-8da7-2955-48df376ee6b0 to be inaccessible, refreshing state |
As we can see on object was detected as inaccessible.
We can then try to remove them with just a purge command
1 2 3 4 5 6 |
/localhost/vCenterName/computers> vsan.purge_inaccessible_vswp_objects ClusterName 2021-09-16 16:29:17 +0200: Collecting all inaccessible vSAN objects... 2021-09-16 16:29:17 +0200: Found 0 inaccessbile objects. |
Again, even the state display one object inaccessible, the purge command could not delete or fix.
Next, we need to find where these objects belong to so that we can delete them manually. We can do that using the command vsan.cmmds_find.
Note: You need to add the location(full path) where the find command should run.
1 2 3 |
/localhost/DC-vCenterName/computers/ClusterName> vsan.cmmds_find -u 6dae4161-e8f0-171b-0b9e-48df376ee510 /localhost/DC-vCenterName/computers/ClusterName |
As we can see in the following image, the find command found the object and the stored ESXi.
From ESXi host.
Now that we know in which ESXi the object is, we can run the delete command manually in the identified ESXi.
1 2 3 |
/usr/lib/vmware/osfs/bin/objtool delete -u 6dae4161-e8f0-171b-0b9e-48df376ee510 -f -v 10 |
We do the same process for all objects found in all the ESXi with unassociated or inaccessible objects.
After finish, run the Health Check(Skyline Health) again in the vSAN monitor, and all is green with no more issues with objects.
I hope this quick fix helps you take care of your vSAN find and delete unassociated or inaccessible objects.
Share this article if you think it is worth sharing. If you have any questions or comments, comment here, or contact me on Twitter.
Leave A Comment
You must be logged in to post a comment.