NOTE: This book has been updated for R2. You can buy it here from our official distributor, Pearson, or wherever books are sold.
We’re happy to announce that the latest edition of our new Exam Ref series, Exam Ref 70-410: Installing and Configuring Windows Server 2012 (ISBN 9780735673168) by Craig Zacker, is available for purchase. Use this book as an aid in your studies to take the Microsoft Exam 70-410.
The contents and information about the book are on this previous blog post.
Chapter 3 Configure Hyper-V (excerpt)
The concept of virtualizing servers has, in the past several years, grown from a novel experiment to a convenient lab and testing tool to a legitimate deployment strategy for production servers. Windows Server 2012 includes the Hyper-V role, which enables administrators to create virtual machines (VMs), each of which runs in its own isolated environment. VMs are self-contained units that administrators can easily move from one physical computer to another, greatly simplifying the process of deploying network applications and services.
This chapter covers some of the fundamental tasks that administrators perform to create and deploy Hyper-V servers and VMs.
Objectives in this chapter:
■ Objective 3.1: Create and configure virtual machine settings
■ Objective 3.2: Create and configure virtual machine storage
■ Objective 3.3: Create and configure virtual networks
Objective 3.1: Create and configure virtual machine settings
Server virtualization in Windows Server 2012 is based on a module called a hypervisor.
Sometimes called a virtual machine monitor (VMM), the hypervisor is responsible for
abstracting the computer’s physical hardware and creating multiple virtualized hardware
environments, called VMs. Each VM has its own (virtual) hardware configuration and can
run a separate copy of an operating system (OS). Therefore, with sufficient physical hardware
and the correct licensing, a single computer running Windows Server 2012 with the
Hyper-V role installed can support multiple VMs, which administrators can manage as if
they were standalone computers.
Virtualization products can use several different architectures to share a computer’s hardware resources among VMs. The earlier type of virtualization products, including Microsoft Windows Virtual PC and Microsoft Virtual Server, requires a standard OS installed on a computer. This becomes the “host” OS. Then you install the virtualization product, which adds the hypervisor component. The hypervisor essentially runs alongside the host OS, as shown in Figure 3-1, and enables you to create as many VMs as the computer has hardware to support.
This arrangement, in which the hypervisor runs on top of a host OS, is called Type II virtualization. By using the Type II hypervisor, you create a virtual hardware environment for each VM. You can specify how much memory to allocate to each VM, create virtual disk drives by using space on the computer’s physical drives, and provide access to peripheral devices. You then install a “guest” OS on each VM, just as if you were deploying a new computer. The host OS then shares access to the computer’s processor with the hypervisor, with each taking the clock cycles it needs and passing control of the processor back to the other.
Type II virtualization can provide adequate VM performance, particularly in classroom and laboratory environments, but it does not provide performance equivalent to separate physical computers. Therefore, it is not generally recommended for high-traffic servers in production environments.
The virtualization capability built into Windows Server 2012, called Hyper-V, uses a different type of architecture. Hyper-V uses Type I virtualization, in which the hypervisor is an abstraction layer that interacts directly with the computer’s physical hardware—that is, without an intervening host OS. The term hypervisor is intended to represent the level beyond the term supervisor, in regard to responsibility for allocating a computer’s processor clock cycles.
The hypervisor creates individual environments called partitions, each of which has its own OS installed and accesses the computer’s hardware via the hypervisor. Unlike Type II virtualization, no host OS shares processor time with the hypervisor. Instead, the hypervisor designates the first partition it creates as the parent partition and all subsequent partitions as child partitions, as shown in Figure 3-2.
The parent partition accesses the system hardware through the hypervisor, just as the child partitions do. The only difference is that the parent runs the virtualization stack, which creates and manages the child partitions. The parent partition is also responsible for the subsystems that directly affect the performance of the computer’s physical hardware, such as Plug and Play, power management, and error handling. These subsystems also run in the OSs on the child partitions, but they address only virtual hardware, whereas the parent, or root, partition handles the actual hardware.
Windows Server 2012 includes the Hyper-V role only in the Standard and Datacenter editions. The Hyper-V role is required for the OS to function as a computer’s primary partition, enabling it to host other VMs. No special software is required for an OS to function as a guest OS in a VM. Therefore, although Windows Server 2012 Essentials does not include the Hyper-V role, it can function as a guest OS. Other guest OSs supported by Hyper-V include the current Windows workstation OSs and many other non-Microsoft server and workstation products.
As far as Hyper-V is concerned, the primary difference between the Standard and Datacenter
editions of Windows Server 2012 is the number of VMs they support. When you install a
Windows Server 2012 instance on a VM, you must have a license for it, just like when you
install it on a physical machine. Purchasing the Datacenter edition licenses you to create an
unlimited number of VMs running Windows Server 2012 on that one physical machine. The
Standard license provides only two virtual instances of Windows Server 2012.
Hyper-V hardware limitations
The Windows Server 2012 version of Hyper-V contains massive improvements in the scalability
of the system over previous versions. A Windows Server 2012 Hyper-V host system can
have up to 320 logical processors, supporting up to 2,048 virtual CPUs and up to 4 terabytes
(TB) of physical memory.
One server can host as many as 1,024 active VMs, and each VM can have up to 64 virtual
CPUs and up to 1 TB of memory.
Hyper-V can also support clusters with up to 64 nodes and 8,000 VMs.
In addition to the Hyper-V implementation in Windows Server 2012, Microsoft provides a
dedicated Hyper-V Server product, which is a subset of Windows Server 2012. Hyper-V Server
includes the Hyper-V role, which it installs by default during the OS installation. With the
exception of some limited File and Storage Services and Remote Desktop capabilities, the OS
includes no other roles, as shown in Figure 3-3.
The Hyper-V Server is also limited to the Server Core interface, although it includes a simple, script-based configuration interface, as shown in Figure 3-4. You can manage Hyper-V Server remotely by using Server Manager and Hyper-V Manager, just as you would any other Server Core installation.
Unlike Windows Server 2012, Hyper-V Server is a free product, available for download from Microsoft’s website. However, Hyper-V Server does not include any licenses for virtual instances. You must obtain and license all the OSs you install on the VMs you create.
Once you have the appropriate hardware and the required licenses, you can add the Hyper-V role to Windows Server 2012 by using Server Manager, just as you would any other role.
Adding the Hyper-V role installs the hypervisor software, and, in the case of a full GUI installation, also installs the management tools. The primary tool for creating and managing VMs and their components on Hyper-V servers is the Hyper-V Manager console. Hyper-V Manager provides administrators with a list of all the VMs on Windows Server 2012 systems and enables administrators to configure the environments of both the servers and the individual VMs. There is also a set of Hyper-V cmdlets for Windows PowerShell that enables you to exercise complete control over VMs using that interface.
Microsoft recommends that you do not install other roles with Hyper-V. It is better to implement any other roles that you need the physical computer to perform within one of the VMs you create by using Hyper-V. In addition, you might want to consider installing Hyper-V on a computer by using the Server Core installation option. This will minimize the overhead expended on the partition. As with other roles, installing Hyper-V on Server Core excludes the management tools, which you must install separately as a feature on another computer.
Before you can install the Hyper-V role on a server running Windows Server 2012, you must have appropriate hardware, as follows:
■ 64-bit processor that includes hardware-assisted virtualization. This is available in processors that include a virtualization option, such as Intel Virtualization Technology (Intel VT) and AMD Virtualization (AMD-V) technology.
■ A system BIOS that supports the virtualization hardware, on which the virtualization feature has been enabled.
■ Hardware-enforced Data Execution Prevention (DEP), which Intel describes as eXecuted Disable (XD) and AMD describes as No eXecute (NS). This is a technology used in CPUs to segregate areas of memory for either storage of processor instructions or for storage. Specifically, you must enable the Intel XD bit (execute disable bit) or the AMD NX bit (no execute bit).
To install the Hyper-V role, use the following procedure.
1. Log on to the server running Windows Server 2012 using an account with administrative privileges. The Server Manager window opens.
2. From the Manage menu, select Add Roles And Features. The Add Roles and Features Wizard starts, displaying the Before You Begin page.
3. Click Next to open the Select Installation Type page.
4. Leave the Role-Based Or Feature-Based Installation option selected and click Next. The Select Destination Server page opens.
5. Select the server on which you want to install Hyper-V and click Next. The Select Server Roles page opens.
6. Select the Hyper-V role. The Add Features That Are Required for Hyper-V dialog box appears.
7. Click Add Features to accept the dependencies, and then click Next to open the Select Features page.
8. Click Next to open the Hyper-V page.
9. Click Next. The Create Virtual Switches page opens, as shown in Figure 3-5.
10. Select the appropriate check box for a network adapter and click Next. The Virtual Machine Migration page opens, as shown in Figure 3-6.
11. Click Next to open the Default Stores page.
12. Specify alternatives to the default locations for virtual hard disk (VHD) and VM configuration files, if desired, and click Next. The Confirm Installation Selection page opens.
13. Click Install to move to the Installation Progress page as the wizard installs the role.
14. Click Close to close the wizard.
15. Restart the server.
Installing the role modifies the Windows Server 2012 startup procedure so that the newly installed hypervisor is able to address the system hardware directly and then load the OS as the primary partition on top of that.