Best Practices for Configuring Virtual Machines
In continuation to my first post on best practices, I'm back with some more.
This post discusses best practices that should be considered when configuring virtual machines in Hyper-V. Virtual machine performance is not only impacted by how the physical server is configured but also by the selections made when configuring the virtual machine itself.
Install Integration Services
The first, and probably the most important, best practice for virtual machines is to install the Integration Services (IS) that come with Hyper-V as soon as possible provided the operating system running in the virtual machine is supported (refer to the Integration Services section for information on supported Guests). Then, update the IS as needed.
Uninstall VMAdditions and Compact VHDs
When migrating virtual machines from Virtual PC or Virtual Server 2005 R2, uninstall the VMAdditions and compact the virtual hard disk before moving the disk to the Hyper-V server.
Set Display for Best Performance
For the best display in a virtual machine ensure the display interface is set for Best Performance. This will ensure the hardware acceleration is set to Full.
Configure Fixed-Size VHDs
Choose to configure fixed-size virtual hard disks as opposed to dynamically expanding. Performance is faster, the file system is less likely to fragment and managing space on the physical disk is easier. Always defragment a physical disk before creating a virtual hard disk.
Use SCSI Virtual Adapters for Data Drives
Hyper-V requires the virtual machine to boot from a virtual IDE Controller, however, SCSI virtual adapters can be used after that for mounting additional virtual hard disks. While performance differences between a virtual IDE and a virtual SCSI controller in Hyper-V is almost negligible (with Integration Services installed), the fact is more and larger capacity virtual hard disks can be attached to a virtual SCSI controller (4 controllers with 64 virtual disks each for a total of 256). So, if you need more than four virtual hard disks attached to a virtual machine, use a virtual SCSI controller.
Allocate CPU Resources Based on Anticipated Usage
It is also important to determine virtual machine performance to ensure CPU resource allocation on the physical server is adequate to support the workload inside the virtual machine.
Consider Using Pass-Through Disks
It is best practice to use virtual hard disks when creating virtual machine. However it is no always possible due to circumstances. Using pass-through disks the performance is slightly better versus using VHD's. It allows you leverage greater than 2TB. Very important, when using pass-through disks, virtual machine configuration files should be relocated to another hard disk or share. Here we loose the snapshot and portability of like in VHD's.
Ensure File Share High Availability
If a file share is being used to store virtual machine configuration data, it is best practice to ensure the file share is highly available.
Configure Domain Controllers to Optimize Performance
Domain Controllers are supported in Hyper-V when running in a virtual machine. The following best practices are recommended for these configurations: Never save state in a domain controller as this may cause synchronization issues in the domain. Never Pause a domain controller virtual machine for long periods of time as this may adversely impact replication. Always shutdown a domain controller. Do not take snapshots of a domain controller. Make a determination regarding time synchronization. The decision is either to use the Hyper-V Integration Service for Time Synchronization or not. If the decision is to treat the virtualized DCs like hardware based DCs, then disable the Time Synchronization capability in the Settings for each virtual machine and point the PDC Emulator to an external time source and allow all the other DCs to synchronize with the PDC Emulator. If the decision is to synchronize with the Parent partition, only enable the Time Synchronization capability for the DC holding the PDC Emulator FSMO Role.