30 Ways to Improve Hyper-V Virtualization

We at Monitis like to keep you informed and we want to make your job as a system admin or webmaster as easy as possible. We’re all about reducing the pressure! So, lately we’ve been creating all kinds of online resources for you to access that offer tips on everything from monitoring server metrics with WMI, to tracking IIS with VBScript, to picking the most effective NoSQL database tool.  The list goes on!

Today, we’d like to offer some tips on hyper-v virtualization. What exactly is that? some of you may be asking, and why should I care?  According to Wikipedia, Microsoft Hyper-V, codenamed Viridian and formerly known as Windows Server Virtualization, is a hypervisor-based virtualization system for x86-64 systems. Released as a beta version, Hyper-V  has since been released in a free stand-alone version, and has been upgraded to Release 2 (R2) status.


30 Ways to Improve Hyper-V Virtualization


So what does Hyper-V do? Again, according to Wikipedia, Hyper-V supports isolation in terms of a partition. A partition is a logical unit of isolation, supported by the hypervisor, in which OSs execute. A hypervisor instance has to have at least one parent partition, running Windows Server 2008. The virtualization stack runs in the parent partition and has direct access to the hardware devices. The parent partition then creates the child partitions which host the guest OSs. A parent partition creates child partitions using the hypercall API, which is the application programming interface exposed by Hyper-V.

All in all, Hyper-V makes virtualization possible. And virtualization lets sysadmins do more with fewer resources. And isn’t that what every business wants today?

So, to make your life easier, here are some tips for working with Hyper-V:

1. Don’t share the Hyper-V hardware with other services

Your Hyper-V host resources should be dedicated to run a Virtual Machine. If you install and run other services such as SQL Server or Exchange on the host, they will not only consume resource but will also make troubleshooting more difficult.

2.Install Hyper-V on Windows Server Core.

The Server Core installation option of the Windows Server 2008 operating system installs a minimal server installation of Windows Server 2008 to run supported server roles such as the Hyper-V role. When you select this installation type, the Windows setup program installs only the files that are required for the supported server roles, the GUI and other non-essentials subsystem are not installed and that reduces memory and storage requirements.

3. Create performance baselines

In order to keep the optimal level of performance on your Hyper-V installation, you need to be able to quickly identify and react to changes in resource consumption as your system runs. You will only be able to identify changes if you have first created a baseline; in other words you have to know how your system performs when everything goes well. You can get instantaneous updates of your resource picture with a 24/7 monitoring tool like Monitis.

4. Allocate plenty of CPU and Disk Resources to the Hyper-V Virtual Machines

Plan to put to use 110% to 125% of the CPU resources and 105% – 110% of the disk resources required by a physical hardware solution to the Hyper-V virtual machines that you’re using. By configuring the Hyper-V virtual machine with additional resources, you will make certain that you’re providing performance on par with physical hardware — while accommodating any overhead required by Hyper-V virtualization technology.

5. A 64-bit guest operating system is preferable

32-bit Windows operating systems can only address up to 2GB of virtual address space per process. Pretty paltry! Meanwhile, a 64-bit operating system allows applications to take full advantage of the memory installed on the Hyper-V host.

6. Optimize workloads inside the VMs

Depending on the the availability of resources on your Hyper-V host, if one of the VMs is using too much resources, the performances of other VMs will be affected.  Keep monitoring the workload of each VM, follow best practices and be prepared to react quickly if anything goes wrong. This is why instant notification by a trusted partner is so important.

7.  Shutdown unused VMs

If a VM is no longer providing any service, please shut it down. This will free valuable resources on the host, and think of the kindness you’ll be bestowing on the environment. If a VM is only providing services at a certain time of the day, use automation scripts to start it up only when needed.

8. Choose a processor supporting SLAT

The R2 release of Hyper-V added the support for a new feature that reduces the memory required by the hypervisor for each running virtual machine and also provides a performance boost. With that functionality, the processor itself takes over the place keeping of virtual machine memory and how it maps to the memory on the host. By letting the processor perform this operation, the hypervisor uses less memory, and the amount of processor power required is decreased. Again, go out and hug a tree!

With newer processors from both Intel and AMD, Hyper-V can enable the Second Level Address Translation (SLAT) functionality. SLAT requires a processor that supports either Extended Page Tables (for Intel processors) or Rapid Virtualization Indexing (for AMD processors).

9. Anti virus software should give the VM file the “cold shoulder”

If a virus scanner is running on the host, constant scanning of virtualization-related files may slow down disk performance. Configure your antivirus to exclude the folder containing Virtual Machines VHDs and configuration files.  If you need to protect a virtual machine, install an antivirus within the VM itself.

10. Know you workload

By understanding what kind of workload you are running you will be able to focus your efforts and resources on getting the most from your systems.  For example, not all workloads are capped by the processing power available to the VM. Some workloads, such as a SQL server, are generally bound to a greater extent by the limits of memory and the disk subsystem than by the processor. In this case, buying a faster processor won’t necessarily provide faster performance to the VMs. Why not use the savings to invest in memory or a faster storage subsystem?

11. Reserve some memory for the host

Set aside at least 512 MB of RAM for the host. That memory is used by Hyper-V’s virtualization stack.  Hyper-V won’t allow a VM to launch unless at least 32 MB of RAM is available. Each virtual machine has memory overhead as well—a good baseline figure is 32 MB of RAM for the first gigabyte of virtual RAM allocated, plus 8 MB for each additional gigabyte of virtual RAM.

12. Install multiple storage controllers

A VM will do as much I/O as a physical system, if a VM is doing significant amounts of I/O, it can and will saturate the storage controller. Performance will suffer for any other VMs that are using virtual hard disks (VHDs) available from that storage controller.

13. Segment storage

Provisioning storage for virtualization doesn’t always mean deploying the largest drive available. In many cases, just as with many high-performance workloads, it’s preferable to have multiple smaller disks as opposed to fewer larger disks.

14. Use Multipath I/O (MPIO)

Multipath I/O (also known as MPIO) is a technology that utilizes redundant components—adapters, cables, and switches—to provide multiple “paths” to the same storage array. This provides redundancy in case a connection is lost, because the traffic continues to flow. This functionality is provided for free with Windows Server. MPIO works with both Fibre Channel and iSCSI connections. We highly recommend deploying it for a production virtualization.

15. Use high performance disks

You’ll see performance differences based on the rotational speed of the disk as well as the amount of cache available on the disk. The performance gains of moving from a 7,200 RPM disk to a 10,000 RPM or even 15,000 RPM disk are significant and can increase even more past that level. Likewise, you’ll increase performance if you move from 4 MB or 8 MB of cache to 16 MB or 32 MB.

16. Use out-of-band management

Reserve a network interface for your Hyper-V host management. You will use this interface to connect to your host with Hyper-V Manager and other management tools.

Using a separate interface you will be able to transfer your VHDs without affecting the operation of other VMs that may be running. In addition, through this interface you can effectively troubleshoot performance issues when a high-load condition is occurring on your VMs’ production network adapters.

17. Increase network capacity

Whenever possible, segregate VMs onto separate virtual switches. Each virtual switch can be bound to a different physical NIC port on the host, allowing for separation of VM traffic. This is good for security and performance reasons.

18. Segment network traffic when using iSCSI

Will the VMs be using iSCSI, or will the host be using iSCSI?

If the host is using iSCSI (for failover clustering, for example), then it should have a separate adapter port that is different from any adapter port being used for guest VMs.

If a VM is using iSCSI, it is recommended that you create separate virtual networks for the storage and the production workload.

19. Install Integration Services

If you Install Integration Services you will replace legacy generic drivers with drivers delivering the best possible performances for IDE, SCSI and Network virtual controllers.

20. Avoid mixing VMs that can use Integration Services with those that cannot

Virtual machines that cannot use Integration Services must use legacy network adapters to access the physical network. To accommodate legacy network adapters, you might need to disable some high-end features on the network interface. But doing that can can unnecessarily limit the functionality of the synthetic devices. Additionally, using emulated devices places an extra workload on the Hyper-V server.

21. Take advantage of Dynamic Memory feature

Dynamic Memory is a new feature introduced with Service Pack 1 for Windows 2008 R2.
The positive here is that Dynamic Memory will ensure that the host memory is allocated in the most efficient way to the Virtual Machines. VMs may need different amounts of memory allocated when workload varies. You can’t do this by allocating manual memory.

22. Use fixed-size disks whenever possible

Fixed-size disks space are allocated all at once when you create them resulting on being hosted on contiguous files on the physical storage. Dynamic disk space is allocated as needed and this may result in a fragmented file on your storage. You’ll find that you won’t reap the best possible performance.

23. Close Hyper-V Manager on the host

Don’t manage your Virtual Machines from the Hyper-V host itself as any program you open locally will use resources that can’t flow to VMs. Hyper-V Manager consumes memory and processor resources to keep the application updated with the current snapshot of the screen and the status of the VMs.

24. Allocate 1 virtual processor to each physical core

Keeping this ratio of virtual processor to physical processor cores you will never have to worry about one VM stealing processor resources for another. When this is not possible, use processor Resource Control in each VM to configure which VM has priority over the other.

25. Disable TCP Offloading for Virtual Machine Network Cards

Offloading TCP tasks is only effective with a physical network and not virtual ones.
To disable this feature see: http://msdn.microsoft.com/en-us/library/ff565746.aspx

26. Enable offload capabilities for the physical network adapter driver in the host.

Offloading TCP tasks to a physical adapter IS effective. So, if possible, enable it on the host. See the same reference article as above for more information: http://msdn.microsoft.com/en-us/library/ff565746.aspx

27. When using multiple physical network cards, bind device interrupts for each network card to a single logical processor.

Under certain workloads, binding the device interrupts for a single network adapter to a single logical processor can improve performance for Hyper-V. System administrators can use the IntPolicy tool to bind device interrupts to specific processors. For more information about the IntPolicy tool, see: http://msdn.microsoft.com/en-us/windows/hardware/gg463378.aspx

28. If possible, enable VLAN tagging for the Hyper-V synthetic network adapter.

The Hyper-V synthetic network adapter supports VLAN tagging. It provides significantly better network performance if the physical network adapter supports NDIS_ENCAPSULATION_IEEE_802_3_P_AND_Q_IN_OOB encapsulation for both large send and checksum offload. Without this support, Hyper-V cannot use hardware offload for packets that require VLAN tagging and network performance could very likely decrease.

29. Install high speed network adapters and configure them for maximum performance

Consider installing 1-GB network adapters on the Hyper-V host computer and configure the network adapters with a fixed speed as opposed to using “auto negotiate.” It is very important that the network speed, duplex, and flow-control parameters are set to correspond to the settings on the switch to which they are connected.

30. Avoid storing System Files on drives used for Hyper-V Storage

Do not store any system files such as Paging File or TEMP directory on drives dedicated to storing virtual machine data. Again, you’ll just waste resources.

and one more tip: Use Monitis!

We hope this information on improving Hyper-V virtualization helps you speed up performance and cut waste. Stay tuned for more helpful advice from Monitis on improving the performance of everyday IT processes.

You might also like