Microsoft Hyper-V

From Bauman National Library
This page was last modified on 24 December 2016, at 15:09.
Hyper-V
A component of Microsoft Windows Server
Details
Type Hypervisor
Included with
  • Microsoft Windows Vista and later
  • Select editions of Microsoft Windows 8 and later
Replaces Windows Virtual PC
Related components
App-V, MED-V, Remote Desktop Connection

Microsoft Hyper-V (кодовое имя Viridian), — hardware virtualization system the x64-based systems on the basis of a hypervisor. The beta version of Hyper-V was included in the x64-version of Windows Server 2008, and the final version (automatically through Windows Update) was released on June 26, 2008. Previously known as virtualization Windows Server (Windows Server Virtualization). [1]

Role description and technology

Hyper-V role enables you to create a virtualized computing environment by using virtualization technology that is built into Windows Server, and manage it. When installing the Hyper-V role installs the required components, as well as optional controls. The number of required components include low-level Windows shell, Hyper-V Virtual Machine Management Service, a provider of virtualization and virtualization WMI components such as bus VMBus, a provider of virtualization service (VSP) and virtual infrastructure driver (VID).

Средства управления для роли Hyper-V:

  1. Tools based on the graphical user interface: Manager Hyper-V, Microsoft Management Console (MMC), and Virtual Machine Connection, which provides access to the video output of the virtual machine, so the user can interact with the virtual machine.
  2. Dedicated Hyper-V cmdlets for Windows Server 2012 PowerShell.Windows includes Hyper-V module, which provides command line access to all the features available in the graphical user interface, as well as to the functions that are not available through the graphical user interface.

If you install Hyper-V role using Server Manager, the controls will be included, unless you exclude them explicitly. If you install Hyper-V role uses Windows PowerShell, the default controls are not included.


Hyper-V technology virtualizes the hardware, creating an environment in which one physical machine can simultaneously run multiple operating systems. Hyper-V allows you to create virtual machines and manage their resources. Each virtual machine is an isolated virtualized computer system, which runs its own operating system. The operating system running on a virtual machine, called the operating system on a virtual machine.[2].

Architecture

Hyper-V architecture

As can be seen from the figure, the hypervisor runs on the next level after the iron - which is typical for the kind of hypervisors 1. The level above the hypervisor working parent and child partitions. Partitions in this case - it is the area of ​​the insulation, in which operating systems work. Do not confuse them, for example, with partitions on the hard drive. The parent partition runs the host OS (Windows Server 2008 R2), and virtualization stack. The same is happening in the parent partition control of external devices, as well as child partitions. Subsidiaries same partition as easy to guess - are created in the parent partition and intended to run guest operating systems. All partitions are associated with the hypervisor through hypercall interface that provides operating systems a special API.[3]

Parent partition

The parent partition is created immediately when you install Hyper-V system role. Assigning parent partition as follows: Create, delete, and manage partitions subsidiaries, including remotely, through WMI-provider. Control access to hardware devices, except for the allocation of processor time and memory - is engaged in the hypervisor.

Power and handling hardware errors, if any.
Parent partition components of Hyper-V
[3]

Virtualization stack

The following components are running in the parent partition, collectively referred to as the stack virtualization:

  • Virtual Machine Management Service (VMMS)
  • Workflows virtual machines (VMWP)
  • Virtual Device
  • Virtual Infrastructure Driver (VID)
  • Interface Library hypervisor

In addition, another two components work in the parent partition. This virtualization services providers (VSP) and the tire virtual machines (VMBus). Virtual Machine Management Service The problem of virtual machine management service (VMMS) includes:

  • Management of the state of the virtual machines (on / off)
  • Adding / removing virtual devices
  • Manage Snapshots

When you start VMMS virtual machine creates a new virtual machine workflow. Read more about the workflows will be described hereinafter. So exactly VMMS determines what operations are allowed to perform with the virtual machine at the moment: for example, if the snapshot deletion occurs, then use the snapshot for the delete operation, it will not. For more information about working with snapshots (snapshots) of virtual machines can be found in the corresponding my article. [3] If we talk in more detail - that VMMS manages the following state of the virtual machine:

  • Starting
  • Active
  • Not Active
  • Taking Snapshot
  • Applying Snapshot
  • Deleting Snapshot
  • Merging Disk

Workflow of virtual machine (VMWP)

To manage virtual machines from the parent partition starts' special process' '- the working process of the virtual machine (VMWP). This process operates at the user level. For each service VMMS running virtual machine starts a separate workflow. This allows you to isolate virtual machines from each other. To increase security, workflows run under the built-in user account Network Service. VMWP process is used to manage the respective virtual machine.

Its tasks include:

  • Creation, configuration and start the virtual machine
  • Pause and continue operation (Pause / Resume)
  • Saving and restoring state (Save / Restore State)
  • Create a snapshot

Moreover, it emulates a virtual workflow motherboard (VMB), which is used for storage of the guest OS, interrupt control and virtual devices.

Virtual devices

Virtual devices (VDevs) - are software modules that implement the configuration and device management for virtual machines. VMB includes a basic set of virtual devices, which includes the PCI bus and system devices that are identical to the chipset Intel 440BX. There are two types of virtual devices:

  • Emulated devices - emulates certain hardware devices, such as, for example, as a video adapter VESA. Emulated a lot of, for example: BIOS, DMA, APIC, ISA and PCI bus, interrupt controllers, timers, power management, controllers, serial ports, speaker system, the controller PS / 2 keyboard and mouse, emulated (Legacy) Ethernet-adapter ( DEC / Intel 21140), FDD, IDE-controller and a video adapter VESA / VGA. That is why only the guest OS virtual IDE-controller can be used instead of SCSI, which is a synthetic product.
  • Synthetic devices - not really emulate naturally occurring piece of iron. Examples are the synthetic video adapter, device interaction with the person (HID), AC adapter, SCSI-controller, interrupt controller and synthetic storage controller. Synthetic devices can be used only when installing integration components in the guest OS. Synthetic devices to access the server hardware devices through a virtualization providers of services running in the parent partition. Title goes through the VMBus virtual bus, which is much faster than emulation of physical devices.[3]

Virtual Infrastructure Driver (VID)

Driver virtual infrastructure (vid.sys) works at the kernel level and manages the partitions, virtual processors and memory. Also, this driver is an intermediary between the hypervisor and the components of the user-level virtualization stack.[3]

Hypervisor Interface Library

Hypervisor Interface Library (WinHv.sys) - a DLL kernel level, which is loaded in both the host and the guest OS, subject to adjustment of the integration component. This library provides hypercall interface used to communicate the operating system and the hypervisor.[3]

Virtualization services providers (VSP)

Providers virtualization services run in the parent partition and provide the guest operating system access to hardware devices using client virtualization services (VSC). The connection between the VSC and VSP through virtual bus VMBus.

Tire virtual machines (VMBus)

Appointment VMBus is to provide high-speed access between parent and child partition, while the other methods of access is much slower due to high overhead emulation devices. If the guest OS does not support the integration component - we have to use the emulation device. This means that the hypervisor has to intercept calls to the guest OS, and redirect them to the emulated devices that remind workers emulated virtual machine process. Because the workflow runs in user space, the use of emulated devices leads to a significant decrease in performance compared to using VMBus. It is therefore recommended to install the integration components immediately after installing the guest OS. As already mentioned, using VMBus interaction between the host and guest operating system occurs on a client-server model. The parent partition providers of virtualization services run (VSP), which are part of the server, and in the child partition - the client part - VSC. VSC forwards requests by the guest OS VMBus to VSP in the parent partition, and the VSP redirects the request to the device driver. This interaction process is completely transparent to the guest OS.[3]

Child partitions

Child partitions

Back to our drawing with Hyper-V architecture, only slightly reduce it, because we are only interested in child partitions. Thus, in the child partition can be mounted:

  • OS Windows, integrated with defined components (in our case - Microsoft Windows 7)
  • OS is not of Windows, but it supports the integration of the components (Red Hat Enterprise Linux in this case)
  • OS that do not support integration components (eg, FreeBSD).

In all three cases, a set of components in the child partition is slightly different.

Nestes virtualization Hyper-V

Nested virtualization architecture

With the assembly of Windows Server 2016 Technical Preview 4 (TP4) Hyper-V now supports nested virtualization opportunity. It can be seen that it is necessary are forwarding flag associated with virtualization to the guest OS. That is, in general, we need to tell the hypervisor on the first level, it is necessary to enable virtualization in the shared processor for the virtual machine. To do this, run the script that modifies some of the properties of the virtual machine. One of the main properties that change script the behavior of the virtual machine processor. [2].

Set-VMProcessor -VMName $vmName -ExposeVirtualizationExtensions $true


CoreInfo.png

The table shows that the virtual machine "understands" that runs from under the hypervisor. But before you run the script flag associated with virtualization is not passed. Then worked a script that changed the properties of our virtual machine and its processor and the flag associated with virtualization, it appeared. Below we have included Hyper-V role, then there was a thin layer of virtualization and our operating system moved into your root partition, the virtualization flag disappeared. Also pay attention to the value of the Microprocessor signature, which in our case was FFFFFFFF, which indicates that the processor virtualization.[2].


Adding a role in Hyper-V в Microsoft Windows Server 2016

Setup consists of 2 stages to be performed sequentially.

  • First, go to "Settings" Microsoft Windows Server 2016 virtual machine, then go to the tab "System", where we are interested in "Acceleration". paravirtualization interface must be set to "Hyper-V", and the hardware virtualization must support "VT-x / AMD-V".
  • Entering the environment Microsoft Windows Server 2016, we need to open the Windows PowerShell ISE. After opening the series introduces a number of instructions presented in the listing below. Each statement must be entered as accurately as possible, otherwise the system will not recognize it.
  1. Firstly:
    Enable-WindowsOptionalFeature –Online -FeatureName Microsoft-Hyper-V –All -NoRestart
  2. Next:
    Install-WindowsFeature RSAT-Hyper-V-Tools -IncludeAllSubFeature
  3. Next:
    Install-WindowsFeature RSAT-Clustering -IncludeAllSubFeature
  4. Next:
    Install-WindowsFeature Multipath-IO
  5. Finally, restart:
    Restart-Computer

Scope nested virtual machines

  • Virtual test lab, where deployed Hyper-V virtual servers and built model of virtual infrastructures within a single physical computer.
  • The use of containerized applications (for example, on the engine Docker) in virtual machines on Hyper-V virtual hosts.

Setting an nested virtualization

To nested virtualization to work, you need to:

  • Use Windows 10 Build 10565. Windows Server 2016 Technical Preview 3 (TPv3) and Windows 10 GA - will not work, because they Nested Virtualization is not possible.
  • Enable Mac Spoofing on Hyper-V virtual network adapter host, as a virtual switch a host Hyper-V will see a couple of MAC-addresses to the virtual adapter.
  • In Windows 10 You need to disable Virtualization Based Security (VBS), which prevents the broadcast of Virtualization Extensions in virtual machines.
  • Provide memory for himself and a guest hypervisor under all running virtual machines[4]
A virtual machine on Hyper-V virtual host

Now, in order to enable the Nested Virtualization, run the following script PowerShell (in it and VBS is turned off and turned on Mac Spoofing):

Invoke-WebRequest https://raw.githubusercontent.com/Microsoft/Virtualization-Documentation/master/hyperv-tools/Nested/Enable-NestedVm.ps1 -OutFile ~/Enable-NestedVm.ps1
~/Enable-NestedVm.ps1 -VmName <VmName>

Next, create a virtual machine on a Windows 10 Build 10565, and turn it into Mac Spoofing (if you have not done it in the script). This can be done through a VM configuration or following PowerShell command:

Set-VMNetworkAdapter -VMName <VMName> -MacAddressSpoofing on

Usage

Hyper-V provides the infrastructure that enables the virtualization of applications and workloads. It helps to carry out various business tasks aimed at improving efficiency and reducing costs, such as the following:

  1. Create or expand a private cloud environment. Hyper-V will go on to work with shared resources or expand their use, as well as to regulate their use in accordance with changing requirements, to provide more flexibility to the individual IT services.
  2. Efficient use of equipment. Focusing servers and workloads onto fewer, more powerful physical computers, you can reduce the consumption of resources such as power and physical space.
  3. Continuous business operations. Hyper-V can help minimize the impact of both planned and unplanned downtime on workloads.
  4. Installation or expansion of virtual desktop infrastructure (VDI). The strategy of centralized desktops using VDI can help quickly execute business objectives and enhance data security and simplify compliance with the mandatory requirements and management of operating systems and applications on the desktop. Deploy Hyper-V and virtualization host Remote Desktop (RD Virtualization Host) on one physical computer to make personal virtual desktops or virtual desktop pools available to users.
  5. Increase the efficiency of development and testing. You can use virtual machines to reproduce the actual computing environments without the need to acquire and maintain all the equipment that would be needed otherwise.[5]

Поддерживаемые операционные системы Windows Server

Клиентские

The operating system on a virtual machine (the client) The maximum number of virtual processors Integration Services Notes
Windows 8.1 32 Embedded
Windows 8 32 Upgrade Integration Services after the operating system on a virtual machine settings
Windows 7 Service Pack 1 (SP1) 4 Upgrade Integration Services after the operating system on a virtual machine settings Releases Ultimate, Enterprise and Professional (32-razrdnye and 64-bit)
Windows 7 4 Upgrade Integration Services after the operating system on a virtual machine settings Releases Ultimate, Enterprise and Professional (32-razrdnye and 64-bit)
Windows Vista Service Pack 2 (SP2) 2 Install Integration Services after the operating system on a virtual machine settings Business, Enterprise and Ultimate, including N and KN editions
Windows XP Service Pack 3 (SP3) 2 Install Integration Services after the operating system on a virtual machine settings Professional
Windows XP x64 Edition with Service Pack 2 (SP2) 2 Install Integration Services after the operating system on a virtual machine settings Professional

Guest

The operating system on a virtual machine (server) The maximum number of virtual processors Integration Services Notes
Windows Server 2012 R2 64 Embedded
Windows Server 2012 64 Embedded
Windows Server 2008 R2 Service Pack 1 (SP1) 64 Install Integration Services after the operating system on a virtual machine settings Issues Datacenter, Enterprise, Standard and Web
Windows Server 2008 R2 with Service Pack 2 (SP2) 4 Install Integration Services after the operating system on a virtual machine settings Issues Datacenter, Enterprise, Standard and Web (32-bit and 64-bit)
Windows Home Server 2011 4 Install Integration Services after the operating system on a virtual machine settings
Windows Small Business Server 2011 Issue Essentials - Issue 2
Standard - 4
Install Integration Services after the operating system on a virtual machine settings Essentials and Standard Editions
Windows Server 2003 R2 with Service Pack 2 (SP2) 2 Install Integration Services after the operating system on a virtual machine settings Standard Editions, Web, and Enterprise (32-bit and 64-bit)
Windows Server 2003 with Service Pack 2 2 Install Integration Services after the operating system on a virtual machine settings Standard Editions, Web, and Enterprise (32-bit and 64-bit)

Limitations

As of December 2008 Hyper-V does not support access to USB-devices or reproduction of sounds in the guest VM. However, the workaround to access the USB-drive in the guest VMs can serve as use Microsoft Remote Desktop Client to open access to host drives for the "guests" through the connection Remote Desktop Connection. Another option - to use a type of USB-over-Network devices with the installation of the drivers in each virtual machine. Also, Hyper-V is very weak in supporting legacy applications for MS-DOS, including games. Unreal mode in the "party" is not supported at all, although it is properly supported in Virtual PC. Hyper-V also supports live migration (starting with Windows Server 2008 R2) guest VMs, where live migration is understood as a support network connections and no interruptions perform services during VM migration. Earlier instead Hyper-V on Server 2008 Enterprise and Datacenter Editions support rapid migration, during which the guest VM is suspended on one host and "wakes up" on another. This operation takes as much time as is required for the transmission of the active memory VM guest on the network from the first to the second host. [1]

Links

  1. Hyper-v Server 2012R2: installation and configuration experience
  2. How I stopped worrying and Love the Hyper-V Server
  3. Installing Hyper-V and virtual machine creation
  4. Configure virtual networks in Hyper-V
  5. Ubuntu in Hyper-V
Installation and configuration
  1. Hyper-v Server 2012R2: installation and configuration experience
  2. How I stopped worrying and Love the Hyper-V Server
  3. Installing Hyper-V and virtual machine creation
  4. Configure virtual networks in Hyper-V
  5. Ubuntu in Hyper-V
Interesting
  1. Microsoft Hyper-V 3.0: new features
  2. 15 Hyper-V security principles
  3. network virtualization in Hyper-V. Concept
  4. Addressing the lack of CPU hardware virtualization (Hyper-V in VirtualBox)
  5. one-of-the-hyperv-components-is-not? forum = winserverhyperv When one of the components of the Hyper-V does not work
  6. Hyper-V on Windows: guide to creating and configuring virtual machines

Sources

  1. 1.0 1.1 Hyper-V on wikipedia https://en.wikipedia.org/wiki/Hyper-V
  2. 2.0 2.1 2.2 Hyper-V architecture https://habrahabr.ru/company/microsoft/blog/273791/
  3. 3.0 3.1 3.2 3.3 3.4 3.5 3.6 Hyper-V architecture (2) https://habrahabr.ru/post/98580
  4. Microsoft Hyper-V Nested virtualization http://www.vmgu.ru/search/Virtualization
  5. Microsoft Hyper-V review https://msdn.microsoft.com/ru-ru/library/hh831531(v=ws.11).aspx