Hyper-v Configuration
Guide
2014
Darshana Jayathilake
Table of Contents
Server Virtualization ... 2
Hyper-V ... 2
Hyper-V Licensing... 2
Install and Configure Hyper-V ... 3
Hyper-v prerequisites ... 3
Lab 01-Install and configure Hyper-V ... 4
Lab 02-Create virtual network/s ... 17
Available settings on virtual network manager ... 19
Virtual Machines on Hyper-V ... 20
Lab 03-Creat virtual machine and install the operating system ... 21
Lab 04-Edit hardware configuration of virtual machine ... 27
Available Virtual processor settings on Hyper-V ... 28
Hyper-v Virtual Machine snapshot ... 29
What is a snapshot ... 29
Hyper-v Disk Types ... 33
Lab 04-Add VHD to virtual machine ... 34
Server Virtualization
Server virtualization is host/installed several virtual machines on a one/more physical server using specially designed software which is called as Hypervisor.
Hyper-V
Hyper-v is a native Hypervisor which is designed by Microsoft for virtualization. We can run several operating systems such as Windows, Linux on top of a Hyper-V platform. Hyper-v 3.0 is the current version of the Hypervisor. Also Hyper-v is one of the server roles in Windows 2008 64bit, Windows 2008R2 and Windows 2012/R2.
Hyper-V Licensing
Hyper-v isa free software on Microsoft product portfolio, but user have to purchase running virtual machines in the Hyper-v server (Microsoft Operating systems and other commercial operating systems). When the user purchasing Widows server operating systems, he will get some free Windows server operating system licenses with it. Table 1.0 summarizes the Hyper-v licensing with MS windows 2008/2008R2/2012
Operating System No of free virtual machines
MS Windows 2008/2008R2 Standard 2
MS Windows 2008/2008R2 Enterprise 4
MS Windows 2008/2008R2 Datacenter Unlimited*1 MS Windows 2012/2012R2 Standard 2
MS windows 2012/2012R2 Datacenter Unlimited*2
Install and Configure Hyper-V
Hyper-v prerequisites
An x64-based processor. Hyper-V is available in MS Windows 2012 R2 Standard/Datacenter or Hyper-v Server 2012 R2 Editions.
Hardware-assisted virtualization. This is available in processors that include a virtualization option— specifically, Intel Virtualization Technology (Intel VT) or AMD Virtualization (AMD-V).
Hardware-enforced Data Execution Prevention (DEP) must be available and be enabled. Specifically, you must enable the Intel XD bit (execute disable bit) or AMD NX bit (no execute bit).
*Using Intel processor identifier utility we can easily find the availability of the above mentioned features.
Lab 01-Install and configure Hyper-V
Task Steps Enable VT/AMD-V or XD/NX bit on the server Power up serverGo to the bios by pressing the relevant key such as F9/F10 Enable required features
Install operating system on the server
Set the boot option on the server (Boot from the DVD) Insert Windows 2012R2 DVD to the DVD ROM
Click on Install now button
*In a windows server core edition there is no windows explorer (No GUI) running, but it takes minimal resource for operate. To configure and maintain the server core edition we can use DOC commands, PowerShell commands or we can connect to the server core edition using GUI enabled server or Windows client (RSAT). Microsoft recommends to run Hyper-V on the server core edition, but in this lab setup up we are installing the OS with GUI. There will be a separate lesson for configuring server core edition. Also, please note that we can change server core addition to GUI edition and vice versa with Server 2012/2012R2.
Create a partition for the operating system. (Minimum 32GB)
Login to the computer using Administrator credentials
Rename the computer
Right click on my computer and select properties and change the host name
*Computer rename also can be done through PowerShell and netdom command. Ex
Powershell
Rename-Computer –NewName SRV01 Netdom command
NetDom RenameComputer %computername% /NewName:srv01
Enable Hyper-V Open server manager
Select “Add roles and Features” and click on next
Click on Next
Click on next
*Virtual network switches creation will be explained in a separate chapter Click on next
From this window user can customize the default location of the virtual hard disks and configuration files. After this configuration all
Lab 02-Create virtual network/s
Task Steps
Create virtual
Switch Open server manager>Open tools>Select “Hyper-V Manager”
Select the server name from the Hyper - V manager>Select Virtual switch manager from actions panel
Give the name for the virtual switch name “VMNETWORK” and click on “Apply” &
Available settings on virtual network manager
Setting Description
External
Creates a connection to a physical network
adapter so that virtual machines can access a
physical network.
The Allow management operating system
to share this network adapter setting
controls whether you can use this physical
network adapter to access to the management
operating system, which is operating system
that runs the Hyper-V role. You can use this
option to isolate the management operating
system for communications between virtual
machines and other computers on a physical
network. However, this also means that you
cannot connect to the management operating
system remotely through this physical
network adapter if this option is cleared.
Internal Provides communications between the
management operating system and virtual machines.
Private
Provides communications between virtual
machines only.
VLANID Administrator can define the specific VLAN ID on
this option.
Enable single-root I/O virtualization (SR-IOV) SR-IOV enables network traffic to bypass the software switch layer of the Hyper-V
virtualization stack. Because the VF is assigned to a child partition, the network traffic flows directly between the VF and child partition. As a result, the I/O overhead in the software emulation layer is diminished and achieves network performance that is nearly the same performance as in
Virtual Machines on Hyper-V
Using Hyper-V as a platform we can create multiple virtual machines on a single physical hardware components (Server/Servers). Hyper-v supports different operating systems which are listed as bellows. Windows XP Windows Vista Windows 7 Windows 8 Windows 8.1 Windows Server 2003, 2003R2 Windows server 2008, 2008R2 Windows server 2012, 2012 R2 CentOS 5.5-5.9 CentOS 6.0-6.4
Red Hat Enterprise Linux 5.5, 5.8, 5.9, 6.0, 6.3, 6.5 Suse Linux Enterprise Server 10, 11
Ubuntu 12.04, 12.10, 13.04, 13.10
Lab 03-Creat virtual machine and install the operating system
Task Steps
Create a virtual machine
Open “Server Manager”>Select “Tools”>Open “Hyper-V Manager”>Select your server
If you click no “Finish”, you will get a new virtual machine with 1 Virtual Processor, 512MB Memory, 127GB Dynamic HDD and one network interface. To create a custom configured virtual, Click on “Next” button.
We can specify the VM name and path
Select “Generation 1” and click on “Next”
Select Virtual network name and click on “Next”
Specify the name for virtual hard disks and assign a capacity. And click on “Next”
To install the operating system, user can use physical DVD/CD media, ISO image or Network based installation (WDS, SCCM)
To power up the virtual machine, users can right click on the virtual machine and click on “Start” or click on click on “Start” button on right hand side.
The user can click on “Connect” button or option and get the virtual machine in a separate window
Lab 04-Edit hardware configuration of virtual machine
Task Steps Add/Remove virtual processors from the virtual machineOpen Hyper-V manager>right click on the virtual machine, which we want to change the settings>Select “Settings”
Select “Processor” from the left side (Available features will be described) and change the number of virtual processors on the virtual machine
Available Virtual processor settings on Hyper-V
Setting Description No of virtual
processors
Using this setting we can assign a no of cores for the virtual machine. Maximum no will be equal to the maximum number of cores on a physical server. (Ex 24 cores, 16 cores)
Virtual Machine Reserve
How much of processing power will be reserved for this virtual machine. Ex
In this example, I have allocated one virtual process and virtual machine reserve 50%. This means the physical server will reserve half of one core in physical server will be always allocated for this virtual machine.
Virtual Machine Limit
As a default setting this will be listed as 100.This is the maximum amount of
processing power that VM can be used. 100 means this virtual machine can use the 100% of the allocated processor resources (1 core)
Relative weight
This setting is used for prioritizing the virtual machine processing. In case of processor demanding with two or more virtual machines, we can configure prioritizing for the virtual machines.
Hyper-v Virtual Machine snapshot
What is a snapshot
Hyper-v snapshot taking process is a capture data, hardware configuration and state of the running virtual machine. Snapshots are mostly used in a test and development environments and snapshots are stored in a .avhd files. Also snapshot/s are cause to reduce the performance of the vm.
Lab 04-Manage snapshot
Task Steps
Create a snapshot
Open Hyper-V manager > Select Hyper-v host > Right click on the virtual machine > Select “CheckPoint”
From the snapshot/checkpoint pane we can see the available checkpoints/snapshots for the virtual machine.
Do some changes on virtual machine(create a folder)
Select “Apply”
Hyper-v Disk Types
VHD & VHDX is the hard disk formats of the Microsoft virtual machines. If the user wants to have more than 2TB size disk file, he should use VHDX file. Otherwise he can continue with the VHD file. Also there are four disk types are available in the Hyper-v
Dynamic Disks
When we are creating dynamic disk, we can mention the maximum capacity. But the actual size will be depend on how much data is being stored on that particular volume.
As an example if we create 200GB dynamic disk but data is using only 50GB of space, which will only consume 50GB from your physical HDD.
Fixed Disks
In fixed disks, space will be allocated the disk space from physical disks at creation time. This is the recommended disk type for the production use.
Differencing Disk
Differencing disks are based on a one parent disk and all the changes are writing to the separate VHD. This is very useful for testing and lab environments. Users can use share the same VHD with os for multiple virtual machines. Also this is not recommend for the production environment.
Lab 04-Add VHD to virtual machine
Add
dynamic/fixed disk to the virtual machine
Right click on the virtual machine> select “Settings”>Select “IDE Controller” >select “Hard Drive”>click on “Add”
*We can select ISCI controller also.If we are adding IDE drive, vm should be in a poweroff mode
Click on “Next”
Select the disk type “Dynamically expanding” or “Fixed size”
Assign maximum capacity for VHD/X
Lab 05-Add differencing disk to the VM
Select “Differencing” disk>click on “Next”
Select the parent disk> Click on “Next”
Export & Import Virtual machines
Hyper-V vm export and import facility helps us to move virtual machine from one hyper-v host to another hyper-v host. Also some times this vms are usefull as a backup.User can export vm/s to external media such as usb drive or network location
Lab06-How to export and import vm
Task Steps
Browse location for export the vm
Hyper-v Replication
Hyper-v replication allows us to replicate virtual machine data to the Hyper-v host in a same site or DR site without having any shared storage. With server 2012 R2 we can configure the replication frequency as well.
Lab07-Replicate virtual machine to Hyper-v host
Task Steps
Replication virtual machine to Hyper-v Host
Open “Hyper-V” Manager on both source and destination Hyper-v host > Select Hyper-v host > “Hyper-V Settings”
Select “Enable this computer as a replica server” check box > Select “User
Kerberos(HTTP):”check box > Select ”Allow replication from any authenticated server”
Click on “Next”
Select “Compress the data that is transmitted over the network” > click on “Next”
Select the frequency for vm replication
Select “Send initial copy over the network” > Select “Start replication
immediately”
Check he re Right click on the vm > Select “Replication”
Failover virtual machine
Shut down the virtual machine > Right click on the virtual machine > Select “Planned Failover”
Select “Start the replica virtual machine after failover” > Click “Failover”. Virtual machine in the destination will be started after triggering this process.
Reverse replication from destination
Open Hyper-v manager connect destination host > Right click on the VM > Select “Replication” > Select “Reverse Repliction”
Select the server > Click on “Next”