ESXi 6 Equallogic reclaim free space
If you are thin provisioning VMs in your environment with an Equallogic SAN attached to your cluster, you may find that you start receiving warning from SAN HQ or your group manager alerting which states [ID: 4.2] Caution: % In-use space on volume. ย Let’s look at ESXi 6 Equallogic reclaim free space.
When you look in your VMware environment at your datastores, you may see that you have plenty of free space available. ย What gives? ย After thin provisioning when you deleteย data from blocks on a volume in VMware, these blocks are marked asย available for future use by vSphere however, on the Equallogic side, as far as it knows, the blocks are still assigned and not available for use.
I ran into this issue recently with a LUN that was the target of a script which backed up a few one off VMs using thin provisioning. ย After a while, the Equallogic volume started alerting that it was over the threshold of free space, however, within VMware the free space was fine.
Equallogic reclaim free space
Enter theย unmapย command in ESXi 6.0. ย Actually the command debuted in ESXi 5.5 and replaced the vmkfstools -y command which was deprecated at that point. ย The unmap command allows deleted blocks to be reclaimed on thin provisioned LUNs that support the VAAI UNMAP primitive. ย Using the command is fairly simple. ย You simply need to know the UUID of the datastore you want to reclaim space on.
esxcli storage vmfs unmap -u 11111111-2222222e-1b24-c12345678abcd
In the command above we are reclaiming free space of the volume “11111111-2222222e-1b24-c12345678abcd”. ย The volume UUID is easy to get – SSH into your host and navigate to your /vmfs/volumes and list the volumes from there. ย You will see the “datastore” name in front of the UUID the system understands. ย In putty you can simply drag over this and it will be copied which makes for an easy past into the esxcli storage command listed above.
In Equallogic reclaim free space, you can actually watch in group manager and see the space being reclaimed real time. ย The process takes a good bit of time and is not an “instant” process. ย Also, disk I/O on your Equallogic SAN will be impacted with a lot of Read activity as space is reclaimed so be prepared for a performance impact.
Cron Job
If you want to do this from a cron job, it is easily achievable.ย Below is a sample crontab file edited with the appropriate unmap commands.ย Crontab file is located at /var/spool/cron/crontabs/root
Final Thoughts
Theย unmap command is a handy tool that VMware administrators need to have in their short list of housekeeping procedures especially if you are thin provisioning VMs and deleting/creating VMs often as blocks will not be returned to the Equallogic SAN. ย However, if you have your alerting setup correctly either in group manager or SAN HQ, you should start getting caution notifications at 85% space used.
Sources: ย VMware KB about issue