Copying Physical Disks to VHD
Hyper-V allows you to create VHD files that are duplicates of existing physical harddisk drives. You can use the New Hard Disk Wizard to perform this task under the following conditions:
- You can use the New Hard Disk Wizard only to convert physical 33 disks. It is not possible to convert partitions.
- The New Hard Disk Wizard cannot be used to migrate the disk that hosts the OS. It is possible to migrate only data disks.
- You need to ensure that the host OS does not access the disk being converted during the conversion process. You can do this by removing the drive letter associated with the disk in the Disk Management console.
To copy an existing physical disk to VHD, run the New Virtual Hard Disk Wizard, create a dynamically expanding disk, and then, on the Configure Disk page, choose the Copy the Contents of the Specified Physical Disk option.
Converting, Expanding, and Compacting VHDs
Hyper-V allows you to convert virtual hard disks that were originally set up as dynamic so that they become fixed and disks that were originally set up to be fixed so that they become dynamic. What happens when you perform a conversion is that a new VHD of the target type is created, and the contents of the source VHD are copied across to it. After this has happened, the source disk is deleted. To perform this procedure, you need to ensure that you have double the VHD's size available prior to attempting the conversion. You use the Edit Virtual Hard Disk Wizard to perform the conversion process.
Compacting a virtual hard disk reduces the size of a VHD file on a volume by removing blocks that are not storing data. You can compact only a dynamically expanding virtual hard disk, so if you want to reduce the size of a fixed VHD file, you'll need to first convert it to a dynamic disk. To ensure that you achieve the maximum possible reduction in size, you should also defragment the hard disk prior to performing compaction.
- To defragment a virtual harddisk drive, you need to shut down the VM, mount th e VHD in the host Hyper-V OS, perform defragmentation, and then dismount the VHD.
You can also use the Edit Virtual Hard Disk Wizard to expand a VHD. You can expand both dynamic and fixed-sized VHDs, though you'll be limited to the maximum allowable size, depending on whether the VHD is connected to a virtual IDE or virtual SCSI adapter.
Connecting Virtual SCSI and IDE Adapters
Virtual hard disks, pass-through disks, and virtual DVD-ROM drives connect to virtual disk drive controllers. Hyper-V supports both virtual IDE controllers and virtual SCSI controllers. A computer can have a maximum of two virtual IDE controllers and a maximum of four virtual SCSI adapters. Each virtual IDE device supports up to two attached devices. Each virtual SCSI device supports up to 64 attached devices.
- It is important to remember that Hyper-V VMs can boot off only virtual hard disks attached to virtual IDE controllers.
- Hype r-V on Windows Server 2008 R2 supports adding or removing virtual hard disks from a powered on virtual machine without requiring a reboot, as long as integration services is installed and the disks are attached to virtual SCSI adapters.
Virtual hard disks connected to a virtual IDE controller cannot be larger than 127 GB. Virtual hard disks connected to a virtual SCSI controller cannot be larger than 2040 GB.