Book Image

Hyper-V Best Practices

By : Benedict Berger
Book Image

Hyper-V Best Practices

By: Benedict Berger

Overview of this book

Table of Contents (16 chapters)
Hyper-V Best Practices
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Post-installation tasks


Be sure to remove the USB drive with the unattended setup file prior to moving the host to production. A host reboot could otherwise force a reinstallation, including a wipe of all hard drives, due to the trigger of another unattended installation.

Run Windows Update to make sure that you have installed all the available updates. Are there any Windows updates you should not install on Hyper-V hosts? Yes, drivers should not be installed over a Windows Update unless support tells you to do so. However, besides this, install every available Windows update in all of your Hyper-V hosts. Check out the update list for Hyper-V to check whether there are any Hotfixes available that are recommended for installation but not yet available through Windows Update (shortlink http://bit.ly/1kx0yYS).

The Hyper-V role is already enabled, and we are ready to create virtual machines. To ensure network connectivity and safe operations of our VMs, we will configure some additional parameters after the installation.

First of all, we need some basic network connectivity for our virtual machines. If you have a second Network Interface Card (NIC) available in your host, run the following command in an elevated PowerShell session:

New-VMSwitch -Name external -NetAdapterName "Local Area Connection 2"

If you have only one NIC, run the following command:

New-VMSwitch -Name external -NetAdapterName "Local Area Connection" -AllowManagementOS $true

Now, your virtual machines can use an external Hyper-V switch named "external" to communicate over the network.

Ever wondered about the many errors your RDP-mapped printer can create on a Hyper-V host? I could not believe this for a long time, but recently, I have seen a blue-screened Hyper-V Server due to improper printing drivers. Do you need to print from a Hyper-V host? Absolutely not! So, make sure that you disable RDP Printer Mapping through a Group Policy (or Local Policy).

Navigate to Computer Configuration | Policies | Administrative Templates | Windows Components | Remote Desktop Services | Remote Desktop Session Host | Printer Redirection | Do not allow client printer redirection | Enable in a Group Policy.

Hyper-V uses some default paths to store virtual machine configuration and its hard disks. I find this very interesting but definitely not suitable for a production environment. Make sure that you change the default paths, if possible to a non-system drive, by running the following commands in an elevated PowerShell window:

Set-VMHOST –computername localhost –virtualharddiskpath 'D:\VMs'

Set-VMHOST –computername localhost –virtualmachinepath 'D:\VMs'

I have not seen any issues with placing VM configuration files and virtual hard disks into the same folder structure. You have everything your VM configuration depends on in one place.

Another important post-installation task is to follow the rule: do not install other roles on Hyper-V hosts. A Hyper-V host is a Hyper-V host and nothing else. Move all the other services into virtual machines that run on the Hyper-V host.

Moreover, also keep the following points in mind:

  • Do not install any features other than Failover Clustering and Multipath I/O (MPIO) on a Hyper-V host

    There are exceptions in an SMB3 scenario where you also want to install Datacenter Bridging (DCB) and SMB bandwidth limits

  • Limit software installations to an absolute minimum, that is, backup and monitoring agents