Documente Academic
Documente Profesional
Documente Cultură
ashwinwriter@gmail.com
July, 2014
All was good, until the problem became apparent - Such systems are only
THIN for a time. Most file-systems use 'clear' space for new files to avoid
fragmentation; deleted content is simply marked unused at the file-system
layer rather than zeroed out or otherwise freed up at the storage layer. These
systems will eventually end up occupying entire allocation of storage even
without much additional new writes.
As seen in the illustration above, the physical capacity of the storage system
remains unchanged. In other words, the storage system does not free up the
capacity for the deleted host file which is commonly referred to as dead
space or hole punching.
NetApp for long made use of SnapDrive plug-in:
Basically, storage managed by SnapDrive on the Server/Host system logically
appears to come from a locally attached storage subsystem. In reality, the
capacity comes from the NetApp system. One advantage of this is that it
allows NetApp to use interfaces to the Windows API (specifically by becoming
part of the device driver layer and using the IOCTL functions) to watch for file
system changes on the host, and inform the NetApp system of these changes
via new and additional SCSI commands.
To address this thin provisioning limitation, the SCSI T10 Technical Committee
established the T10 SCSI Block Command 3 (SBC3) specification which defines
the UNMAP command for a diverse spectrum of storage devices including
hard disk drives (HDDs) and numerous other storage media.
Using SCSI UNMAP, IT administrators can now reclaim host file system space
and back-end storage dead space.
However, not only does SCSI UNMAP require T10 SBC3 compliant SCSI
hardware, it also requires necessary software application programming
interfaces (APIs) such as those now included in Windows Server 2012 or
Windows 8. That being said, previous Windows OS releases do not support the
necessary APIs.
Unmapping - In simple words, is basically de-allocating relationship between
and LBA and a physical block in a logical unit.
This is also known as HOLE PUNCHING on filesystem side.
What is Hole punching?
Hole punching in file-systems is to mark a portion of a file as being unneeded
and the associated storage to that file portion can then be freed.
Background: Block reclamation was always a SAN Hardware feature as it was
easier to get control over entire stack [OS/Kernel/filesystem/Driver/Storage].
Whereas, when the LUN is attached to the Host System, Host takes over the
LUN and formats it with either open source or a proprietary filesystem such as
NTFS. For something like NTFS, where the data structures are proprietary and
not officially documented, a Storage vendor generally provides their own
plug-in to take advantage of 'block reclamation', but not any longer.
NTFS Filesystem : As files are added to an NTFS volume, more entries are
added to the MFT and so the MFT increases in size. When files are deleted
from an NTFS volume, their MFT entries are marked as free and may be
reused, but the MFT does not shrink. Thus, space used by these entries is not
reclaimed from the disk.
Microsoft solved this problem by adapting to T10 Standard with
WIN2012/WIN8
By default, Windows 8 and 2012 enable real-time space reclamation using SCSI
UNMAP. That means, it does not require any third party API's to reclaim the
dead space.
So, what's new with Windows 2012 that allows space reclaim?
A new API implementation known as an IOCTL DSM allocation which retrieves
the logical block address (LBA) status of thin provisioned LUNs. All logical
blocks are grouped into slabs or clusters which are classified into mapped, deallocated or anchored states which Windows considers unmapped states. This
is transparent to users and ensures the Windows thin provisioning framework,
which includes space reclamation, performs as intended.
For further information about the Windows 2012 Thin Provisioning features,
reference the following link:
http://msdn.microsoft.com/en-us/library/windows/hardware/hh770514.aspx
Caution:
As previously described, anytime a large file is deleted, multi-level space
reclamation occurs. However, this may impact performance depending on how
often users or applications delete large files. Proper planning should help to
alleviate any real-time space reclamation performance impacts and can be
accomplished establishing performance baselines.
If Windows space reclamation planning identifies a high probability of
performance impact, consider the following option:
Real-time space reclamation can be disabled for large file deletions in the
following Windows registry.
1. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
2. Set the DisableDeleteNotification value to 1
Note: This Windows registry setting affects all LUNs on that particular
Windows Host. For further information, visit the following:
Plan and Deploy Thin Provisioning
http://technet.microsoft.com/en-us/library/jj674351.aspx
Red Hat Enterprise Linux 6 introduced the SCSI UNMAP command to the ext4
file systems to support releasing space on SAN platforms that also
implemented the UNMAP command.
Linux kernel uses discard requests to inform the storage that a given range of
blocks is no longer in use.
How to Use Discard option:
Create a new ext4 file system and mount it using the new discard option.
This is the piece that tells Red Hat to send the SCSI UNMAP command to
Storage Centre when it is done with blocks of storage.
[root@redhat ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.0 (Santiago)
[root@redhat ~]# mkfs.ext4 L DemoVol /dev/sdb
[root@redhat ~]# mount -o discard LABEL=DemoVol /files/
Fore more details, please see the DELL community Page.
http://en.community.dell.com/techcenter/b/techcenter/archive/2011/06/29
/native-free-space-recovery-in-red-hat-linux.aspx
SUMMARY
Note: With T10 SBC3 adaption by both OS & Storage vendors, propriety APIs
will not be required.
This is how LUN space usage stands after copying 1.33GB to the LUN.
We created a snapshot
Now, we intend to delete 655MB from the NTFS file system on host OS.
We checked the new available size on the volume (1.33 655 = 703 MB) and
looks like NTFS has unmapped the blocks and gained space back.
However, when we checked the space usage on the LUN [storage array], looks
like the blocks freed on the host hasnt reflected on the LUN side.
It means the Storage Array [Filer] has no idea about the blocks that have been
freed on the file system and its still showing the old allocated space.
NetApp SnapDrive: snapdrive runs space reclaimer scanner and informs the
NetApp filer that these blocks should be freed from the storage sub-system.
Snapdrive predicts based on the initial scan that it can free up to 670MB
worth of blocks back to the storage POOL. [You remember we deleted 655MB
of data on the host NTFS file system]
Enable the check box if you wish to [it is quite self-explanatory] and then
click ok to begin Space Reclamation.
Once the space reclamation process was finished, we checked the LUN space
on the Filer. It looks like we have regained space on the LUN.
Bottom line With THICK LUN, there is no benefit as far as reclaiming the
dead space, bcos you cant really give that space to any other volume as it is
fixed to that volume. However, it does improve space reporting on the
NetApp System Manager and/or other reporting tools. Hence, you would no
longer see LUN 100 % usage on the reporting tool, in spite of having plenty of
space on the HOST FILE SYSTEM.
Volume
Note: To verify that you have a T10 storage array, consult the VMware
Compatibility Guide.
http://www.vmware.com/resources/compatibility/search.php
FAQ
On
THIN PROVISIONING
NetApp
WHAT IS BASIC THIN PROVISIONING (GENERIC DEFINITION)?
Answer: Thin provisioning provides the ability to allocate space from a pool of
storage to a volume or LUN only when the data is written, rather than
preallocating the space. This allows the storage to be purchased
incrementally as it is needed, rather than purchasing large amounts of storage
upfront based on guesses about storage requirements.
SO, WHAT IS THICK PROVISIONING?
Answer: Thick provisioning is the traditional approach of fully preallocating all
space to a volume or LUN on its creation, rather than waiting for data to be
written to the volume or LUN.
WHAT ARE THE KEY BENEFITS OF USING NETAPP THIN PROVISIONING?
Answer: NetApp thin provisioning can increase storage utilization while
providing the flexibility to address the challenges in a dynamic IT
environment. Since space is not taken from the storage pool until data is
written to a volume or LUN, the unused space is available to any thinprovisioned volume or LUN using that common shared pool. For more details
about NetApp thin provisioning, refer to TR-3563, NetApp Thin Provisioning
Increases Storage Utilization with on-Demand Allocation.
http://media.netapp.com/documents/tr-3563.pdf
CAN I GROW OR SHRINK THE SHARED STORAGE POOL (AGGREGATE)?
Answer: The aggregate can be expanded, but cannot be reduced.
CAN I ALLOCATE MORE STORAGE TO VOLUMES AND LUNS THAN IS
AVAILABLE IN THE AGGREGATE?
Answer: Yes, this is possible when volumes or LUNs use thin provisioning. This
is known as overcommitment.
IS THERE AN ADVANTAGE TO THIN PROVISIONING A LUN WITHIN A
VOLUME, BUT NOT THIN PROVISIONING THE VOLUME? WHEN WOULD IT
BE USED?
Answer: Doing this is useful if it is desirable to have the LUNs use the volume
as the shared pool of guaranteed space instead of the aggregate.
However, it offers better first write performance, this is due to the fact that
the disk blocks corresponding to an eager zeroes disk are already zeroed out
during its creation.
Lazy Zeroed thick provisioning: A lazy zeroed thick disk will also get
all of the space allocation it needs at the time of creation, but unlike
eager zeroed disk, it DOES NOT write zeroes to all of the disk blocks.
Each disk block is zeroes out only during the first write. Although, it
doesnt offer the first write performance like eager zeroed disk, all of
the subsequent writes to the zeroed blocks will have the same
performance.
Thin-provisioning disk: This type of disk will not use all of the disk
space assigned to it during creation. It will only consume the disk space
needed by the data on the disk. For example - If you create a think
VMDK of 100GB, it will not use 100GB of space at the back-end. If a
100MB file is added to the VMDK, then the VMDK will grow by 100MB
only.
3. In the search box enter unmap and click search or press return key.
4. Search should return quite a few documents that you can refer to for more
information on UNMAP command and how it works internally.
Informational articles:
http://www.13thmonkey.org/documentation/SCSI/spc3r23.pdf
http://www.snia.org/sites/default/files2/SDC2011/presentations/monday/Fr
ederickKnight_File_Systems_Thin_Provisioning.pdf
https://communities.netapp.com/community/netappblogs/efficiency/blog/2
010/08/04/punching-holes
Thin Provisioning: [Must Read]
http://msdn.microsoft.com/enus/library/windows/hardware/dn265487(v=vs.
85).aspx
Note: For any current working draft, you will need to be a member of T10.
PS: This document is my own small effort to shed light on thin provisioning & block
reclamation and therefore there may be some information which is incorrect and I hope the
reader will point to it. Thanks!
Courtesy: T10 org, Symantec, IBM, Redhat, VMware, Dell, Microsoft & NetApp
ashwinwriter@gmail.com
July, 2014