Best Practices to improve Hyper-V and VM Performance
Best practices are the most obvious starting point for improving your Hyper-V and Virtual Machine performance. Read on to find out the top tips and best practices to improve your Hyper-V and VM performance:
- Avoid overloading Hyper-V Server
You must not overload Hyper-V Server. In other words, there is no need to host and run virtual machines which have no functions or I would say you just should not configure and install virtual machines for the sake of it. It is because VMMS.exe needs to maintain the status of all virtual machines including virtual machines which do not perform any business function.
- Avoid creation of multiple Virtual Network Switches
VMMS.exe, running as Hyper-V Virtual Machine Management Service, keeps track of virtual switches created and the communication between virtual machines. You must always use the VLAN Tagging or other isolation mechanisms to separate communication between virtual machines instead of creating a virtual switch.
- Configure antivirus software to bypass Hyper-V processes and directories
Antivirus software performs I/O operations for files being accessed by the Operating System and Hyper-V processes. You must alter the Antivirus configuration to exclude Hyper-V main processes and other directories as listed below:
- Hyper-V Processes: VMMS.exe and VMWP.exe
- All folders containing the Virtual Machine Hard disk files and configuration.
- Snapshot/checkpoint folders.
- Cluster Shared Volumes for path C:\ClusterStorage
- Avoid Mixing Virtual Machines that can or cannot use Integration Service components
There are two types of virtual machine communication taking place on the Hyper-V Server 1) communication using VMBUS design 2) communication using emulation. The former is faster and is available only if you install the Integration Components in the virtual machine. In case if you need to run a virtual machine which is not supported by the Hyper-V or Integration Services cannot be installed, it is recommended to follow below guidelines:
If you have a free Hyper-V Server, then install such virtual machines on that Hyper-V Server.
If you do not have a free Hyper-V Server, then connect such virtual machines to a separate Hyper-V virtual switch.
- Avoid storing system files on drives used for Hyper-V storage
You must not store Hyper-V virtual machine files on drives used by the Operating System. It is because of the I/O operation. Drives, where the system files are stored, are accessed by the system processes continuously and this might cause delay in processing the Hyper-V tasks.
- Use separate volumes for each VM
Since the administrative tasks of a virtual machine are controlled by its own process (VMWP.exe), keeping several virtual machines on a single volume will cause more Disk I/O operations from each worker process. Hence, it is recommended to use separate volumes for storing virtual machine files (VHD, VHDx, checkpoints, and XML).
- Avoid single point of failure for network adapters using NIC Teaming
Windows Server 2012 and later operating systems support NIC teaming. You must ensure that the NIC teaming is configured for the host operating system. Virtual Machines can also be configured to use the NIC Teaming feature.
- Always use Network Isolation Mechanism rather than creating a separate virtual switch
When you come across any networking requirement that needs to be configured on Hyper-V Server, use the order of preference that is listed below to achieve the configuration you need. The best way is to use the “Hyper-v Virtual Network Switch and VLAN Tagging” method. Other methods can also be used depending on your requirements, but consider them in this order:
- Hyper-V Virtual Switch and VLAN Tagging Method
- Hyper-V Virtual Switch Method
- Firewall Method
- Different subnet Method
- Another Physical NIC Method
- Install Multiple Network Interface cards on Hyper-V Server
There are multiple types of communication taking place in the Hyper-V. For example, communication between virtual machines, communication between virtual machines and parent and communication to manage these virtual machines from a management console. It is always recommended to dedicate a network interface card for managing virtual machines and Hyper-V host. Use of fabric resources is considered nowadays.
- Always use supported guest Operating Systems
VMBUS and VSP/VSC components are part of the Integration Services which help in improving the performance of communication between virtual machines and parent partition. Integration Components can be installed only on the Supported guest operating systems. Hence, please only install operating systems which are supported. A list of supported Guest Operating systems can be found here http://support.microsoft.com/kb/954958
- Always use Generation Type 2 Virtual Machines
“Generation Type 2” feature was introduced with Windows Server 2012 R2. Previously, normal virtual machines allowed booting from IDE controller only, but with Generation Type 2, you can boot virtual machines from a SCSI controller, which is much faster than a virtual machine booting from an IDE controller. “Generation Type 2” virtual machine uses VMBUS and VSP/VSC architecture at the boot level, which improves overall performance of the virtual machines. “Generation Type 2” feature also allows paging file to be relocated to a SCSI controller.
- Always change the default location for storing virtual machine configuration and VHD files
By default, when you enable the Hyper-V Role for the first time, the Hyper-V server is configured to store the virtual machine configuration and VHD files on the local storage under C:\ProgramData\Windows\Hyper-V\Virtual Machines folder. You must change this location to appropriate drives before the Hyper-V servers are moved to the production environment.
- Monitor performance of Hyper-V Server for optimization
There are several Hyper-V performance counters available which you can use to monitor the performance of the Hyper-V Server, virtual machines, network communication, etc. Please make use of these performance counters and fix any issues with the performance.
- De-fragment Hyper-V Server regularly or before creating a virtual hard disk
It is advisable to defrag Hyper-V Server disks where the VHD and virtual machine configuration files are stored regularly or before creating a large virtual hard disk file.
- Always install the Integration Components on the supported virtual machines
Integration Components provide VMBUS and VSP/VSC design to improve the performance of virtual machines running on the Hyper-V Server. Always install the Integration Components on supported Guest operating systems. For Linux distributions, there are separate IC versions available which you can download from Microsoft site.