My Experience with VMWare ESXI 6.5 UNMAP
ESXI 6.5 had went GA for a little more than 6 months now. This article would talk about my experience with the feature of Automatic space reclaimation. To read more about how to setup the UNMAP feature on ESXI 6.5, you can read Cody Hosterman's writeup which is linked below.
The feature / concept of space reclaimation is not really new, considering in ESXI 5.0 / 5.5, it was existing then, just that you manually execute space reclaimation / unmap on the datastore by CLI on the ESXI host.
I had just deployed ESXI 6.5 and vCenter 6.5 on a couple of HPE DL380 G7 and HPE DL380 Gen8 servers together with a Nimble Storage CS1000 Storage Array, so the environment fulfills the below requirements.
I have some Guest VMs running Ubuntu 16.04.2 Xenial with the Linux 4.4 Kernel and Windows 2012 R2 as well.
There are a couple of enhancements in ESXI 6.5 regarding space reclaimation
- Automatic UNMAP
- Linux Guest UNMAP support (either by manually running fstrim or by the discard option in /etc/fstab)
To use Automatic space reclaimation: UNMAP, the requirements are as follows:
- ESXI 6.5+ ?
- vCenter 6.5+ ?
- VMFS 6+ ?
- An array that supports UNMAP. ?
Nimble Storage Arrays supports UNMAP too, here are a couple of links about Nimble Storage UNMAP:
Setup automatic space reclaimation on ESXI 6.5 and it should be working fine, isn't it? Nope, turns out Windows and Linux in-guest UNMAP doesn't work for some reason even though it should be working. Don't have a screenshot of the error for Windows, but below is a screenshot of the errors in kern.log for Linux after running fstrim manually.
After digging around, seems like you would have to use the patch in KB2148989 (ESXi650-201703001 / Build 5146846) to resolve the issues with UNMAP. Had this issue since I had installed an older version of ESXI 6.5 using the HPE Custom Image for ESXi 6.5 Install CD.
Now, there is a reason why I didn't proceed with ESXi650-201703001 / Build 5146846, here is why. I had 10G cards on the servers that kept switching off when on Build 5146846.
Well, no matter, checked on the latest ESXI 6.5 release and there is ESXI 6.5d, downloaded a ESXI 6.5d ISO and slipstreamed the latest vibs on HPE vibsdepot and imported it to VUM for a baseline, remediated all the hosts to the existing baseline and rebooted.
Walla, all the in guest VM UNMAPing works fine. fstrim on Linux and optimize drive on Windows doesn't complain.
Here are some excellent and in-depth writeups by Cody Hosterman regarding UNMAP: