Blog Post

Security, Compliance, and Identity Blog
4 MIN READ

Using Hyper-V Differencing Disks with VDI

MicrosoftSecurityandComplianceTeam's avatar
Sep 08, 2018
First published on CloudBlogs on Oct, 25 2010
On the Virtualization with Hyper-V Technical Resources page , we’ve posted the “Virtual Hard Disk Performance White Paper.” This paper contains information about the performance implications of operations that use a differencing disk with Hyper-V, as well as the pro and cons of using differencing disks. All the information in this document is relevant to using differencing disks within a Virtual Desktop Infrastructure (VDI) environment. In this post, we cover the specifics of implementing differencing disks within the Microsoft VDI system. There are two types of VDI implementations with Remote Desktop Services:
  1. Personal virtual desktops: Virtual machines that are permanently assigned to users by an administrator. This configuration is saved in Active Directory Domain Services. A personal virtual desktop is typically used when a user needs a dedicated virtual machine (VM) with administrative privileges (for example, a user might want to install applications).
  2. Virtual desktop pools : Groups of identically configured virtual machines that are temporarily assigned to users by the Microsoft VDI system. Administrators can configure a VM to be a part of a pool.
When using a personal virtual desktop , there is no need to use a differencing disk. Differencing disks offer a shared common parent (base) image. The parent image contains all the data, which will not change greatly in the child (differencing) disks. In the case of a personal virtual desktop, the child image is prone to change from its parent. The owner of the personal virtual desktop makes normal configuration changes to their personal desktop, installs applications, and performs updates to the operating system. These changes to the personal virtual desktop make changes within a child image and negate the need for a parent image. In fact, the child image can easily become larger than the parent image. Therefore, the pros of reducing disk space usage by using a differencing disk are lost with a personal virtual desktop. When using a virtual desktop pool , users will be given access to a pooled desktop image for a predetermined time, which is usually the life of their session. After their predetermined time, usage of the image is over, and the disk image is restored back to its original state. From a disk space utilization standpoint it makes good sense to have the original state restoration point be a differencing disk for all of the virtual desktops in the pool. This will allow the parent image to maintain a static disk space usage while the child images will grow during the life of the session and be deleted after the session life is over. For a list of the pros and cons of using a differencing disk (from the Windows Server 2008 R2 VHD Performance paper), see the following chart.
Storage Container

Pros

Cons

Differencing VHD

*note: dynamic disks face many of the same performance issues that differencing disks face

  • Good performance
  • Quicker to create  than fixed sized VHD
  • Grow dynamically to save disk space and provide efficient storage usage
  • Smaller VHD file size makes it more nimble in terms of transporting across the network
  • Blocks of full zeros will not get allocated and thus save the space under certain circumstances
  • Compact operation is available to reduce the actual physical file size
  • Interweaving of metadata and data blocks may cause I/O alignment issues
  • Write performance may suffer during VHD expansion
  • Dynamically expanding and differencing VHDs cannot exceed 2040 GB
  • May get VM paused or VHD yanked out if disk space is running out due to the dynamic growth
  • Shrinking the virtual capacity is not supported
  • Expanding is not available for differencing VHDs due to the inherent size limitation of parent disk
  • Defrag is not recommended due to inherent re-directional layer

We definitely see the pros of using a differencing VHD in the virtual desktop pool scenario. The largest benefits are:

  • Acceptable performance
  • Disk space savings
The cons of using a differencing VHD in the virtual desktop pool scenario are either not important or are outweighed with the disk space savings:
  • “Write performance” : With the use of virtual desktop pools, the writing to disk performance loss is an acceptable loss due to the disk space savings. Make sure you look at the performance information in the Virtual Hard Disk Performance paper to see the actual number differences in write performance to ensure it is acceptable in your scenario. For write operations of user data, the use of a shared drive for writing user data out (as is the case with roaming profiles and folder redirection for user directories) will eliminate some of the need to write to the actual differencing disk.
  • “Dynamically expanding and differencing VHDs cannot exceed 2040 GB, May get VM paused or VHD yanked out if disk space is running out due to the dynamic growth ”: The destruction of a virtual desktop pool after a user’s session is over helps to mitigate the large need for disk growth, but make sure you plan for disk space capacity before putting together your deployment.
One thing to note with the use of differencing disks is the fact that they do grow with write operations. In the case of a virtual machine “idle,” read and write operations still occur within the operating system, such as spyware and virus scanning and definition updates, Windows update processes, and various scheduled system tasks. Since these occurring functions provide write operations, the virtual disk will grow.  A good practice is to allow idle VM’s to be reclaimed by the system and restored back to their original (parent) state, therefore deleting the disk growth that occurred while the VM was operating or sitting idle. Stay tuned for a tuning guide which will give you some ideas about what services, processes, programs, or settings you can tweak in a VDI environment that can also affect VHD disk space growth. Disk optimization for differencing disk usage Be aware that the disk read operations on a parent disk are very high. Therefore, placing the parent disk on Solid State Drives (SSD) should help because SSDs have high read IOPS.

In cases where a SAN is in use and a cluster shared volume is used to share the parent disk between Hyper-V hosts, expect decreased performance due to the overhead of coordinating the read/write operations between the Hyper-V hosts.

Published Sep 08, 2018
Version 1.0
No CommentsBe the first to comment