SCVMM, Hyper-V Replica, UI and PowerShell

Before I get started on this – I do want to be upfront about the context for this post.  In my house I am currently running Hyper-V Server 2012 R2 with Hyper-V Replica enabled.  I am then managing my environment with System Center Virtual Machine Manager 2012 R2.

I am not (yet) using Hyper-V Recovery Manager (https://www.windowsazure.com/en-us/services/recovery-manager/).

Now, if you are unfamiliar with the story here.  Hyper-V Recovery Manager is our official solution for managing Hyper-V Replica with System Center.  This means that I am not doing things “by the book” right now (why?  Because there are only so many hours in the day and this is actually all stuff that I do in my spare time!).

So what is the experience if you are using Hyper-V Replica with System Center Virtual Machine Manager 2012 R2 without Hyper-V Recovery Manager?  In short, not bad.

SCVMM has no support for configuring or orchestrating Hyper-V Replica directly.  I am currently using Hyper-V manager to do that.  It does, however, detect that Hyper-V Replica has been configured and allows me to view the replication health in the SCVMM UI.  There is one annoyance I have found with this configuration:

clip_image002

This is a screenshot of my SCVMM console.  As you can see it has all of my virtual machines and all of their replicas.  I do not have it displayed here – but I can also add a column that shows the replication health.  Unfortunately, there is no way for me to tell which virtual machines are the primary virtual machines and which are the replicas.  Annoying. 

For the most part I can figure this out intuitively (the primary virtual machine is the one that is running!) But if I have a virtual machine that is turned off (like my TS Gateway in the above screenshot) I have not figured out how to tell the primary from the replica using the SCVMM UI.

PowerShell is much better though.

Here it is very easy to tell the virtual machines apart.  Let’s say I wanted to get the primary TS Gateway virtual machine – I would use this command:

$VM = Get-SCVirtualMachine "TS Gateway” | ?{$_.IsPrimaryVM}

Similarly, to get the replica virtual machine I would run:

$VM = Get-SCVirtualMachine "TS Gateway” | ?{$_.IsRecoveryVM}

Nice and simple.

Hopefully I will find the time to setup Hyper-V Recovery Manager soon (after updating my VPN server, setting a new blog site, getting a new mail server up and running, getting the Windows Azure pack loaded…  This may take a while!)

Cheers,
Ben