Virtual Machine Storage Summary

When creating a new Virtual Machine (VM), the operating system and other contents of the VM are stored in a VHD file.

Keep in mind the following when creating a new VM:

  • When you create a VHD file during the process of creating a new VM, the VHD file will be a dynamically expanding disk.
  • To use a fixed sized VHD with a VM, create the VHD before you create the VM.
  • You have the option to copy the contents of an existing VHD or an existing physical disk to a new VHD.
  • VHDs on IDE require the VM to be powered off in order to make changes.
  • VHDs on SCSI are hot swappable, meaning that you can make changes to the VHD while it is running.

The following table describes management tasks you can perform on VHDs:

Action Description
Expand Expand allows you to increase the maximum size available in a VHD file.
Shrink Shrink allows you to reduce the maximum size available in a VHD file.
Compact Compact allows you to reduce the size of a dynamically expanding VHD. Dynamically expanding VHD files:

    • Increase in size as files are added.
    • Do not automatically reduce in size when files are deleted.

The storage capacity of the VHD remains unchanged when you compact the drive.

Convert Convert allows you to:

  • Change the format of a file from a VHD to VHDX, or change the format from VHDX to VHD.
  • Change the type from fixed to dynamically expanding or from dynamically expanding to fixed.

When you convert a VHD file, it makes a new copy of the file. For the changes to take effect, copy the new file to the same location as the VHD file you changed.

Do not edit a disk with snapshots, replication enabled, or differencing disks.

Keep in mind the following regarding Hyper-V in Windows Server 2012:

  • You can replicate a VM to a VM hosted on another Windows Server 2012 with the Hyper-V role installed.
  • You cannot edit a running VHD.
  • You can clone VM domain controllers.

The following table describes features you can use with VMs:

Feature Description
Pass-through disk When you connect a physical hard disk to a VM, the hard disk is referred to as a pass-through disk.

  • The physical hard drive must be on the virtualization server or it can be a network-attached disk.
  • The pass-through disk must be offline so the VM can have exclusive access to it.
  • The Disk Management snap-in cannot be used to add a pass-through disk to a VM.
Differencing disk A differencing disk is a VHD associated with another disk and contains only changes to the associated disk.

  • The differencing disk is referred to as the child disk; the disk it is associated with is the parent disk.
  • The parent disk remains unchanged. The child disk contains the changes to the parent disk.
  • Differencing disks save space but require more processing resources.
  • A differencing disk must be the same format (VHD or VHDX) as the parent.
  • A differencing disk can be merged with the parent using Edit in Hyper-V Manager.
  • Differencing disks are not recommended for use in a production environment.
Snapshot/Checkpoint A snapshot, also known as a checkpoint, can be used to restore a virtual machine to a previous state.

  • You can apply multiple snapshots to get to an exact state of the VM.
  • Space is reclaimed when you delete a snapshot.
  • In Windows Server 2012, a Paused-critical status indicates that the host machine is out of space for the snapshots and has been paused to allow the snapshot to be redirected to another drive.
  • Snapshots should be deleted through the Hyper-V Manager console.
  • Merge a snapshot as soon as you determine the snapshot is the state to which you want to restore the VM.
    • Large snapshots take time to merge.
    • Windows Server 2012 allows you to merge a snapshot to a running VM.
    • Merging improves disk performance.
  • When you delete a snapshot, the snapshot is merged with the preceding snapshot and deletes subsequent snapshots.
  • In Windows Server 2012, a domain controller is prevented from replicating old information when a snapshot is merged.

In Windows Server 2012 R2, the Checkpoint-VM cmdlet is used to create a checkpoint on a VM. Keep in mind the following when creating a checkpoint:

  • The Checkpoint-VM cmdlet lets you create the checkpoint while the virtual machine is running.
  • The -AsJob parameter processes the cmdlet as a background job.
  • The -PassThru parameter pipes the checkpoint.
  • The PowerShell commands Export-VM and Export-VMSnapshot export a checkpoint.
Coaching
© Data Coincide, LLC 2010-2019