vSphere 6

ESXi 6 Equallogic reclaim free space

If you are thin provisioning VMs in your VMware environment with Equallogic SAN attached, you may need to Equallogic reclaim free space manually using this process.

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.

unmap01

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.

unmap02

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

#min hour day mon dow command
1 1 * * * /sbin/tmpwatch.py
1 * * * * /sbin/auto-backup.sh
0 * * * * /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5 * * * * /sbin/hostd-probe ++group=host/vim/vmvisor/hostd-probe
00 1 * * * localcli storage core device purge
30 12 * * * esxcli storage vmfs unmap -u <your datastore ID>
30 2 * * * esxcli storage vmfs unmap -u <your datastore ID>
30 4 * * * esxcli storage vmfs unmap -u <your datastore ID>
After editing the crontab you also need to kill and restart the crond process, which you can do like this:
# kill -HUP $(cat /var/run/crond.pid)
# /usr/lib/vmware/busybox/bin/busybox crond

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

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.