3056_hyper-v2-large-msg_thumb_0D8890ECFor some reason when I woke this morning I was thinking about patching servers and how virtualization can easily minimize the maintenance window or downtime. I usually awake thinking about my gorgeous wife and I know if I wrote about that it would make for more interesting reading; however, there are other sites for that. I am going to stay with my “Information Technology”  theme.

So if I have a site up like this blog and I want to avoid all downtime; how do I accomplish that?

Well I can reduce downtime by making a copy of my machine. Patching that copy and then swapping out the patched machine for the original. This is not quite what I want but simple to accomplish. Here are steps you can use to accomplish this: First use the free tool Disk2vhd.exe. I would run this tool to make a vhd copy of a live machine. It works on real hardware to create a Virtual Machine and it can run inside a VM to make a copy of that machine. You may be asking why don’t you just copy the actual vhd file of the running server. You can do that but you would have to shutdown the server and then copy the file because it is locked while the server is running. In the next version of Hyper-V you can just have it create a copy but in Server 2008 R2 use Disk2vhd. You can get disk2vhd from here: http://technet.microsoft.com/en-us/sysinternals/ee656415

Now that I have a copy of the server I can start the machine either on a different network or without a network and patch the machine. Once I am done with that machine and I have tested that it works. I can take the production machine off of the network and place this updated machine on the network. It will start servicing requests with very little downtime. Wait! I want no downtime and this has downtime. Not only does it have some downtime it also could lose data! For example on my blog I could lose comments and blog posts that are entered after I make my copy and before I put the newly patched machine back online.

Ok – let’s look at how to do this with absolutely no downtime. The way this has been accomplished in the past, in the physical world, was by clustering the database and using front end servers that are load balanced. So with a minimum of 4 servers I can achieve zero downtime. In the real world that costs a lot. Well in the virtual world it doesn’t. What it does take is a little more configuration. First you need to load balance your front end servers. Then you can take down one of your front end servers and patch it. You put it back into service and then do the same with the other. Front ends patched with no downtime. Next you take one of your database server. The database servers can be running with shared storage or with database mirroring. As you take one out of production the other continues to run. Absolutely zero downtime and zero data loss.

To load balance your front end servers nothing works better than a layer 7 switch. But those things cost lots of money. You can just have your layer 7 switch in a virtual machine. Now that is pretty cool! As a matter of fact in the next version of Hyper-V the network will have that infrastructure built into the virtual network.

What about when you need to patch the Hyper-V host? To patch the host that runs the VMs you can move these VMs to another host and then patch the host before moving them back. Today you need to cluster your Hyper-V hosts to accomplish this. In the next version of Hyper-V won’t need to have a cluster for this. You can storage migrate your VMs to another Hyper-V host – all without a cluster. Cool!

Wouldn’t it be cool t have a way to make these things happen automatically? There already is! It is called System Center Virtual Machine Manager. Using the SCVMM you can manage all of your VMs and copy them while running. Move them to another machine and more. If you are interested in taking a look at System Center 2012. Download it here: http://aka.ms/blog1

If you don’t have Server 2008 R2 with Hyper-V you can download the trial here: http://aka.ms/blog2

Lastly if you want to download the free Hyper-V server you can find that here: http://aka.ms/blog3