During one of our Microsoft Hyper-V 2012 deployment (without GUI) on HP 160 G5, we have come across a very interesting finding of the built-in capabilities where you can now TRUNK VLAN without HP Network Configuration Utility (HPCU) It was both the shock an excitement that night when both myself and Hafiz found that by adding a DWORD to the registry and a clean restart... VOILA ! the VLAN trunking works as expected. This is the location to find for the registry key that you have to add.
xx could be any number so you must open each key and look for your network adapter. If you are using NIC Teaming you probably need to do this for both adapters or all adapters that set up your team, in case you have more than two.
So, what is so great about this ? Remember back in Windows Server 2008 R2 SP1, you need to install HPCU (Not an option). After the installation, you have to use HPCU to create VLAN(802.1q) with the NIC port of you choice. And the next complication was that for each VLAN that you trunk, there will be additional Network Adapter create for that particular VLAN Imaging you have 2 NIC ports and you have 5 VLANs that you need to trunk them for the VMs. This will gives you 10 extra Network Adapters show in Network Connections window. MESSY !!! Now that we can do this without HPCU, you only need to specify the VLAN in the Virtual Network of the VM that want to connect to.
I have conducted a web seminar for 'Microsoft Partner Readiness Webminar' Module 2a which focusing on working with Hyper-V 3 with Powershell.
In my first demo 'Demo1', I have showed to the audience on how we could rapidly deploy VMs Without the use of:- 1. Hyper-V Manager 2. System Center Virtual Machine Manager
The Power of Powershell in managing VMs in Hyper-V
Most of us thought that with the Hyper-V Manager, we could do most of the administrative tasks easily. Well, time to rethink if you have hundreds (if not thousands) of VMs running on you Hyper-V infrastructure and you have to do the following :- 1. To find out the Startup Memory, Minimum Memory and Maximum Memory each VM 2. To find out vCPU count of each VM 3. To find out the vSwitch and VLAN ID each VM connected
With the few tasks as listed, immediately we know how complicated things going to be, and a good example is that we have to right-click each and every VM, properties just to find out these information.
Let think this through with Powershell, you could simply use these to solve the tasks above :- 1. Get-VMMemory -VMNAME <vmname> | ft vmname, startupmemory, minimummemory, maximummemory 2. Get-VMProcessors -VMNAME <vmname> | ft vmname, count 3. Get-VMnetwork
How Aboout Bulk Creating VMs ?
Yes ! Of course we can do that, in fact there are numerous ways in getting this done. In this blog I am going to share with you how we pre-defined the VMs configuration in an CSV spreadsheet and then use powershell to created alll these VMs.
I have change the script I shared last at http://ariessysadmin.blogspot.com/2011/12/how-to-rapid-deploy-vm-using-powershell.html How-To: Rapid Deploy VM Using Powershell to the following
#BulkCreateVMs.ps1 $vmdefaultpath = "D:\VMs" $ParentVHD = "D:\Hyper Base\WIN2K8R2SP1_Ent_Sysprep_180days_Updated20120404.vhd" $path = "D:\vms\VMs.csv" import-csv -path $path|ForEach-Object { $erroractionpreference = 0 $vmName = $_.Name [int] $vmmemory = $_.Memory $vmstartmemory=$vmmemory*1073741824 $vmcpucount = $_.Cpucount $vmSwitch = $_.Network $vmpath = $vmdefaultpath #Create the VM New-VM -Name $vmname -Path $vmdefaultpath #Set the VM Memory properties Set-VM -Name $vmname -StaticMemory -MemoryStartupBytes $vmstartmemory #Set the vCPU Set-VMProcessor -VMName $vmname -Count $vmcpucount #Connect the VM to vSwitch Connect-VMNetworkAdapter -VMName $vmname -SwitchName $vmSwitch #Create VHD for the VM New-VHD -Path $vmpath\$vmname\$vmname.vhd -ParentPath $ParentVHD #Add the VHD to the VM to IDE 0 Location 0 Add-VMHardDiskDrive -vmname $vmname -ControllerType IDE -ControllerNumber 0 -Path $vmpath\$vmname\$vmname.vhd Write-Host -BackgroundColor Green -ForegroundColor Black "Virtual Machine $vmname has been successfully created" }
The script above:- 1. Reads all VM configuration listed in VMs.csv and create in Hyper-V 3 host 2. Stores all VMs configuration files, snapshots, and VHDs in D:\VMs\ 3. Creates diferrencing disk for each VMs with the Parent VHD in D:\Hyper Base\ 4. Creates VMs with static memory
You have to change this script properties to suit your environment if you plan to use this.
Below is the video i have captured, showing how the script works for my demo.
I have blogged about Hyper-V replica a while ago when Windows Server 8 release as Developer Preview. And here comes the Windows Server 8 Beta released not long ago, Hyper-V Replica is everywhere on the net most exciting part of it, more and more detailed technical documentation make available by Microsoft to the public particular to this piece of Hyper-V components.
My first look is on the Windows Server 8 Hyper-V Component Architecture Poster and my first expression was…………<speechless>………..and WOW !!!! IMPRESSIVE!
Windows Server "8" Beta Hyper-V Component Architecture Poster
"Hyper-V Replica is an asynchronous virtual machine replication technology that is included in Windows Server "8" Beta. It is designed for business continuity and disaster recovery. It works with any server, network, or storage vendor. It does not require any shared storage. It enables you to replicate individual or multiple virtual machines. Hyper-V Replica is tightly integrated with Hyper-V and Failover Clustering. You can replicate virtual machines from one computer running Hyper-V at a primary site (the primary server) to another computer running Hyper-V at a Replica site (the Replica server). The Replica server accepts incoming replication traffic from one or more primary servers." - Windows Server "8" Beta Hyper-V Component Architecture Poster
Figure 1: Windows Server "8" Beta Hyper-V Component Architecture Poster
Technical Write Up
A document on Understand and Troubleshoot Hyper-V Replica in Windows Server "8" Beta is available for you if you are looking for the detailed bits of Hyper-V Replica in Windows Server 8. I personally find that this document is very useful for someone like me who involves in proposing Hyper-V design.
Hyper-V Replica with Powershell
For some of you would like to deploy Hyper-V with Server Core installation, you may be looking into managing Hyper-V Replica using Powershell. The below 2 blogs you may be interested in :
As promise in my previous blog How-To: Enable Hyper-V 3.0 Replica (Part 1), I have capture a full video of my testing on Hyper-V 3.0 Replica. Below are the videos and it is best view at 720p resolution:-
Hyper-V 3.0 Replica Highlights During Testing
As usual, i did quite number of things that may be does not make sense with the purpose to see how is the Hyper-V manager handle this. Below are some of the things that I have tried to perform during the testing.
Maximum number of recovery point
Notice that the Store additional recovery points have a maximum value of 15.
Figure 1: Maximum value of Store additional recovery point is 15
Schedule Initial Replication
You can only schedule the Initial Replication not later than 7 days.
Figure 2: Schedule of Initial Replication must be within 7 days
Power up the VM during replication
When you try to power up the VM during the Replication in progress, This is the error you will get.
Figure 3: Error when power up VM during replication
Network Utilization During Initial Replication
The network utilization at 95% of 100Mbps during Initial Replication. Looking forward to test again when i got 1Gbps switch.
Figure 4: Network utilization
Report of Replication Health
Report is available to tell you the statistics and status of VM replication.
Figure 5: Replication Health Report
Failover test
You can use failover test to test the functionality of the replicated VM. The Test Failover feature will create a test VM of the replicated VM with just a click away.
Figure 6: Test Failover
Plan Failover must turn off production VM
Your planed failover will not work if the production VM is still running.
Figure 7: Planned Failover failed
Figure 8: Planned Failover started
Reverse Failover
Reverse Failover is necessary when the production Hyper-V host is running and you want your VM return to that host.
Figure 9: Reverse Replication for VM that was failover to DR Hyper-V host
In previous day, replication is complex to configure and setup and often requires expensive proprietaty hardware or software. Due to this,not many of us could afford replication of VMs for disaster recovery copy. Well what about to change the way we design our DR center in the next few months is that Microsoft's Hyper-V 3.0 is to bundle with Hyper-V Replica.
Hyper-V Replica
Hyper-V Replica is asynchronous, application consistent, virtual machine replication built-in to Windows Server 8. With Hyper-V Replica, you can replicate a virtual machine from one location to another with Hyper-V and a network connection. Hyper-V Replica works with any server vendor, any network vendor and any storage vendor. In addition, we will provide unlimited replication in the box. With Hyper-V Replica, we could now design our disaster recovery site in a more cost effective way.
*Note: The Hyper-V Replica of Hyper-V 3.0 which bundle in Microsoft Server 8 Developer Preview and its feature are subject to changes when Windows Server 8 RTM released.
1. Click Start and launch Hyper-V Manager 2. Select the VM that you want to enable replication, right-lick and select Enable Replication.
Figure 2: Select Enable Replication...
3. Specify Replica Server with FQDN of the target Hyper-V server where you want to move the VM. Click Verify Configuration
Figure 2: Enable Replication of Hyper-V server
4. If this is the first time replication is enable for the server, click Configure server.
Figure 3: Enable replication for first time
5. Select Replication Configuration on the left pane of Hyper-V Settings page. Check Enable this computer as replica server, check Use Integrated Windows Authentication (HTTP) and make sure it use port 80, check Allow replication from specified servers and select the source Hyper-V server and storage location.
Figure 4: Replication Configuration on target Hyper-V Server
6. Select Virtual Machine Move Configuration on left pane. Check Enable this computer to receive Virtual Machine Migrations. Click Apply.
Figure 5: Virtual Machine Move Configuration
7. Click Next until Summary. Click Finish. Upon Finish is clicked, the initial replication will kick start.
Figure 6: Finish enabling Hyper-V Replica
I am currently working on capturing data and video when the initial replication take place and I will post them as How-To: Enable Hyper-V 3.0 Replica (Part 2).
If you have not install Windows Server 8 Developer Preview yet, you may also follow guide which i have blogged earlier at How To: Windows Server 8 Boot from VHD. Upon the installation of Windows Server 8, you may proceed with the steps below for Hyper-V V3 role installation:-
1. In Windows Server 8 Developer Preview, launch the Server Manager Console.
2. If you have not launch the Server Manager, click on Start > Server Manager.
3. At the Dashboard, click add roles
Figure1: Dashboard of Server Manager
4. At the Add Roles and Features Wizard page, select Role-based or Feature-based Installation.
Figure2: Add Roles and Features Wizard
5. Click Next until Server Roles.
6. At the Select Server Roles page, select Hyper-V.
7. Click Next until Confirmation.
8. At the Confirm installation selections page, check Restart each destination server automatically if required.
Figure3: Confirmation
Figure4: Role installation in progress
9. After the server has completed rebooting, log back on to the Windows Server 8 Developer Preview with following credentials:
10. Close the Server Manager window.
11. Launch the Server Manager, click on Start > Server Manager.
12. Click on Hyper-V Manager.
Continue to my previous blog Screencast: SCVMM 2012 Installation, I have proceed to add my biggest production Hyper-V cluster to SCVMM 2012 RC. The cluster consists of 9 Hyper-V nodes which is hosting 71 VMs on VFARM3 cluster. Below is the screencast of the process.
Installation of System Center Virtual Machine Manager (SCVMM) 2012 is simple enough, and I have screenshot each of the important screen you will come across during installation.