Hyper V - Paiet/Tech-Journal-for-Everything GitHub Wiki
Hyper-V
Objectives Covered
- Determine hardware and compatibility requirements for installing Hyper-V
- install Hyper-V
- install management tools
What is Hyper-V? https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/hyper-v-technology-overview
- Virtualization isn't a new concept in fact, adaptations of virtualization can date back to the late 60's with IBM eventually introducing into the commercial side.
- Virtualization has really come a long way since Virtual PC and Microsoft Virtual Server.
- disk space to create a virtual hard drive
- image file to create a virtual DVD drive.
- virtual network interface adapters and other components, which appear like the real thing in a VM.
- System memory is different, however. There is no substitute for memory, so all Hyper-V can do is take the physical memory installed in the computer and allocate it among the various VMs.
- Windows Server 2016 includes the Hyper-V role only in the Standard and Datacenter editions.
- Microsoft recommends that you do not install other roles with Hyper-V.
- Datacenter=unlimited VM instances Standard= VM instances 2
Determine hardware and compatibility requirements for installing Hyper-V https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/system-requirements-for-hyper-v-on-windows
Deployment Options Hyper-V Server a FREE dedicated Hyper-V Server product, which is a subset of Windows Server 2016. Note: guest OS licencing still required. 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. Limited to a CLI with some options such as SConfig. Can be manged thru Server Manager and Hyper-V Manager. * Integration with Client OSes
Install
- Add Role* To run Hyper-V Manager on a server that does not have the Hyper-V role, you must install the Hyper-V Management Tools feature. These tools are also found in the Remote Server Administration Tools (RSAT package for Windows 8 & 10.s and Features Wizard or PowerShell
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart
- To install just the management tools use
install-windowsfeature -name rsat-hyper-v-tools
- To install just Hyper-V Manager run
install-windowsfeature -name hyper-v-tools
- To install just Hyper-V PowerShell Module run
install-windowsfeature -name hyper-v-powershell
Type II vs Type I
- Type II
- The host OS 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.
- Type I
- Hyper-V is installed as a bare metal hypervisor (Type 1), enabling the Windows Hypervisor to take control of the physical computer and create Parent and Child Partitions. The Hypervisor then guarantees the isolation between the partitions, enforcing policy restrictions for hardware access and monitoring the partitions.It acts as an interface between the hardware and host operating system, communicating requests from each guest OS for memory, CPU, hard disk, network and storage.
- Each partition can have 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.
- The Parent Partition is the virtual management operating system of the Child Partitions and guest operating systems. It is created by the Hypervisor and has ownership of all resources not retained by the Hypervisor. The Parent Partition holds one or more Child Partitions, worker processes and communication interfaces and maps the virtual memory address space to the physical memory address space of the physical server.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.
- 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.
- Adding the Hyper-V role actually converts the installed instance of Windows Server 2012 into the parent partition and causes the system to load the hypervisor before the OS.
- Child Partitions are virtual machines containing the guest operating systems. Child Partitions do not have access to the physical machine.
** What's New?** https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/what-s-new-in-hyper-v-on-windows
Hyper-V Pt 2
Upgrade from existing versions of Hyper-V
- Export Save the vm files such as .vhd and .vhdx to desired location
- Hyper-V Replica Create a copy of a running VM as an offline replica on another host server, including virtual disks.
- Share Nothing Live Migration Move a running VM with no shared storage to another host server in the same domain or a trusted domain. Virtually no downtime is required.
Delegate virtual machine management Local or Domain Admin privilages are required to install the Hyper-V role. Once the role is installed the system creates a local Hyper-V Admins group that can be used to grant specific privilges to users. The specified users can then create, manage and connect ot virtual machines.
- In previous versions od servers Authorization Manager
Azman.msc
to perform certian duties. - This tool was deprecated in 2012R2.
- Microsoft recommends System Center Virtual MachineManager (SCVMM), an additional paid product.
lusrmgr.msc
implement nested virtualization You first must have both a physical machine and virtual macine (host) running Server 2016. The physical processor must be Intel supporting VT-x Extended page tables (EPT) virtualization support. Prior to installing Hyper-V on the virtual machine you must provide the virtual processor access to the VT on the physical computer. set-vmprocessor -vmname SVR01 -exposedvirtualextensions $true
In addition you must make the following changes to the VM functioning as the Hyper-V host
- Disable Dynamic mamory:
set-vmmemory -vmname SRV01 -dynamicmemoryenabled $False
- Configure 2 virtual processors:
set-vmprocessor -vmname SVR01 -count 2
- Turn on MAC spoofing:
set-vmnetworkadapter -vmname SVR01 -name "networkadapter" -macaddressspoofing on