Freigeben über


Planned or unplanned failover with Hyper-V Replica?

As you hopefully know – I have been running Hyper-V Replica in my house for about a year now.  In this time I have had a couple of instances when I had to take a step back and ask myself if I wanted to do a planned or an unplanned failover of a virtual machine.

To bring everyone up-to-speed here:  planned failover of replicated virtual machine involves logging into the source computer, shutting down the virtual machine that you want to failover, and then selecting to perform a planned failover.  Hyper-V will ensure that the two virtual machines are completely in sync and will orchestrate the process in a way that ensures no data loss.  Unplanned failover is where you go to the recovery site and just power up the virtual machine, incurring some amount of data loss in the process.

At first glace, you would assume that you always wanted to do a planned failover if possible.  But in my experience there are times when a planned failover is possible, but an unplanned failover is preferable.

Let me explain with a real-life situation I had to deal with.

One morning as I am about to leave for work – my wife calls out to me and says that the Internet isn’t working.  I duck into my little server room and look around.  Sure enough one of my Hyper-V servers is off, and will not turn on.  5 minutes later I have confirmed that it is a failed power-supply, I have replaced the power-supply, and I am booting the server.

Now, the replacement power-supply that I grabbed is not server grade (it is an old desktop power-supply that I had sitting on a shelf).  So my initial thoughts were:

    1. I will boot the server off of this power-supply
    2. I will use Hyper-V replica to perform planned failovers of the virtual machines
    3. I will then leave the server (with no active virtual machines on it) running through the day.  If it fails, it is not the end of the world.
    4. I will grab a new power-supply today and install it tonight

As I started working on this plan – my head was starting to do some math.  All up this would not take long, probably 15 minutes – but I was already late for work.  Furthermore; the virtual machines had all been turned off since the power-supply failure had happened – so there really wasn’t any significant data that would not have been replicated.  Finally, all the virtual machines that had been on the failed physical server were largely stateless (firewall, VPN, etc…) my fileserver virtual machine had been on the other server.

Once I put all of these facts together I realized that I could just leave the failed server off and perform an unplanned failover on each of the virtual machines.  This would take under 5 minutes and I would be on my way.

Which was exactly what I did.

You may be wondering if this would cause problems when I tried to startup the failed Hyper-V server later in the day (with duplicate virtual machines and the like) but this is something that Hyper-V handles for you automatically.  When I did replace the power-supply and start up the physical computer, Hyper-V detected that the replica virtual machines were running and did not start the primary virtual machines.

I did have to go in and manually correct the replication relationship when I got all my hardware up and running – but using unplanned failover provided me exactly the functionality I needed, while minimizing the amount of time that I had to spend getting my virtual machines up and running.

Cheers,
Ben

Comments

  • Anonymous
    September 16, 2013
    It's a great feature no doubt, please get the Exchange team on board as well. I know there are DAGs..., but this is much easier esp. for smaller shops.

  • Anonymous
    September 16, 2013
    So, it's time for System Center deployment in your house to be able to monitor hardware failures and orchestrate a response :)

  • Anonymous
    September 16, 2013
    I really wish Hyper-V Replica & Live Migration worked together nicely in the failover scenario. That is, the Live Migration & Replica worked together to take the already seeded data, and Live Migrate over and automatically reverse the Replica relationship.

  • Anonymous
    September 17, 2013
    The comment has been removed

  • Anonymous
    September 17, 2013
    Cool story Ben! But I don't believe its a little server room, I bet its way bigger than mine :)

  • Anonymous
    October 12, 2013
    Ben I'm interested in the equipment you're using at home

  • Anonymous
    April 09, 2014
    Hi Ben, When you said: Planned failover of replicated virtual machine involves logging into the "source computer." Can I to run the planned failover from failover cluster console? I cannot perform planned failover by Hyper-v Manager remotelly or Do I need to run the planned failover from owner hyper-v host from virtual machine primary?

  • Anonymous
    May 17, 2014
    The comment has been removed

  • Anonymous
    November 25, 2014
    I fully concur with Xon, it's boggling that Live Migration cannot work in conjunction with Replica or that we can't do a planned failover without shutting down the VM.

  • Anonymous
    August 01, 2017
    The comment has been removed