MD3xxx: Thin provisioned virtual disks explained
Summary: how thin provisioned virtual disks work on MD3xxx arrays and how to reclaim unused space on these virtual disks.
Resolution
This article explains how thin provisioned virtual disks work on MD3xxx arrays and how to reclaim unused space on these virtual disks.
Thin provisioned disks are only available with the disk pool feature on MD 32xx, 36xx, 34xx, and 38xx models.
It's possible to create a thin provisioned disk up to 63TB in size even if the disk pool does not have that capacity available.
Table of Contents:
- Thin Provisioned Disks and UNMAP
- How to perform UNMAP in Windows 2012/2012 R2
- How to perform UNMAP in Windows 2003/2008/2008R2
- How to perform UNMAP in VMware
1. Thin Provisioned Disks and UNMAP
A newly created thin virtual disk initially consumes 4GB in the disk pool. As data is added to the virtual disk it grows in 4GB chunks (by default, but configurable) using the available free space in the disk pool. The thin virtual disk will continue to consume free space in the disk pool until it reaches its maximum configured size or the disk pool runs out of space. If the disk pool or the thin virtual disk runs out of free space , the disk is placed offline. No reads/writes can be made to the disk until the space issue is resolved. Resolving this condition would require adding disk space to the impacted disk pool and/or thin virtual disk snapshot repository.
If data is then deleted on the virtual disk inside the OS, the OS doesn’t just give the free space back to the array automatically. This leaves a discrepancy between the used space in the OS and the used space on the array.
In order to reclaim the deleted space you need to use a feature called UNMAP (also known as Trim). The UNMAP feature is only supported by MD34xx and MD38xx , with a firmware installed after 8.25.xx.xx.
Note: MD32xx or MD36xx arrays do not support the UNMAP feature
If the thin disk was created prior to upgrading the MD34xx or MD38xx array to the 08.25.xx.xx firmware, it will not show as a thin disk in the operating system.

Figure 1.: Thin virtual disk shown as standard reporting policy.
A SMcli command needs to be run on all Thin virtual disks, so they present themselves as thin to the OS:set virtualDisk["virtualdiskName"] hostReportingPolicy=thin;
After performing the unmap operation in the OS, the empty space in the volume is returned to the pool as free space. What you see as used in the OS should closely match on the array side (within 4GB).
2. How to perform UNMAP in Windows 2012/2012 R2
Note: UNMAP automatically runs once a week per default on Windows 2012/2012 R2
-
Open "My computer" or "This PC"
-
Click on the volume that you would want to reclaim space.
-
Click the manage tab at the top of the window.
-
Click Optimize.
-
Make sure the correct volume is selected in the 'optimize drives' window then click optimize.

Figure 2.: UNMAP in Windows (Steps)
Notice that the Media type shows 'Hard disk drive'. This will do nothing to reclaim the space. The SMCLI command above needs to be run on the array so the Media type will show as 'Thin provisioned drive'. Now after clicking optimize, the reclaimed space will be returned to the array.

Figure 3.: Finished UNMAP process in Windows
3. Windows 2003/2008/2008R2
For legacy Windows operating systems a 3rd party tool is needed to start the UNMAP process.
There are several free tools available, e.g. GUEST RECLAIM by VMware.
4. How to perform UNMAP in VMware
For VMFS6 volumes UNMAP happens automatically.
For VMFS5 and below visit the dedicated article in the VMware KB.
In VMware, to check the status of the volumes in VMware run the following command:
# esxcli storage core device vaai status get
The 'delete status' for the LUN needs to show as 'supported'.