Share via


Using differencing disks

Using differencing disks

Warning

Do not use Undo Disks on a virtual machine configured as a domain controller. Problems will occur with replication when you revert the virtual machine to an earlier state.

A differencing disk is a virtual hard disk you use to isolate changes to a virtual hard disk or the guest operating system by storing them in a separate file. A differencing disk is similar to the Undo Disks feature because both offer a way to isolate changes in case you want to reverse them. However, Undo Disks is associated with a virtual machine and all disks assigned to it, while a differencing disk is associated only with one disk. In addition, Undo Disks is intended to be a shorter-term method of isolating changes. For more information, see Using Undo Disks.

A differencing disk is associated with another virtual hard disk that you select when you create the differencing disk. This means that the disk to which you want to associate the differencing disk must exist first. This virtual hard disk is called the "parent" disk and the differencing disk is the "child" disk. The parent disk can be any type of virtual hard disk. The differencing disk stores all changes that would otherwise be made to the parent disk if the differencing disk was not being used. The differencing disk provides an ongoing way to save changes without altering the parent disk. You can use the differencing disk to store changes indefinitely, as long as there is enough space on the physical disk where the differencing disk is stored. The differencing disk expands dynamically as data is written to it and can grow as large as the maximum size allocated for the parent disk when the parent disk was created.

Warning

We recommend that you write-protect or lock the parent disk before using the differencing disk. Otherwise, if the parent disk is modified by some other process, all differencing disks related to it become invalid, and all data written to the differencing disks is lost. You also need to modify the virtual machine by replacing the parent disk with differencing disk, otherwise you will receive an error when you try to start the virtual machine because it cannot use a read-only disk. For instructions, see Add or remove a virtual hard disk.

You can find out which parent disk a differencing disk is related to by inspecting the differencing disk. Inspecting the parent disk does not identify any child disks that may be associated with it. To make it easier to identify relationships between disks, we recommend adopting a naming convention to support easy identification.

Managing the contents of differencing disks

You can distribute the contents that are stored in the differencing disk by merging the differencing disk. You can merge the changes to either the parent disk or a new virtual hard disk. Merging to the parent disk modifies the parent disk with all the changes stored in the differencing disk, and then deletes the differencing disk. Merging to a new virtual hard disk retains both the parent disk and the differencing disk in their current state, and creates a new virtual hard disk that is a combination of the parent disk contents and the differencing disk contents. You use the Administration Website to merge the changes. For instructions, see Merge a virtual hard disk.

Using multiple differencing disks with one parent disk

You can associate more than one differencing disk to one parent, which means that virtual machines can share one parent disk but have their own differencing disk. This way of using differencing disks can be useful in a variety of scenarios. For example, a test engineer or call center technician could have a dozen or more virtual machines with different configurations, such as allocated memory or type of networking, with different software updates, and different installed applications. The virtual machines could share a parent disk that contains the operating system, and each virtual machine could have its own differencing disk to store the configuration that differs from the parent. The following figure shows an example in which each differencing disk stores a different version of Internet Explorer.

One parent disk with multiple differencing disks

Warning

If you use multiple differencing disks that share a parent disk containing an operating system, such as the example shown in the figure, you must apply any software updates to each differencing disk. If you applied the software update to the parent disk, all differencing disks associated with that parent disk would be unusable.

You can chain differencing disks, which means that a differencing disk can have another differencing disk as a parent disk. Depending on how you design the chain, you can save considerable disk space. For example, if you want to test upgrade scenarios or version compatibility, you could use a parent disk as the base and a chain of differencing disks for the consecutive versions. This approach would save disk space if each differencing disk contained one update only. The following figure shows a chain of differencing disks being used to store operating system updates.

Warning

When you create a chain of differencing disks, it is particularly important to lock all disks except the most recent child disk. Any changes made to any older disks would invalidate all later disks in the chain. However, the most recent child disk must be writable so that it can be used by a virtual machine.

A chain of differencing disks

Note

If a parent disk of a differencing disk cannot be found, for example, if only one of the virtual hard disks is moved, an error will be logged to the Virtual Server event log when you start the virtual machine. You can use the Administration Website to inspect the differencing virtual hard disk and modify the path information. For instructions, see Inspect a virtual hard disk. A differencing disk can can grow as large as the maximum size allocated for the parent disk when the parent disk was created. We recommend that you ensure you have enough storage before performing operations on the differencing disk that require a significant amount storage space, such as applying an operating system update. You cannot compact or convert a differencing disk. However, if the parent disk is a dynamically expanding virtual hard disk, you can compact or convert the parent disk after merging the differencing disk. If you defragment the physical disk on which a differencing disk is stored, the differencing disk file will be defragmented.