© Andy Syrewicze, Richard Siddaway 2018
Andy Syrewicze and Richard SiddawayPro Microsoft Hyper-V 2019https://doi.org/10.1007/978-1-4842-4116-5_2

2. Configuring Hyper-V Host Settings

Andy Syrewicze1  and Richard Siddaway2
(1)
Jenison, MI, USA
(2)
Baston, Lincolnshire, UK
 

We’ve been digging through introductions and theory for some time, so it’s now time to put that to practical application. We’ll start by configuring the host settings of a stand-alone Hyper-V host. Hyper-V Manager will be used to complete these tasks, as it provides all of the needed functionality to connect to hosts, create virtual machines (VMs), and manage them.

Note

A Hyper-V host may be referred to as a host or parent, while a VM may be referred to as a VM, guest, or child. The terms are interchangeable, and all will be seen throughout this book.

In This Chapter

This chapter will prepare you for future chapters, in which you’ll create, and modify, VMs. Please be aware that some sections of Hyper-V Manager will simply be seen or mentioned in this chapter and may not be explained in full. Certain items within the interface warrant further discussion, requiring a deeper understanding of the basics, before we venture beyond the default settings. This includes topics such as VM configuration options and the setup and configuration of Hyper-V Replica.

We’ll start this chapter by discussing Hyper-V Manager. Additionally, we’ll be talking about configuring Hyper-V host settings—items that affect the way that the host functions and have an impact on the production workloads running on the host. Finally, you’ll learn how to connect to a VM, which you’ll be doing a lot, once you start working with Hyper-V. Let’s get started. You may not have a VM to connect to yet, but understanding the process ahead of time will help ensure that you don’t feel lost once we get to the next chapter and walk through creating a VM.

What Is Hyper-V Manager?

Hyper-V Manager is a Microsoft Management Console (MMC) snap-in that provides basic administrative capabilities for managing one or more stand-alone instances of Hyper-V. One of the most common things that new Hyper-V admins struggle with is the management ecosystem. It’s not because it’s a bad ecosystem, but that it’s different from competing platforms, such as VMware, in the sense that there are potentially five different management interfaces available, depending on the size of the environment being managed. We’ll briefly discuss each one and show you when each management utility comes into play.

Hyper-V Manager

This is primarily designed to manage stand-alone hosts or multiple hosts that are not clustered. It’s the entry-level Hyper-V management tool with which all beginners should start. We’ll be using Hyper-V Manager for the next several chapters. This utility can be launched from Administrative Tools in the Windows Control Panel.

Failover Cluster Manager

Failover Cluster Manager is similar in feel to Hyper-V Manager (as it’s also an MMC) but offers more capabilities. It’s designed to manage small clustered Hyper-V environments. If you have a clustered environment, this should be your default management tool for Hyper-V. This often confuses people, but instead of reinventing the wheel, Microsoft was able to leverage some of the already existing clustering technologies provided by this Windows Server role. This utility can be launched from Administrative Tools in the Windows Control Panel.

System Center Virtual Machine Manager

We’ll cover this topic toward the end of the book. System Center Virtual Machine Manager (or SCVMM, for short) could easily have its own book. SCVMM is designed to manage the largest of Hyper-V deployments. It’s probable that only large enterprise environments will see this in use, but it provides some of the more amazing Hyper-V feature sets, such as Network Virtualization and Service Templates. SCVMM requires a separate installation and appears in the Start Menu under SCVMM.

PowerShell

PowerShell isn’t specifically a Hyper-V utility. It’s Microsoft’s automation engine and scripting language that is available on all Windows editions. PowerShell can be utilized, for instance, when you have to perform a task many times. You can deploy a script across several machines at once. Throughout this book, keep an eye out for useful PowerShell cmdlets and code snippets to experiment with as you learn. PowerShell can be launched from the Start Menu.

Windows PowerShell v5.1 is installed on Windows Server 2019 and Windows Server 2016. PowerShell v6.x is the cross-platform, open source version of PowerShell and is where future development will occur. The Hyper-V module is designed for Windows PowerShell v5.1 but appears to run in PowerShell v6.x. Other modules, such as Active Directory, won’t run in PowerShell v6.x at this time. We recommend that you use PowerShell v5.1 to provide access to the maximum functionality. If you need to access Linux VMs, then PowerShell v6.x will have to be used.

Windows Server 2016 introduced PowerShell Direct. This is a method of providing remote access to VMs from the Hyper-V host. PowerShell Direct isn’t dependent on networking connectivity to access the VM, because it uses the VMBus. There are a number of requirements for PowerShell Direct, including the following:
  • PowerShell v5.1 or later versions

  • Hyper-V host is Windows 10 or Windows Server 2016 or later

  • Virtual Machine is Windows 10 or Windows Server 2016 or later

You create a PowerShell remoting session using the -VMname parameter, rather than -ComputerName; otherwise, accessing the VM through PowerShell Direct is the same as a standard PowerShell remoting session. The folder containing the PowerShell executable must be included in the PATH environment variable of the VM, for PowerShell Direct to work.

Windows Admin Center

Windows Admin Center (WAC, previously known as Project Honolulu) is the new kid on the block when it comes to management tools for Hyper-V. WAC is a web-based tool that is designed to manage hyperconverged infrastructure (HCI) in the emerging cloud era. It’s designed to manage hosts, VMs, storage, and more. Microsoft has even made WAC extensible, so that third-party vendors can write add-ons for it. You may be wondering, if it’s so great, why isn’t it the main tool we’ll be using. In short, it’s still early days for WAC. It will be developed independently from the long-running MMC tool set. We bring it up here, so you’ll be aware of it, as you may see mention of it later in this book.

WAC uses PowerShell remoting and WMI to manage the remote servers. The latest iterations of WAC can show the PowerShell code that is being used to perform the management tasks. This can be useful if you’re trying to learn how to manage Hyper-V, VMs, and Windows servers in general, through PowerShell.

Connecting to Hyper-V Hosts

Before you can manage your Hyper-V environment, you must first connect to the system with the Hyper-V role installed. On the client machine, you must have the Remote Server Administration Toolkit (RSAT) tools of the same or newer version installed, in order to connect to the intended Hyper-V Host.

Note

Each version of the RSAT tools is a separate download. An Internet search is the quickest way to locate them. The RSAT tools are only available in a limited number of languages, and the culture of your client machine must match the language of the RSAT tools you’re trying to use.

For example, connecting to a Windows Server 2012 R2 Hyper-V host with the Windows 7 era RSAT tools wouldn’t work, but connecting to a Windows Server 2012 R2 Hyper-V host with Windows 10 era RSAT tools would be viable. Let’s connect to a host now.
  1. 1.

    Launch Hyper-V Manager from Administrative Tools on the host itself or a management workstation.

     
  2. 2.

    Right-click the root of the tree in the left-hand pane and select Connect to server.

     
  3. 3.

    Fill out the select computer form, as seen in Figure 2-1, and click OK.

     
  4. 4.

    Verify that the target host now shows in the left-hand pane under the root and is selectable.

     
../images/470351_1_En_2_Chapter/470351_1_En_2_Fig1_HTML.jpg
Figure 2-1

Hyper-V Host connection dialog

TRY IT YOURSELF

Following the instructions in this section, connect to your Hyper-V host from your client machine.

Adding hosts into the management utility is quite simple. Hyper-V Manager is a typical MMC snap-in, so you can add multiple targets into the left-hand tree as well. So, if you have multiple independent, stand-alone Hyper-V hosts in your environment, you can manage them all centrally from one instance of Hyper-V Manager. There is no need to connect to each host one at a time, which is an excellent time-saver.

Note

You’ll need the correct security permissions to connect to any Hyper-V host. Any member of the domain administrators group will have the needed rights to connect to the target machine. Also, any user in the local Hyper-V administrators group on the target machine will have the correct rights to connect to that machine. You should make users members of the relevant Hyper-V administrators group on each host, rather than adding them to the domain administrators group. Create a group for Hyper-V administrators in your AD domain and add that group to the Hyper-V administrators group on each host, rather than managing each host individually.

MORE TO LEARN

There may be times when you may have to connect to a Hyper-V host that is located in a work group or a different domain. The default connection dialog expects that the machine running the RSAT tools is a member of the same AD domain as the Hyper-V hosts. The “Connect as another user” check box will allow Windows 8, Windows 10, and newer versions of the RSAT tools to specify alternate credentials when connecting to Hyper-V hosts. The remote management and WinRM configuration must be completed on the client and the target host also, prior to attempting a connection through Hyper-V Manager. This topic is outside the scope of this book, but if you want to learn about how to configure off-domain remote management, a great how-to can be found at https://technet.microsoft.com/en-us/library/jj647785(v=ws.11).aspx .

Navigating the Hyper-V Manager UI

Now that you’ve successfully connected to a Hyper-V host, basic management tasks can be completed. If the host you’ve connected to has some existing VMs, it may look like that in Figure 2-2. If it doesn’t, don’t worry, you’ll be learning how to create a new VM in the next chapter.
../images/470351_1_En_2_Chapter/470351_1_En_2_Fig2_HTML.png
Figure 2-2

Hyper-V Manager

In Hyper-V Manager, as shown in Figure 2-2, hosts are listed on the left. VMs, their status, and any associated checkpoints (which we’ll get into later) are listed in the center column, and actions associated with the selected object are listed in the right-hand column.

The Hyper-V host in Figure 2-2 contains a number of running VMs. If you select one of them and review the details section near the bottom, you can see basic information and monitoring data for the VM. For example, in Figure 2-2, the VM ANDO-JN-UT01 is highlighted, and the summary tab has been selected. This tab gives us basic information about the VM, such as generation, version, and clustering status. The other tabs provide information about memory, networking, and replication settings, such as in Figure 2-3, which displays the memory summary for the VM ANDO-UB01.
../images/470351_1_En_2_Chapter/470351_1_En_2_Fig3_HTML.jpg
Figure 2-3

Hyper-V Manager VM details pane Memory tab

This all adds up to be a very important single-pane-of-glass view of your virtual infrastructure. It’s important to know how this utility looks and feels, because when you start managing Hyper-V, this is ground zero for troubleshooting and optimization. Hyper-V Manager will give you the most clear-cut and simplified access to running VMs in the event all other methods fail. Remember this especially when you need to troubleshoot connectivity issues for a VM. Let’s move on to configuring Hyper-V host settings.

Configuring Hyper-V Host Settings

When you first set up a new Hyper-V host, there are a number of items that should be configured before you start building VMs. It may also be necessary to modify some of these host settings in the future, if changes occur within your infrastructure. As an example, let’s examine some of the basic settings.
  1. 1.

    Open Hyper-V Manager. Select the Hyper-V host in the left pane and click Hyper-V settings in the action pane. You’ll see the dialog shown in Figure 2-4.

     
  2. 2.

    Make sure the Virtual Hard Disks section is selected on the left pane and select a location to store your virtual hard disks. You can pick a location or leave it as it is.

     
  3. 3.

    Select Virtual Machines in the left-hand pane and a location to store other VM related files. You can pick a location or leave it as it is.

     
  4. 4.

    Select the Live migration section and make sure that the maximum configured live migrations is 1. (For the purposes of a lab, no more is needed at this time.)

     
  5. 5.

    Click OK to close the window.

     
../images/470351_1_En_2_Chapter/470351_1_En_2_Fig4_HTML.jpg
Figure 2-4

Hyper-V settings dialog

TRY IT YOURSELF

Connect to a Hyper-V host using Hyper-V Manager and examine host configuration. Make any changes that are required and detailed in this section.

Thus far, you’ve configured the storage location for your VMs and modified the live migration settings. There are many more options that can be configured in the UI. We’ll briefly cover each item, and you can make further configuration changes in your lab, as needed. Please keep in mind that this is just a preview of most of the features mentioned. We will be covering each item in more detail as the book progresses.

Virtual Hard Disks

Each VM has a virtualized disk drive in which to store files and the VM’s operating system (OS). This information is stored in one of two formats. The older file format is VHD, primarily used by Windows Server 2008 R2 and older instances of Hyper-V. Newer Hyper-V versions use the VHDX variant by default, which provides enhanced features and added reliability. It is highly recommended that VHDX files be utilized whenever possible. In this section of the Hyper-V settings dialog, you can define the default storage location for virtual disk drives.

Virtual Machines

This submenu controls the placement of VM components other than the virtual disks. The most important of these is the VM config file. It’s the underlying file that Hyper-V references to keep track of a VM’s configuration. It’s quite common to see different locations for the VM and the virtual disks, as the VHDs and VHDXs can become quite large and may have to reside on their own volume or some kind of shared storage, as you’ll see later.

Physical GPUs

This section is mainly intended for use in virtual desktop infrastructure (VDI) scenarios. There are times when increased graphical performance provided by in-host graphics processing units (GPUs) and the Microsoft RemoteFX display protocol is required. This is where you configure this feature.

NUMA Spanning

Non-uniform memory access (NUMA) provides VMs more efficient access to the physical memory of the host system. This gives better performance in most cases. There are a few configurations for which it is not needed, and it’s desirable to disable this setting on the host. It’s best to leave NUMA enabled at the host level and then enable or disable it on each individual VM. NUMA can be useful for workloads such as SharePoint or Exchange that actively support NUMA. If you are unsure if a particular workload is NUMA-capable, check with the software vendor.

Live Migrations

Live migration is a technology that enables you to move a VM from one physical Hyper-V host to another, without any downtime. In this section, the administrator can configure default behavior for live VM migrations to and from this specific host. This includes specifying a particular IP and associated network interface for migrations. Additional enhanced features control the type of authentication used between migration source and destination, as well as the transmission behavior.

Storage Migrations

This setting allows the administrator to define the number of simultaneous storage migrations that can occur. This setting is usually best left at the default of two, unless you know your infrastructure can handle more. Most small environments will leave this at the default.

Enhanced Session Mode Policy

This setting controls the administrator’s experience with the console when managing VMs. Enhanced Session Mode is disabled by default. When enabled, it provides features such as clipboard functionality from host to guest and local drive redirection, which can make it easier to move files to new VMs in high-security environments. This must be enabled at the individual VM level as well.

Replication Configuration

Hyper-V has disaster recovery and replication built right into the product. Hyper-V replica enables replication of VMs between two or more host systems. We will be covering this in future chapters.

The sections listed under User (see Figure 2-4) are the controls for working within the console window of a particular VM, including how the keyboard functions and which key combination will release the mouse from a VM console window. Most of the defaults should be sufficient for most users.

Configuring Hyper-V Host Settings with PowerShell

It is also possible to configure host settings using Windows PowerShell, which is most useful when you have to automate a large number of changes to multiple hosts.

Let’s take a look at how this can be done.
  1. 1.

    On your Hyper-V host, right-click the PowerShell icon and click Run as Administrator.

     
  2. 2.

    Run the command Update-Help

    and wait for the command to complete. This only has to be done once, after the OS has been installed. You can run it periodically, if desired, to download any changes to the help information.

     
  3. 3.

    Run the command Get-Help Set-VMHost –online

    and review the online documentation. Viewing the help online is the preferred option, as the online help is updated more frequently than the downloadable help files.

     
  4. 4.
    Run the command
    Set-VMHost –MaximumVirtualMachineMigrations 3 –MaximumStorageMigrations 1
    .
     
  5. 5.

    Open Hyper-V Manager and select the same Hyper-V host you used for steps 1–4.

     
  6. 6.

    In the right-hand action pane, click Hyper-V Settings.

     
  7. 7.

    On the Live Migration and Storage Migration tabs, verify that each value is set as specified previously.

     
  8. 8.

    Change simultaneous live migrations back to 2 and set simultaneous storage migrations to 1.

     
  9. 9.

    Click OK to exit Hyper-V Settings.

     

TRY IT YOURSELF

Use PowerShell to view and modify the settings of your Hyper-V host.

Now that you understand the basics of connecting to a Hyper-V host and managing host settings, you’re ready to move on to the next chapter and begin creating VMs. Prior to doing that, complete the following hands-on lab.

Lab Work

Complete any outstanding Try It Yourself sections and then
  1. 1.

    Using Hyper-V Manager, determine the memory demand for a running VM.

     
  2. 2.

    Using Hyper-V Manager, take note of the existing virtual hard disks storage path in Hyper-V Settings. Modify the path to point to a different location.

     
  3. 3.

    Using only Get-Help and the Set-VMHost cmdlets in PowerShell, determine the correct syntax to change the path for virtual hard-disk storage back to the original location.

     
  4. 4.

    Once completed, verify that the path is correct in Hyper-V Settings.

     
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.30.253