Wednesday, 25 May 2016

Hyper-V 2012 R2 Hyper-V Replica – Overview and Configuration

I am having to re certify my MCSE Server Infrastructure in the next couple of weeks so I really need to skill up on Hyper-V and understand what it can do in 2012 R2. I tend to always favour VMware in production deployments.

Overview of Hyper-V Replica on Windows Server 2012 R2

Hyper-V Replica is a technology that allows virtual machines (VM’s) to be asynchronously replicated between Hyper-V hosts. Hyper-V Replica was introduced in Windows Server 2012.


Hyper-V Replica Key Points;
  • ·       Asynchronous replication between Hyper-V hosts.
  • ·       Supported in Windows Server 2012 and above.
  • ·       Replication is achieved over ordinary IP-based networks.
  • ·       Hosts can be geographically separated.
  • ·       Supported along side Hyper-V clustering and without.
  • ·       No shared storage is required for Hyper-V Replica.
  • ·       Hyper-V hosts do not have to be domain joined.
  • ·       Hyper-V hosts can be domain joined, and reside in different forests.
  • ·       Authentication between hosts can be done with certificates and Kerberos.
  • ·       Hyper-V Replica can be used in conjunction with Azure ASR.
  • ·       Replication cycles can be configured at 30s, 5mins or 15mins.
  • ·       Hyper-V Replica traffic can be tagged using Trusted Groups for multi-tenant environments.

Hyper-V Replica seems to be aimed at the Disaster Recovery space for failover at site level to a DR DC. Although in some smaller organizations it can be used as failover between two Hyper-V hosts, when expensive SAN’s etc. are not available.

However, if you plan to use Hyper-V Replica as “cheap” failover, please bare in mind it’s not automatic. A manual step is required in order to cutover to the replica host. You can however perform test failover scenario’s so that you can effectively test your DR solution.

A log file is maintained by the Hyper-V Replica service to ensure the last changes are played back to the replica VM’s, this is done based on the replication cycle time you configure.

Configuring Hyper-V Replica on Windows Server 2012 R2

From the source Hyper-V host click Enable Replication from the Actions menu. Click Next on the introduction page.


Click Browse and find the destination Hyper-V host you are going to enable replication to. Click Next.


If you have not configured Hyper-V replica on the destination server you will receive the error “The specified Replica server is not configured to receive replication from this server.” the option to Configure Server… will appear.


This will display the Hyper-V Settings for the destination host. Click Enable this computer as a Replica Server. and then tick Use Kerberos (HTTP), I am going to cover the integration of certificates in a separate post.


Scroll down the windows and click Allow replication from the specified servers and click Add, from here enter the name of the source Hyper-V host. You will also be prompted to create a new Trust Group. A Trust Group is a form of Authorization which contains servers that are allowed to replicate between each other. 


As Kerberos is using TCP port 80 you must ensure that there is an incoming rule, bound to the domain profile for the source/destination servers.



One important thing to remember on the Replication VHD’s page, is that if you have Hyper-V Replica configured on a VM and you add additional disks to it at a later stage Hyper-V does not detect this can it will not automatically start replicating the new disks. You must reconfigure the replication to include the new disks.


The frequency you select will depend upon your RPO/RTO requirements. In most cases 30 seconds maybe a little excessive, as it will generate a very high amount of network traffic. By default, replication traffic is sent over the management interface.


Hyper-V Replica can be configured to store multiple recovery points; this allows you to store multiple versions of the server for more options to roll back.


Initial Replication can be configured, it’s worth knowing that if you have a large amount of VM’s with large data sets you can stage the data onto an external disk. 


You can monitor the initial replication status of the VM.


Once it’s completed you can view the status of the replication from the destination server, under the Replication tab.


Replication health can also be checked from the source server if you right click the VM and select Replication > Replication Health.


You can perform planned failovers to the replica VM if you require, for example you may have to take the source Hyper-V host offline for patching. Please note that your failover will not work if you do not have the Virtual Networks configured correctly on both side. You must have a Hyper-V Switch configured on both Hyper-V hosts with EXACTLY the same name, from a networking perspective this switch must be uplinked to the correct physical network segment to allow the VM to continue working properly.


A VM must be powered off to perform a planned failover, once it’s off you should be able to failover the VM instance.

Tuesday, 24 May 2016

Hyper-V Failover Clustering in Windows Server 2012 R2 - Overview

Hyper-V can be deployed in conjunction with the Failover Cluster server role in Windows Server 2012 R2, to achieve a highly available and resilient virtualization platform. Hyper-V Failover Clusters allow the movement of VM’s to neighbouring Hyper-V hosts within a cluster, this protects against host failure and also provide flexibility when performing updates and patches of the underlying host operating systems.

In the event of a node (Hyper-V host) failure the Failover Cluster Service will automatically failover or “cut over” the VM’s running on that node to another one of the nodes in the Failover Cluster. It should be noted that this does not provide instant failure, there is a short amount of latency between a host failing and the VM’s being started on another node.

The following are some key points relating to Hyper-V Failover Clusters if you are considering them for your infrastructure;
  • ·      Cluster node to node communications should be on a separate network segment.
  • ·      Hyper-V failover cluster hardware must pass all validation checks for compatibility.
  • ·      Hyper-V clusters are limited to 64 hosts and 8000 VM’s.
  • ·      Network interface card settings should be identical across hosts and switches.
  • ·      DNS must be configured on each cluster host.
  • ·      Private cluster networks should not be routable.
  • ·      Private cluster networks should use unique network segments ranges.
  • ·      Hyper-V hosts should be in the same Active Directory domain.
  • ·      A single Hyper-V host can run up to 1024 VMs concurrently.
  • ·      Shared storage is required for a failover cluster, SMB shares can be used.
  • ·      Virtual Networks on Hyper-V hosts must be named exactly the same on clustered nodes.
  • ·      Cluster Shared Volumes (CSV’s) are required for clustered VM’s.
  • ·      The Hyper-V integration services are required on clustered VM’s.
  • ·      Hyper-V QoS can be used to reduce the number of physical NIC’s required for different traffic types.

    You are probably comparing Hyper-V to VMware vSphere, it is a matter of opinion on what product is the best. I believe vSphere is a more mature product at this point in time.  Although in Windows Server 2012 R2 many of the most commonly used features are available in both, for example at one stage VMware’s Distributed Resource Scheduler, that automatically load balances VM workloads across clustered ESXi hosts was not something Hyper-V could do. Now with Hyper-V 2012 R2, VMM and Live Migrations there is a very similar service available that boasts “no noticeable” downtime whilst migrating.



Friday, 20 May 2016

Certificate Generation in IIS throws "Cannot find the certificate request that is associated with this certificate file. A certificate request must be completed on the computer where the request was created."

You are trying to generate a self-signed certificate for a SQL database service, after creating the CSR from IIS you try to Complete the CSR request and receive the following error "Cannot find the certificate request that is associated with this certificate file. A certificate request must be completed on the computer where the request was created."

The fix here is to open the Certificates MMC under the Local Computer. Expand Certificate Enrollments Request and then Certificates.

Right click and select the Properties of the certificate request that is present. Now populate the Friendly Name field and click OK.

This will resolve the error and effectively complete the certificate signing request. Now if you have to export this certificate to other devices, double click on the Certificate and click the Details tab.
From there click Copy to File..., run through the wizard and ensure you tick the box to export the private key. This will generate PFX file with the public/private key contained within.