I would like to post some tips&trics / tweaks for example in vSphere environments, to begin with… there is a little sort of bug within vSphere that can cause (in a vSan environment) that a host is not reporting any information anymore.
With this “trick” / “workaround” you are able to prevent this issue from happening.
What is going on? Well, at a certain point (no triggers) it is possible that the localcli proces for cleaning up mounting/unmounting luns in esx.conf comes in a hanging state, resulting in that the host is not reporting health data to the cluster. Is this a problem? Well, not really….everything stays working (production / vm’s), but you don’t have any information anymore for the health of that particular host.
This trick disables the proces from running. In fact, it is a script called from Cron, so the solution is to disable this Cron Job, that’s it!
Should I use it?
Well…depends… there is a slight chance this issue will occur and you will be affected, from my own experience, this one popped up in a 10 node vSAN cluster which is running 85 day’s without issues. So out the blue this one popped up.
There is a VMware KB which describes this issue : VMware KB2146548
So, when do I need to do this?
When you are not daily adding/removing LUN’s to your cluster, if you do, be careful with this one as it might mess up your esx.conf file.
Perform the following steps on every host in your cluster:
- Log in to ESXi host through SSH and root credentials.Note: There will be no impact to the environment if you are not creating/unmapping a large cluster of LUNs periodically.
- Navigate to the /var/spool/cron/crontabs/ folder.
- Backup the root file with this command:
cp root ./root.bak
- Open the root file using a text editor:
- Comment the line:
00 1 * * * localcli storage core device purgeThe line should look similar to:
#00 1 * * * localcli storage core device purge
- Save and close the file.
Reboot is not needed as Cron won’t start the proces again.
In case of a hanging localcli, please reboot the host (outside business hours ofcourse) and perform these actions afterwards.