For many businesses, using thin provisioned volumes is the best way to optimize a virtual machine environment. This can be applied at both the hypervisor level and the storage area network level. In the case of VMware and EqualLogic (EQL), although both can be used in conjunction with one another and both will continue to grow together, VMware does not report to the EqualLogic when freed blocks can be returned to the free space pool when space is cleared up. This can cause an EqualLogic volume to appear to be using more space than is actually in use.
VMware shows that 414.59GB of free space is available.
EqualLogic shows that 272.09GB of free space is available.
One of the few ways this could be fixed is by migrating all virtual machines to a newly created datastore. This process can be incredibly time consuming and add a large load to the environment. Fortunately, from EqualLogic firmware 6.0.1, space can now be reclaimed on the EqualLogic by running a few simple commands in VMware.
Note: If you are running ESXi 5.5 / vCenter 5.5, visit the EqualLogic and VMware 5.5: Reclaim Unused Disk Space for EQL Volume article to reclaim space on a thin provisioned EqualLogic.
Enable SSH on a VMware Host
The first step will be to enable SSH on a host that has access to the Datastores.
Select Configuration:
Click on Security Profile:
Find SSH in the menu and start the process:
Reclaiming Space on the EqualLogic Volume
Note: You must be on firmware version 6.0.1 or higher to be able to reclaim disk space.
Once SSH has been enabled, connect to the host using SSH. Putty is a great free resource to use. http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Run the command:
cd vmfs/volumes
Next, I typically browse the directory to select what datastore I want to connect.
Run the command:
ls
In this case, I have identified that I want to clean up EQL-Vol-01 (this is case sensitive), so I issued command:
cd EQL-Vol-01
Although I have successfully navigated to /vmfs/volumes/EQL-Vol-01, VMware will navigate me to the ID for the datastore. My path will display something a bit different.
I typically verify what commands I am going to run before running them, so I ran the command:
vmkfstools –y ?
Next, run the command:
vmkfstools –y 60
This will clear up 60% of the amount of free space available. Although you can increase this number up to 99%, VMware suggests keeping this at 60%. If need be, the command can be run multiple times to reclaim all the free blocks. If the command fails, lower your percentage to something like 10 or 20%.
If Group Manager was open while the free space reclaim command was executed, Group Manager will auto refresh after space starts to clear up on the volume. In the example below, it took about 60 seconds to refresh that 50GB of space had been reclaimed.
Resources:
About Thin provisioning of Equallogic and VMware vSphere, http://en.community.dell.com/support-forums/storage/f/3775/p/19411388/19966452.aspx. Accessed April 28, 2014.