2014 Hyper-v Configuration Guide Darshana Jayathilake http://darshana.wordpress.com
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 Lab 05-Add differencing disk to the VM... 38
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 1.0 Hyper-v licensing
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. http://www.intel.com/p/en_us/support/highlights/processors/toolspiu
Lab 01-Install and configure Hyper-V Task Steps Enable Power up server VT/AMD-V or Go to the bios by pressing the relevant key such as F9/F10 XD/NX bit on Enable required features the server 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 next button
Click on Install now button Select Windows Server 2012 R2 Standard Evaluation (Server With a GUI)
*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. Select I accept the license terms check box and click on next
Select custom: Install windows only
Create a partition for the operating system. (Minimum 32GB) Now installing windows to the operating system to the server
Set a password Set up a password as admin@1234 and click on Finish
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 Click on Manage
Select Add roles and Features and click on next Select Role-based or feature-based installation
Select the server name and click on next
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
Select Restart the destination server automatically if required and click on install
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 Select New virtual switch>select External>Click on create virtual switch
Give the name for the virtual switch name VMNETWORK and click on Apply & OK
Available settings on virtual network manager Setting External Description 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 Private VLANID Enable single-root I/O virtualization (SR-IOV) Provides communications between the management operating system and virtual machines. Provides communications between virtual machines only. Administrator can define the specific VLAN ID on this option. 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 nonvirtualized environments.
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 Oracle Linux with Red Hat Compatible kernel
Lab 03-Creat virtual machine and install the operating system Task Steps Create a Open Server Manager >Select Tools >Open Hyper-V Manager >Select your virtual server machine Right click on your server>select New >Select Virtual Machine
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 Assign start up memory as 1024 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 *There is a separate lab for virtual hard disks.
To install the operating system, user can use physical DVD/CD media, ISO image or Network based installation (WDS, SCCM) Click on Finish
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 Open Hyper-V manager>right click on the virtual machine, which we want to change virtual the settings>select Settings processors from the virtual machine 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 Using this setting we can assign a no of cores for the virtual machine. Maximum no processors will be equal to the maximum number of cores on a physical server. (Ex 24 cores, 16 Virtual Machine Reserve cores) 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 Relative weight 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) 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 Create a snapshot Steps 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. Right click on the checkpoint name > Select Rename
Do some changes on virtual machine(create a folder) Apply snapshot-right click on the check point > Select Apply
Select Apply Virtual machine has revert to the previous state
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 Right click on the virtual machine> select Settings >Select IDE Controller dynamic/fixed >select Hard Drive >click on Add disk to the virtual machine Click on New *We can select ISCI controller also.if we are adding IDE drive, vm should be in a poweroff mode
Click on Next Select VHD or VHDX disk format. This will depend on the disk capacity
Select the disk type Dynamically expanding or Fixed size Browse the location for VHD/X and name it
Assign maximum capacity for VHD/X Click on Finish
Lab 05-Add differencing disk to the VM Select Differencing disk>click on Next Assign a path for Diff disk and name it
Select the parent disk> Click on Next Click on Finish
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 Open Hyper-v manager and right click on the VM and select Export
Browse location for export the vm User can see the status of Exporting process
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 Replication virtual machine to Hyper-v Host Steps 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 From source Hyper-V host > right click on vm > select Enable Replication
Click on Next Browse and select destination host from active directory
Select Compress the data that is transmitted over the network > click on Next Click on Next (from this location, we can exclude the vnd from replication also)
Select the frequency for vm replication Select Maintain only the latest recovery point > Click on Next
Select Send initial copy over the network > Select Start replication immediately Click on Finish
Check he re Right click on the vm > Select Replication Select Replication Health
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 Click on Next
Select the server > Click on Next Run the same wizard as vm replication
More and Advanced configurations on next guide!! Please send your feedbacks to darshanasam1234@hotmail.com