Interview about new Windows Server 2012 Hyper-V Features

Windows Server 2012 RC Logo

Last week I met with Carsten Rachfahl who is a MVP for Virtual Machine and the owner of hyper-v-server.de. Carsten was visiting Switzerland and he also took the time to do some interviews and I had the chance to speak with him.

In the interview (in german) we talked about the new release of Hyper-V which is included in Windows Server 2012.

  • 01:55 – Hyper-V Replica
  • 03:10 – Hyper-V Design
  • 03:35 – SMB for Hyper-V
  • 05:50 – Hyper-V Converged Fabric
  • 07:41 – Shared Nothing Live Migration
  • 09:40 – Hyper-V for Hoster
  • 11:04 – CSV Cache
  • 12:28 – Hyper-V Converged Fabric
  • 13:45 – Hyper-V and PowerShell

You can watch the interview in better resolution on it-cast.de.

If you are interested in my sessions about Hyper-V 2012 and other great Private Cloud session covering Windows Server 2012 and System Center 2012 checkout the Geekmania 2012 website.

Hyper-V Replica – The Game Changer

Windows Server 2012 RC Logo

In Windows Server 2012 Microsoft introduced a new feature called Hyper-V Replica. In my opinion Hyper-V Replica is a true Game Changer, something like the forward pass in football or the slam dunk in basketball. In my interview with Carsten Rachfahl from hyper-v-server.de I mentioned that I think a lot of customer will choose Hyper-V Replica as Disaster Recovery solution.

What is Hyper-V Replica and how does it work?

What is Hyper-V Replica and how does it work. With Hyper-V Replica it is possible to replicate Hyper-V Virtual Machines from a Hyper-V host to another Hyper-V host or cluster. The great thing about it is that Hyper-V Replica is optimized for replication over WAN. This allows companies to replica Virtual Machines from a primary site to a secondary site, and in case of a disaster on the primary site, Virtual Machines can be failed over to the secondary site.

Hyper-V Replica

The replication is done per virtual machine, so you can also replicate VMs to two or more different locations.

Hyper-V Replica is an asynchronous replication, Hyper-V Replica will do a initial replication of the Virtual Machine and after that changes will be replicated every 5 to 10 minutes.

How to enable Hyper-V Replica on a single host

To allow the Hyper-V host to send and receive virtual machine replications you have to enable the Hyper-V Replica feature and configure the Windows Firewall. Hyper-V Replica can be enabled via Hyper-V Manager in the Hyper-V settings. You can setup different replication settings such as which hosts can replicate to this server or which port is used for the replication and whether HTTP or HTTPS should be used.

Enable Hyper-V Replica

After you have enabled Hyper-V Replica you have to open the Windows Firewall ports for Hyper-V Replica. You can simply enable the rules in the Windows Firewall settings.

Hyper-V Replica Windows Firewall

You can also enable this firewall rules via Windows PowerShell.


Enable-NetFirewallRule -DisplayName "Hyper-V Replica HTTP Listener (TCP-In)"

How to enable Hyper-V Replica on a Hyper-V Cluster

To allow the Hyper-V Cluster to send and receive virtual machine replications you have to enable the Hyper-V Replica Broker role in the Hyper-V Cluster and configure the Windows Firewall on each host. The Hyper-V Replica Broker role enables the failover cluster to participate in virtual machine replication with Hyper-V Replica. You cannot replicate to a single host which is used in a cluster, you can only replicate to the Hyper-V Replica Broker.

First the Hyper-V Replica Broker cluster role has to be added.

Enable Hyper-V Replica Broker roleThe Hyper-V Replica Broker needs a own IP in the same subnet as the cluster. The Name of the Replica Broker role will be used as target to replicate virtual machines.

Hyper-V Replica Broker role

This can of course also be done via Windows PowerShell.


$Broker = "ReplicaBroker"

Add-ClusterServerRole -Name $Broker –StaticAddress 10.10.77.1

Add-ClusterResource -Name “Virtual Machine Replication Broker” -Type "Virtual Machine Replication Broker" -Group $Broker

Add-ClusterResourceDependency “Virtual Machine Replication Broker” $Broker

Start-ClusterGroup $Broker

After you have added the Hyper-V Replica Broker role in the Cluster you have to enable Hyper-V Replica and set it up like the standalone Hyper-V host.

Hyper-V Replica Broker Cluster role

Hyper-V Replica Broker Cluster role settings

After you have configured the Hyper-V Replica Broker settings you also have to enable the Windows Firewall rules. This Windows PowerShell command will help you to configure the Firewall rule on every node in the cluster.


Get-ClusterNode | ForEach-Object {Invoke-Command -ComputerName $_.Name -ScriptBlock {Enable-NetFirewallRule -DisplayName "Hyper-V Replica HTTP Listener (TCP-In)"}}

How to enable virtual machine replication

After you have enabled Hyper-V Replica on the source Hyper-V host/cluster and destination Hyper-V host/cluster you can setup the virtual machine to replicate. Right click the virtual machine and “Enable Replication”.

Enable Hyper-V Virtual Machine Replication

Specify the Replica server name to use to replicate the virtual machine. If the Replica server is on a failover cluster, specify the name of the Hyper-V Replica Broker as the Replica server.

Enable Hyper-V Virtual Machine Replication Destination

You can specify the connection parameters and set up compression for the transmitted data.

Hyper-V Replica Connection Parameters You can choose which VHDs of the virtual machine should be replicated to the destination.

Hyper-V Replica VHDConfigure the Recovery History, this allows you to choose from different recovery points when you start a failover.

Hyper-V Replica recovery pointsConfigure the Initial Replication Method. You could also move the initial replication copy via external hard drive to the destination.

Hyper-V Replica initial replicationAfter you have started the replication, Hyper-V Replica will start with the initial replication of the virtual machine, and the virtual machine will also be visible on the destination Replica server.

Hyper-V Replica sending initial replication

To do this via Windows PowerShell you could use the following commands


$ReplicaServer = "ReplicaBroker.cloud.win"
$RecoveryPort = 80
$PrimaryVM1 = “SharePoint2013”
$PrimaryServer = "hyperv01.cloud.win

Set-VMReplication -VMName $PrimaryVM1 -ReplicaServerName $ReplicaServer -ReplicaServerPort $RecoveryPort -AuthenticationType Integrated -CompressionEnabled $true -RecoveryHistory 0

Start-VMInitialReplication –VMName $PrimaryVM1

 

Check Replication State and Replication Health

To check the Replication State and the Replication Health you have a variety of options.

First in the Hyper-V Manager you can see the Replication State of the virtual machine.

Hyper-V Replica replication state and healt Hyper-V Manager

You can also right click on the virtual machine and view the replication health, state and other interesting information.

Hyper-V Replica replication state and healt VM

You can also use Windows PowerShell to get information about the virtual machine replication state and health.


Get-VMReplication

Hyper-V Replica replication state and healt PowerShell

Failover Options

Now after the replication is setup you have different failover options for the virtual machine. This options allow you to do different failover scenarios.

  • Planned Failover
  • Test Failover
  • Failover

Planned Failover

Hyper-V Replica Planned Failover

A Planned Failover is a solution if both sites are still available it is also possible to migrate the virtual machine from on datacenter to another datacenter. A planned failover basically shuts down the source virtual machines, replicates all the latest changes and after all changes are replicated to the recovery site the virtual machines on the recovery site will start with no loss of data.

The primary server will automatic change to the Replica server and the Replica server will change to the primary server.

Test Failover

If you want to test the virtual machine on the recovery site you can use this feature. This will create a copy of the virtual machine on the recovery site which can be used for testing without interrupting the replication. You can also set the copy of the virtual machine to connect to another virtual switch or to be not connected so no IP address conflict will happen.

Hyper-V Replica Test Failover

Failover

Hyper-V Replica Failover Recovery Point

The Failover option will be used on the recovery site during a disaster where the primary site is down. This will start the virtual machine on the recovery site and the administrator will have to choose the latest recovery point. Data between the disaster recovery and the latest recovery point will be lost.


$VM = Get-VM -Name "SharePoint2013"

Start-VMFailover -VM $VM

Hyper-V Replica Failover via PowerShell

 

There is also a possibility to inject another IP address configuration on the recovery site.

Hyper-V Replica inject Failover IP Address

After you have selected a Recovery Point for the Failover, the other Recovery points are still available as snapshots for this Virtual Machine. if the first Recovery Point is not working correctly you can choose another Recovery Point.

Hyper-V Replica Failover

 

Failback

Now a lot of disaster recovery solutions are easy to failover but how can you to a failback of your workload? In Hyper-V replica this is pretty easy. After a unplanned Failover the primary server is still the same and the virtual machine is now running on the recovery server. Now to failback a virtual machine with the latest data you reverse the replication so the primary server changes to the recovery server and the recovery server where the virtual machine is running after the failover will be the primary server. Now the virtual machine will be replicated in in the other way. To do failback of the virtual machine back without losing data you can now do a planned failover.

Hyper-V Replica Reverse Replication


$VM = Get-VM -Name "SharePoint2013"

Set-VMReplication -reverse -VMName $VM

 

Conclusion

I hope this post shows you how great Hyper-V Replica is and how easy to setup it is. If you have any question about Hyper-V Replica you should check out Microsoft TechNet or use the comment function on this post.

Hyper-V has 0xB16B00B5

Paolo Bonzini found something funny in the Linux kernel support code for Microsoft’s Hyper-V. There is a constant in the Linux integration drivers which gets passed through to the hypervisor and it called “0xB16B00B5″ if you are common with the leetspeak you can read the words “BIG BOOBS”.

Now I always knew that there was another advantage of Hyper-V over VMware ;-)

Microsoft Virtual Machine Converter Release Candidate

Microsoft Virtual Machine Converter

Back in April Microsoft announced the beta version of the Microsoft Virtual Machine Converter Solution Accelerator. The Microsoft Virtual Machine Converter allows you to migrate your VMware vSphere Virtual Machines to your brand new Microsoft Hyper-V environment.

Today the Microsoft Virtual Machine Converter Release Candidate is available for testing. The best thing at the RC is the support of Windows Server 2012 Hyper-V and Microsoft Hyper-V Server 2012, but there are also other new capabilities.

New in the Release Candidate

In addition to the capabilities that were delivered as part of the beta release, the MVMC Release Candidate:

  • Converts and deploys virtual machines from VMware hosts to Hyper-V hosts running:
  • Windows Server 2012 Release Candidate
  • Microsoft Hyper-V Server 2012 Release Candidate
  • Adds virtual network interface cards (NICs) to the converted virtual machine on Hyper-V
  • Configures dynamic memory on the converted virtual machine
  • Supports migration of virtual machines that are hosted on a vSphere cluster
  • Supports migration of virtual machines to a Hyper-V host that is part of a failover cluster
  • Enables Microsoft partners to cobrand the tool so that it incorporates their logos

Check it out on Microsoft Connect: https://connect.microsoft.com/site14/MVMC

 

Windows Server 2012 Hyper-V Converged Fabric

Windows Server 2012 RC Logo

In Windows Server 2008 R2 we had some really simple configurations and best practices for Hyper-V and network configurations. The problem with this was, that this configurations were not really flexible. This had two main reasons, first NIC teaming wasn’t officially supported by Microsoft and secondly there was no possibility to create virtual network interfaces without third party solution.

Here is a example of a Hyper-V 2008 R2 host design which was used in a cluster setup.

Traditional Design

traditional Hyper-V Host

Each dedicated Hyper-V network such as CSV/Cluster communication or the Live Migration network used a own physical network interface. The different network interfaces could also be teamed with third party software from HP, Broadcom or Intel. This design is still a good design in Windows Server 2012 but there are other configurations which are a lot more flexible.

Microsoft MVP Adian Finn and Hans Vredevoort did a already some early work with Windows Server 2012 Converged Fabric and you should definitely read their blog posts.

In Windows Server 2012 you can get much more out of your network configuration. First of all NIC Teaming is now integrated and supported in Windows Server 2012 and another cool feature is the use of virtual network adapters in the Management OS (Host OS or Parent Partition). This allows you to create for example one of the following designs.

Virtual Switch and Dedicated Management Interfaces

Hyper-V Converged Fabric

This scenario has two teamed 10GbE adapter for Cluster and VM traffic.

Virtual Switch and Dedicated Teamed Management Interfaces

Hyper-V Converged Fabric

The same scenario with a teamed management interface.

Dedicated Virtual Switch for Management and VM Traffic

Hyper-V Converged Fabric

One Virtual Switch for Management and Cluster traffic and a dedicated switch for VM traffic.

One Virtual Switch for everything

Hyper-V Converged Fabric

This is may favorite design at the moment. Two 10GbE adapter as one team for Virtual Machine, Cluster traffic and management. It is a very flexible design and allows the two 10GbE adapters to be used very dynamic.

This design solutions will also be very interesting if you us SMB 3.0 as a storage for Hyper-V Virtual Machines.

FileServer and Hyper-V Cluster

 

There are at the moment not a lot of official information which designs will be unsupported and which will be supported. You can find some information about supported designs in the TechEd North America session WSV329 Architecting Private Clouds Using Windows Server 2012 by Yigal Edery and Joshua Adams.

Configuration

Now after you have seen these designs you may want to create such a configuration and want to know how you can do this. Not everything can be done via GUI you have to use your Windows PowerShell skills. In this scenario I use the design with four 10GbE network adapters 2 for iSCSI and to for my network connections.

  • Install the Hyper-V Role
  • Create NIC Teams
  • Create a Hyper-V Virtual Switch
  • Add new Virtual Network Adapters to the Management OS
  • Set VLANs of the Virtual Network Adapters
  • Set QoS Policies of the Virtual Network Adapters
  • Configure IP Addresses of the Virtual Network Adapters

Install Hyper-V Role

Before you can use the features of the Virtual Switch and can start create Virtual Network Adapters on the Management OS (Parent Partition) you have to install the Hyper-V role. You can do this via Server Manager or via Windows PowerShell.

 Add-WindowsFeature Hyper-V -Restart 

Create NIC Teams

Now most of the time you will create a NIC Teaming for fault tolerance and load balancing. A team can be created over the Server Manager or PowerShell. Of course I prefer the Windows PowerShell. For a Team which will not only be used for Hyper-V Virtual Machines but also for Management OS traffic I use the TransportPorts as load balancing algorithm. If you use this team only for Virtual Machine traffic there is a algorithm called Hyper-V-Port. The Teaming Mode of course depends on your configuration.

 New-NetLbfoTeam -Name Team01 -TeamMembers NIC1,NIC2 -LoadBalancingAlgorithm HyperVPort -TeamingMode SwitchIndependent 

NIC Teaming

 

Create the Virtual Switch

After the team is created you have to create a new Virtual Switch. We also define the DefaultFlowMinimumBandwidthWeight to be set to 20.

 New-VMSwitch -Name VMNET -NetAdapterName Team01 -AllowManagementOS $False -MinimumBandwidthMode Weight
Set-VMSwitch "VMNET" -DefaultFlowMinimumBandwidthWeight 3.

VM Switch

 

After you have created the Hyper-V Virtual Switch or VM Switch you will find this switch also in the Hyper-V Manager.

Hyper-V Virtual Switch

 Create Virtual Network Adapters for the Management OS

After you have created your Hyper-V Virtual Switch you can now start adding VM Network Adapters to this Virtual Switch. We also configure the VLAN ID and the QoS policy settings.

 Add-VMNetworkAdapter -ManagementOS -Name "Management" -SwitchName "VMNET"
Add-VMNetworkAdapter -ManagementOS -Name "LiveMigration" -SwitchName "VMNET"
Add-VMNetworkAdapter -ManagementOS -Name "CSV" -SwitchName "VMNET"

 

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "Management" -Access -VlanId 185
Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "CSV" -Access -VlanId 195
Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "LiveMigration" -Access -VlanId 196

 

Set-VMNetworkAdapter -ManagementOS -Name "LiveMigration" -MinimumBandwidthWeight 20
Set-VMNetworkAdapter -ManagementOS -Name "CSV" -MinimumBandwidthWeight 10
Set-VMNetworkAdapter -ManagementOS -Name "Management" -MinimumBandwidthWeight 10

VMNetworkAdapter ManagementOS

 

Your new configuration will now look like this:

Network Connections

As you can see the name of the new Hyper-V Virtual Ethernet Adapter is vEthernet (NetworkAdapaterName). This will be important for automation tasks or configuring IP addresses via Windows PowerShell.

Set IP Addresses

Some months ago I wrote two blog posts, the first was how to configure you Hyper-V host network adapters like a boss and the second one was how to replace the netsh command with Windows PowerShell. Now using Windows PowerShell to configure IP addresses will save you a lot of time.


# Set IP Address Management
New-NetIPAddress -InterfaceAlias "vEthernet (Management)" -IPAddress 192.168.25.11 -PrefixLength "24" -DefaultGateway 192.168.25.1
Set-DnsClientServerAddress -InterfaceAlias "vEthernet (Management)" -ServerAddresses 192.168.25.51, 192.168.25.52

# Set LM and CSV
New-NetIPAddress -InterfaceAlias "vEthernet (LiveMigration)" -IPAddress 192.168.31.11 -PrefixLength "24"
New-NetIPAddress -InterfaceAlias "vEthernet (CSV)" -IPAddress 192.168.32.11 -PrefixLength "24"

# iSCSI
New-NetIPAddress -InterfaceAlias "iSCSI01" -IPAddress 192.168.71.11 -PrefixLength "24"
New-NetIPAddress -InterfaceAlias "iSCSI02" -IPAddress 192.168.72.11 -PrefixLength "24" 

 

There is still a lot more about Windows Server 2012 Hyper-V Converged Fabric in the future, but I hope this post will give you a quick insight into some new features of Windows Server 2012 and Hyper-V.

Windows Server 2012: Install Hyper-V Role for beginners

Windows Server 2012 RC Logo

Still a lot of people haven’t tired Windows Server 2012 Hyper-V. Now this blog post should help them doing the first step with Windows Server 2012 Hyper-V.

If you install you want to install the Hyper-V role on a Windows Server 2012 you have basically two choices. First you can install the role with the Server Manager.

Add Hyper-V role Server Manager

Here you can choose if you want also the management tools for Hyper-V. The management include the Hyper-V Manager Console and the Hyper-V PowerShell module.

If you want to install the Hyper-V role via command line or you are using the Windows Server 2012 core installation. There is the following PowerShell cmdlets available.

  Add-WindowsFeature Hyper-V -Restart -IncludeManagementTools 

The parameters -restart and -includeManagementTools are optional.

Updating offline VHDs via Virtual Machine Servicing Tool

VHDX

Some weeks ago Microsoft announced the beta of a solution accelerator called Virtual Machine Servicing Tool 2012. The VMST 2012 allows you to update Virtual Machines in a System Center Virtual Machine Library, update stopped and saved state virtual machine on a Hyper-V host, update SCVMM Virtual Machine templates and to injecting update packages in offline virtual hard disks (VHD) disks stored in a System Center Virtual Machine Manager Library.

This guide should give show a quick insight into the Virtual Machine Servicing Tool.

After you have installed the Virtual Machine Servicing Tool and added the psexec to the bin folder of the tool you have to do a quick configuration of your environment.

First you have to add the servers in your environment. You have to add the SCVMM and the SCCM or WSUS server.

The second configuration step is to choose the Hyper-V hosts which will be used for the maintenance and servicing jobs. You need this if you update an offline virtual machine which is stored in your library. The virtual machine will be deployed on these hosts and will be patched before they will be saved in the SCVMM library again.

The Maintenance host for servicing offline virtual hard disk will be the place where VHD will be attached and the update packages will be injected.

 

After you have done these simple setup steps you can now start patching your offline Virtual Hard Disks (VHDs). In the VMST Console you can create a new Servicing Job.

First you have to choose a name for the servicing job and a update source, this could be a WSUS server or update packages stored in a folder.

Now you have to select the VHD you want to update.

You have to select one of your maintenance hosts

And after the servicing job has been started you can watch the process in your VMST console.

 

This is how simple it is to patch offline virtual machines, you can even schedule servicing tasks, so they run after every patch day.