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:
|
Convert | Convert allows you to:
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.
|
Differencing disk | A differencing disk is a VHD associated with another disk and contains only changes to the associated disk.
|
Snapshot/Checkpoint | A snapshot, also known as a checkpoint, can be used to restore a virtual machine to a previous state.
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:
|