By Narasimha Krishnakumar, Product Management, End-User Computing
This post provides an overview of the Space Efficient Virtual Disk (aka SESparse disks) feature and details how to use it in Horizon View 5.2.
The need for Space Efficient Virtual Disks
Space Efficient Virtual Disk is a new virtual disk (vmdk) format. It is a sparse format similar to redo log based disk with the added benefit of both growing and shrinking dynamically. This new vmdk format is applicable to both block based storage (iSCSI, FC etc.,) and file based storage (NFS). The block size of these disks is 4KB that aligns well with the NTFS block size and provides maximum space efficiency. In addition, it helps keep IOs aligned on most storage arrays.
To understand the need for the new Space Efficient Virtual disks, one needs to first understand the alternative disk format, which is a redo log based format. Redo log based disks offer capacity savings as customers can deploy VM’s using a single master image and creating a linked clone off the master image. However, over a period of time during the lifecycle of the VM, the linked clone grows in size as logical blocks are first written to and redo log based disks do not offer the ability to reclaim space that is allocated but no longer used. This unused space happens more than you may think due to files that Windows automatically creates and deletes, as well as how NTFS works. The growth can be significant. In VMware’s internal deployment of View we have seen unused capacity grow by about 1GB per VM per week. Please note that the numbers may vary in other environments depending on the activity levels and configurations within a VM.
Because of this growth, linked clones typically were a best fit only for stateless desktops that would be occasionally refreshed or recomposed (refresh and recompose deletes the entire Redo log based disk, and starts with a fresh one). While there are many advantages to stateless desktops, they do add complexity and constraints to View deployments that may not be a good fit for all user types in a given environment.
With Space Efficient Virtual Disks, we can deliver much of the capacity savings that linked clones provide, even for stateful desktops that are never refreshed or recomposed.
Figure 1 below illustrates the need for Space Efficient Virtual Disk:
Reclaiming unused space with Space Efficient Virtual Disks
Space Efficient Virtual Disks enable space reclamation on a per VM basis by supporting two operations:
Mark - The mark operation scans the VM’s Windows NTFS files system for free blocks. Once such free but allocated blocks are identified, it marks these blocks for reclamation in the ESX hypervisor.
Shrink – The shrink operation compacts the blocks within a Space Efficient Virtual disk and once complete, truncates the virtual disk file, and sends an unmap command down to the disk subsystems to complete the reclamation.
Horizon View 5.2 and Space Efficient Virtual Disks
With Horizon View 5.2 Space Efficient Virtual Disks are automatically (the default) chosen when customers provision pools based on View Composer Linked Clones. The Space Efficient Virtual Disk format is only applicable to the linked clone portion of the VM and not applicable to the Master Image or Replica. In addition, this disk format is not applicable for Full Clones. Horizon View 5.2 exposes the space reclamation capability of Space Efficient Virtual Disks through the Horizon View Manager UI. When customers’ choose to create a Horizon View Composer based Linked Clone Pool, they are provided with the option of enabling space reclamation (enabled by default) and defining a threshold for space reclamation as shown in Figure 2 below.
Figure 2: Space Reclamation enabled by default when creating a desktop pool
The threshold is a per VM threshold. In the above example, the threshold is set to 1GB per VM, which means that space reclamation (mark and shrink) will kick in when the unused allocated space on a VM is estimated to exceed 1GB. In addition to specifying the threshold, customers can control when space is reclaimed from the VM’s. Marking and wiping generate storage I/O and consume CPU as the blocks are marked and compacted. Because of this, it is recommended that customers reclaim space during periods of low or no activity. This can be accomplished by defining a blackout time window as shown in Figure 3 below. In the example below, the space reclamation on VM’s occur when two conditions are met:
- Space reclaimable exceeds the defined threshold and
- The time is outside the blackout window – only between 6PM and 8AM
Figure 3: Definition of Blackout Window for Space Reclamation operations
The space reclamation operation runs on each VM (end user’s desktop) by calling the mark and shrink primitives described above.
Benefits of using Space Efficient Virtual Disks
Space efficient virtual disks optimize storage capacity in Horizon View deployments that use View Composer linked clones. Until Horizon View 5.2, customers have typically addressed the challenge of linked clone capacity growth by either doing a Refresh or Recompose operation on pools of desktops. With this new disk format, the need for reclaiming space with a Refresh/Recompose has been eliminated. The space reclamation is automated through Horizon View and customers only have to pay for storage capacity used. In addition, customers can now use linked clones to implement Persistent/Stateful desktops using very little storage capacity.
Space reclamation has a multiplier effect, which translates to large capacity savings on centralized storage arrays. When multiple VM’s are all leveraging the same datastore, space savings on each VM translates to space savings on the entire datastore and on the storage array. Figure 4 below, indicates the space savings achieved in an internal VMware test environment with 640 VM’s. The space reclaimed at the datastore level (LUN on a shared storage array) was about 0.5TB in a week, which translates to about 800MB per VM per week. As indicated earlier, these results are specific to the VMware test environment and your mileage may vary.
Another benefit of using Space Efficient Virtual disks is IO alignment. The Space Efficient Virtual disk format supports a 4K-block size as opposed to a redo log format, which is based on 512 byte blocks. This insures that all IOs from the hypervisor to the storage system (i.e. physical disks) are always aligned on 4K block boundaries. This can avoid performance cliffs on certain storage systems that don’t deal well with non-4k aligned I/O.
Figure 4: Space Savings on a 640 VM setup (Internal VMware Test setup)
The space reclamation operations in VM’s does take some CPU cycles and hence the recommendation to schedule reclamation during periods of inactivity. Additionally space reclamation also generates additional IOPS to the underlying disk storage subsystem. While we have not measured the IOPS and CPU impact, it is estimated that the overhead imposed is no more than 10% of total CPU utilization and IOPS load.
In our internal test environments we have measured the performance of Space efficient virtual disks relative to redo log based linked clones. The results are shown in Figure 5 and Figure 6 below.
Figure 5: Performance of SE Virtual Disks Relative to Redo Log linked clones
Figure 6: Latency profile of SE virtual disks vs. Redo log based linked clones
From the above charts, it is clear that there is no degradation in user interactive performance when using Space Efficient Virtual Disks.
Is View Storage Accelerator Supported with Space Efficient Virtual Disks?
Yes. The combination is tested and supported.
Is a specific version of vSphere required to use Space Efficient Virtual Disks in Horizon View?
Yes, vSphere 5.1 Update 1 is required for using Spacing Efficient Virtual Disks in View 5.2. The virtual machines should also be upgraded to the vSphere 5.1 version (hardware version 9 or later).
Does View Composer API for Array Integration (VCAI) interoperate with Space Efficient Virtual Disks?
Customers can use either VCAI based clones or Space Efficient Virtual Disks. Both of these features cannot be used at the same time on the same pool. Also, note that VCAI is still a tech preview feature and is not fully supported. We are working with our partners on a certification program, which will enable support for VCAI in the future.
With View 5.1 and View Storage Accelerator there was a similar blackout window. Is the blackout window for Space Efficient Virtual Disks different from that of View Storage Accelerator?
Horizon View has simplified the definition of blackout windows by making it Universal across all features. Both View Storage Accelerator and Space Efficient Virtual Disks will share the same blackout window.
Is there a way to reclaim allocated unused disk space without going through the Horizon View Admin UI and blackout policy?
The best way to reclaim space is by defining the threshold and the blackout windows. But if an adhoc space reclamation operation is required/desired, it is available through the vdmadmin command line. The command line for reclaiming space on an individual VM is:
vdmadmin -M [-b authentication_arguments] -d desktop -m machine -markForSpaceReclamation
Refer the Horizon View 5.2 Administration guide for more information about using this command.
Acknowledgements: I would like to thank and recognize my colleague Sunil Satnur, Staff Engineer, VMFS engineering for providing technical content to this blog.