· Windows Server 2012/Hyper-V installation
· Certificate based Hyper-V replication
· Virtual to physical machine conversions
· Virtual to virtual machine conversions
· VMware virtual machine backups
· VMware to Hyper-V conversions
· File Server upgrade/migration
I’ve been thinking about upgrading our File Server and Terminal Server for a while. Both the File Server and the Terminal Server are running Windows Server 2003. The servers are running from two different VMware ESXi host servers with identical versions of VMware ESXi installed (v. 3.5 update 4).
· VMware ESXi 3.5 doesn’t support a Windows Server version newer than 2008 R2
· I want to use Windows Server 2012 for the File Server and Terminal Server
· Can’t upgrade VMware ESXi to a newer version because our hardware is too old/not compatible with a new(er) version (4.0 –>)
· Hard disk space on current servers is limited –> problems upgrading because all virtual machines can’t be running on just one VMware host during the upgrade. Actually they CAN, but it will be painfully slow as the host with much disk space only has sata disks instead of scsi/sas…
· Expensive to upgrade both servers / buy new hardware
· I want a better way for virtual machine backups. Hyper-V does this nicely with replicas (or live migration without shared storage). Current VMware backup solution is pretty much manual work…
· Use Hyper-V instead of VMware – works on older hardware
· Due to hard disk space limitations I’m trying virtual to physical conversion on one of the virtual machines. This will be a temporary place (perhaps permanent…) for the machine while I’m doing the VMware to Hyper-V conversion
· This is a cheap alternative solution. No new hardware needed
VMware host server 1:
· VMware ESXi 3.5 update 4
· HP Proliant DL 180 G5
· Intel Xeon E5405@2.0GHz, 4 cores
· 16GB RAM
· Dual NIC
· 2.0TB (4 x 500GB) hard disk space in raid-5 (SATA)
· 6 virtual machines, 2 active (one will be moved to the other VMware host, the other will be converted to physical)
VMware host server 2:
· VMware ESXi 3.5 update 4
· HP Proliant ML 350 G5
· Intel Xeon E5405@2.0GHz, 4 cores
· 18GB RAM
· Dual NIC
· 730GB (5 x 146GB) hard disk space in raid-5 (SAS)
· 3 virtual machines, 2 active (will also remain active)
· Fujitsu Siemens Primergy RX 300 S2
· 2 x Intel Xeon 3.20GHz CPUs
· 4GB RAM
· 6 x 146GB SCSI hard disks in raid-5
· Dual NIC
Host server 1 is eating up quite a bit of hard disk space at the moment, mainly because of the MDT/WDS server (deployment server). My approach is converting this virtual machine into a physical machine to save disk space on current host. I’m doing it on this virtual machine as it’s not in use every day and not that critical. If I’m lucky this is the only server I have to make physical, and all the other servers will fit on one of the current VMware host servers (VMware host server 2, the faster one). Update: they did fit 🙂
I started off by installing Windows Server Backup server role on our mdt server. After that I run the Backup Once Wizard. I saved the image to a network share, and then copied the image to an external usb hard disk.
In the meantime I had prepared the old physical server (Fujitsu) for this image. I booted the server with the Windows Server 2008 R2 Boot CD and chose advanced installation options. From there I could choose to install the operating system from an earlier created image. At the same time I chose the option to install third party SCSI drivers which in my case was a must. I previously downloaded the LSI MegaRAID SCSI 320-2E drivers and copied them to an usb stick so I can use them during the image restore. After an hour or so the image was restored to the Primergy server. It booted just fine. After this I uninstalled VMware tools. Virtual-to-Physical: Success 🙂
Backing up and moving VMware virtual machines between hosts
Now that I had moved one of the active virtual machines to a physical host, I could start moving the other virtual machines from one host to another with the help of VMware Infrastructure Client and VMware vCenter Converter Standalone (Fig 1).
First off I copied the non-active powered down machines to a USB drive with VMware Infrastructure Client. After that I moved/transferred the powered-on file server to another host (during non-office hours) with the help of VMware vCenter Converter Standalone (Fig 2). This is a nice tool which does the job very well. I’ve seen it called “the poor man’s replication” which is a quite good description for the procedure. You can do the “conversion” from physical-to-virtual (P2V) or from virtual-to-virtual (V2V). The virtual machine can be switched on during the process and it will sync the changes made during the procedure afterwards. After a successful conversion, I shut down the “old” file server and powered on the “new” one on the other server. It booted just fine and I was one step closer replacing VMware ESXi with Hyper-V on this host.
Fig 1. Copying virtual machines in VMware Infrastructure Client
Fig 2. VMware vCenter Converter Standalone
Planning for Hyper-V
After triple checking all backups and doing lots of homework it’s finally time to wipe one of the VMware hosts and install Microsoft Hyper-V. The installation is rather basic, nothing special. It’s the actual Hyper-V configuration that is the interesting part. I’ve done lots and lots of testing in a virtual environment so now I hopefully know what will suit our needs. First, let me start off by saying that high availability/failover/cluster was not an option as we don’t have any shared storage (SAN, NAS…) available. I was left with the replica feature and Shared-Nothing Live Migration. I’ve tested them both in a virtual environment and they don’t work in the same way. Here are my comments about the two:
· Hosts can be in a workgroup or in a domain
· You will decide which virtual machines you will replicate (not move) to the other Hyper-V host
· Replication is done manually, but after that synchronization happens automatically
· The virtual machine has to be switched OFF when using planned failover (moving the virtual machine from one host to the other)
o Will cause a bit of downtime (depending on the size of the vm changes and network speed)
//end of own comments
“In this scenario, we define two “sites”: the “primary site,” which is the location where the virtualized environment normally operates; and the “Replica site,” which is the location of the server that will receive the replicated data. At the primary site, the primary server is the physical server that hosts one or more primary virtual machines. At the Replica site, the Replica server similarly hosts the Replica virtual machines.
Once replication is configured and enabled, an initial copy of data from the primary virtual machines must be sent to the Replica virtual machines. We call this “initial replication” and you can choose to accomplish it directly over the network or by copying the data to a physical device and transporting that to the Replica site.
When replication is underway, changes in the primary virtual machines are transmitted over the network periodically to the Replica virtual machines. The exact frequency varies depending on how long a replication cycle takes to finish (depending in turn on the network throughput, among other things), but generally replication occurs approximately every 5-15 minutes.
You can choose to move operations on any primary virtual machine to its corresponding Replica virtual machine at any time, an action we call “planned failover.” In a planned failover, any un-replicated changes are first copied over to the Replica virtual machine and the primary virtual machine is shut down, so no loss of data occurs. After the planned failover, the Replica virtual machine takes over the workload; to provide similar protection for the virtual machine that is now servicing the workload, you configure “reverse replication” to send changes back to the primary virtual machine (once that comes back online).
If the primary server should fail unexpectedly, perhaps as a result of a major hardware failure or a natural disaster, you can bring up the Replica virtual machines to take over the workload—this is “unplanned failover.” In unplanned failover, there is the possibility of data loss, since there was no opportunity to copy over changes that might not have been replicated yet.”
“With Hyper-V Replica, administrators can replicate their Hyper-V virtual machines from one Hyper-V host at a primary site to another Hyper-V host at the Replica site. This feature lowers the total cost-of-ownership for an organization by providing a storage-agnostic and workload-agnostic solution that replicates efficiently, periodically, and asynchronously over IP-based networks across different storage subsystems and across sites. This scenario does not rely on shared storage, storage arrays, or other software replication technologies”.
“For small and medium business, Hyper-V replica is a technically easy to implement and financially very affordable disaster recovery (DR) solution”.
Shared-Nothing Live Migration
· Hosts require domain membership
· You will decide which virtual machines you will migrate to the other Hyper-V host
· Migration is done manually
· The virtual machine can remain powered ON during migration
· Zero downtime when live migrating from host to host
· No backup solution, you are just moving the virtual machine from host to host
//end of own comments
“Hyper-V live migration moves running virtual machines from one physical server to another with no impact on virtual machine availability to users. By pre-copying the memory of the migrating virtual machine to the destination server, live migration minimizes the transfer time of the virtual machine. A live migration is deterministic, which means that the administrator, or script, that initiates the live migration determines which computer is used as the destination for the live migration. The guest operating system of the migrating virtual machine is not aware that the migration is happening, so no special configuration for the guest operating system is needed.”
“Live Migration is the ability to move a virtual machine from one host to another while powered on without losing any data or incurring downtime. With Hyper-V in Windows Server 2012, Live Migration can be performed on VMs using shared storage (SMB share) or on VMs that have been clustered.
Windows Server 2012 also introduces a new shared nothing live migration where it needs no shared storage, no shared cluster membership. All it requires is a Gigabit Ethernet connection between Windows Server 2012 Hyper-V hosts. With shared nothing live migration, a user can relocate a VM between Hyper-V hosts, including moving the VM’s virtual hard disks (VHDs), memory content, processor, and device state with no downtime to the VM. In the most extreme scenario, a VM running on a laptop with VHDs on the local hard disk can be moved to another laptop that’s connected by a single Gigabit Ethernet network cable”.
“One should not assume that shared-nothing live migration suggests that failover clustering is no longer necessary. Failover clustering provides a high availability solution, whereas shared-nothing live migration is a mobility solution that gives new flexibility in a planned movement of VMs between Hyper-V hosts. Live migration supplements failover clustering. Think of being able to move VMs into, out of, and between clusters and between standalone hosts without downtime. Any storage dependencies are removed with shared-nothing live migration”.
From my tests it seemed that replica was faster than live migration (at least after the initial copy). This isn’t that much of a surprise considering that the whole virtual machine has to be moved during live migration (without shared storage). When using replica there is a check to see what has been changed between the host and destination which makes it faster. Guess you could look at it in the same way as incremental backups once the initial replication has been done.
I decided to go with replication for our production environment. It suits our needs better than Shared Nothing Live Migration. It makes no sense moving the VM’s between the hosts instead of having a “spare backup” in the way that replica works. If we had a SAN in our environment, then SNLM would be a considerable option. Also, with replica I don’t have to join the hosts to the domain. There are many debates on whether you should join your hosts in a (separate) domain or if you should keep the hosts in a workgroup. I guess it all comes down to planning and your own needs. In my case I’m going with replicas which don’t require domain membership. It uses certificates instead.
Fig 3. Migrating/moving a live virtual machine after the setting has been enabled in Hyper-V settings in Hyper-V Manager. Screenshot also illustrates the “Enable Replication” option which has to be manually activated on each virtual machine you want to replicate.
Fig 4. Simulating an (unplanned) failover if the primary server brakes
I have written more about replication later on in the document (sub-chapter Setting up Replicas)
Installing Hyper-V on server 1
After all the testing and the theoretical parts comes the fun part – installation on physical hardware 🙂 Fortunately, Windows Server 2012 will detect the drivers for the server’s sas/scsi card (HP Smart Array P400) automatically so I can proceed with a normal installation.
I wasn’t in the mood for Server Core version so full version it is. The default layout looks like crap in my opinion (metro), so I start off by enabling Desktop Experience feature from Server Manager. After that I installed classic shell. Aaah, now it’s usable 🙂 After this I enabled Remote Desktop so I can do the rest remotely.
Then I’m applying local policies from Microsoft Security Compliance Manager (SCM) 3.0 for maximum security. I’m using the Windows Server 2012 Baseline for Hyper-V. I’m applying
the exported policies with the LocalGPO tool. This step isn’t necessary as we already have a good firewall (at the Computing Centre). The server isn’t visible on the external network either but it doesn’t hurt with some extra protection…
Network1: Management/Remote Access/Replication (internal).
Network2: External Access (University Network)
I also unselected “Allow management operating system to share this network adapter” on the external adapter (based on http://www.techrepublic.com/blog/data-center/set-up-your-first-windows-server-2012-hyper-v-host/ )
I don’t want to use Remote Desktop to manage the virtual machines on the Hyper-V host. Instead I prefer doing it from my workstation with Hyper-V Manager. Some tweaks (actually A LOT) have to be made and here’s an excellent guide:
I did the Remote Access tweaks manually, but I could have used a script which would have been much easier. The script is available from:
This scenario is the same as using VMware Infrastructure Client on VMware ESXi. Everything is managed from your own workstation. With this done it’s time to prepare the other server for Hyper-V and to create a new virtual machine, the new file server. More of that in the sub-chapter New virtual machine(s).
I tried to read as many documents/articles as possible for maximizing the performance on the Hyper-V hosts. In the end, I didn’t change much from the defaults. I did however change the virtual machines to use dynamic memory.
Preparing server 2 for Hyper-V / moving vm’s to server 1
Server 2 is running three virtual machines at the moment. One of these (file server) will be upgraded and the data migrated. I will write about this later on. The other two VMs (Linux webserver and a Windows Terminal Server) will be converted/moved over to Hyper-V without changes. I’m going to replace the Terminal Server with a brand new Windows Server 2012 later on, but that’s another document/story.
Anyway, back to the conversion/preparation. Here are my steps:
· Installed System Center 2012 Virtual Machine Manager with Service Pack 1 on my workstation so I could try their fancy conversion tools. I then followed this guide to be able to connect to my Hyper-V host:
I would manage just fine with only Hyper-V Manager but decided to try scvmm when it’s available for free to us via msdnaa.
· Installed the System Center Virtual Machine Manager Agent on the Hyper-V host
· Too much work – not worth it
· Tried 5nine EasyConverter instead. What a nice piece of software 🙂 Just select your desired VMware vm’s straight from the program and then select the destination Hyper-V server. Can’t get much easier than this, or so I thought…
· No go. Error with conversion process. Didn’t even start. My guess is that it doesn’t work that good with old Linux distros (it supports Linux though). Will give it another try with Windows Server 2003.
· Downloaded StarWind V2V Converter instead from
http://www.starwindsoftware.com/converter. Finally success with conversion.
· Copied the converted vhd over to server 1. Created a new virtual machine and used the vhd as hard disk. Powered it on and it worked, sort of. Did some research on the mighty Google and it turned out you have to add a Legacy Network adapter. Added that and re-configured the network from within CentOS. Success!
· Back to 5nine EasyConverter and had a go with the old Windows Server 2003 Terminal Server.
· Nope, no go. I didn’t want to use my energy on error searching/log reading this time so StarWind V2V Converter it is again. Forgot to uninstall VMware Tools before conversion, but seems to work though. Uninstalled them afterwards with the help of this article:
· Installed Hyper-V Integration Services and everything worked as normal. Success!
· Now it’s time to work on the file server (new virtual machine(s), next chapter)
New virtual machine(s)
After the preparations above I installed the soon-to-become new fileserver. Nothing special, just one virtual hard drive for the OS and another one for the files/data. I decided to try a dynamically expanding disk for the data to save precious disk space. I know this could slow things down but time will tell. I also applied the local policy for Windows Server 2012 Baseline for Fileservers and Member Servers. I installed the roles shown in Fig 5.
Fig 5. File Server server role
We only have one fileserver so DFS and Namespaces weren’t necessary. I also configured Data Deduplication immediately as I like this new feature in Windows Server 2012.
“Data deduplication involves finding and removing duplication within data without compromising its fidelity or integrity. The goal is to store more data in less space by segmenting files into small variable-sized chunks (32–128 KB), identifying duplicate chunks, and maintaining a single copy of each chunk. Redundant copies of the chunk are replaced by a reference to the single copy. The chunks are compressed and then organized into special container files in the System Volume Information folder.”
Now it was time for data migration from the old file server to the new one. I used Robocopy for this task. My steps:
· Had some help from:
but finally ran with my own switches (from the destination server):
Robocopy.exe \\source_server\dir D:\dir /S /E /Z /R:1 /W:1 /COPYALL /TEE /LOG:d:\dir\log.txt.
· Did the job just right. I tried with the /MIR switch afterwards which also did the job (checks for changed files from previous copy, or “mirrors a share”).
After migration I enabled Access Based Enumeration on the shares. Info:
Installing Hyper-V on server 2
I have now successfully migrated all of the virtual machines from VMware to Hyper-V. They are all running from server 1 so it’s time to install Hyper-V on server 2. The steps are just about the same as on server 1 so I won’t repeat my steps here. The steps for Remote Access are however a lot easier when you have done the client-part already…
Setting up replicas
With both servers running Hyper-V it was now time to think about replica so I could have a disaster plan. I enabled replica on BOTH hosts, Fig 7, (as described earlier in the chapter Planning for Hyper-V). Just to enable replication wasn’t enough because my servers are in a workgroup environment. I did some further configuration with certificates.
Fig 7. Enabling Replication
Here’s an excellent guide I followed for certificate setup:
“Building Free Hyper-V 3 Replica Step by Step Guide in Workgroup Mode”:
The guide seems to be based on technet’s article “Prepare to Deploy Hyper-V Replica”:
I didn’t add any dns-suffixes though; instead I used host names in
Do remember to enable the replication on both Hyper-V hosts so the replication direction can be reversed.
With the certificates done I could finally start replicating. You can choose three different initial replication modes. They are:
· Send initial copy over the network
· Send initial copy using external media
· Use an existing virtual machine on the Replica server as the initial copy.
I chose to send initial copy using external media instead of using up network bandwidth (and time). Just right-click on the virtual machine you wish to replicate and choose “enable replication”. After that a guide will pop up with the different initial replication modes. When the initial replication is done (in my case), you just eject the usb drive and move it over to the other hyper-v host/replication partner. From that host you right-right click on the same virtual machine and choose Replication -> Import Initial Replica (Fig 8). From here on the replication will happen over the network every 5 minutes (not configurable). I did the same thing with all three of my virtual machines.
Fig 8. Import initial replica
“From this point onwards the VM is protected and will allow operations like Failover and Test Failover.”
I noticed that my initial replication was stated as Replication Health: Warning
Turned out that this was nothing to worry about, it will go to normal when initial replication has been done.
“The Replication Health is shown as Warning when the replication is ‘not optimal’. The conditions which would result in a Warning health include:
· 20% of replication cycles have been missed in a monitoring interval – Common reasons which lead to this condition include insufficient network bandwidth, storage IOPS bottleneck on your replica server.
· More than an hour has elapsed since the last send replica (on the primary VM) was sent or the last received replica (on the replica VM) was received – This could result in a loss of more than 60mins worth of data loss if the replica VM is failed over (due to a disaster)
· If Initial Replication has not been completed
· If Failover has been initiated, but ‘reverse replication’ has not been initiated
· If the primary VM’s replication is paused.”
Now I did a planned failover (on primary server) from server 1 to server 2, as server 2 was going to be the new “primary home” for the virtual machines (Fig 9). This should NOT be confused with just “failover” (done on secondary server) which is only used in emergency situations (Fig 10).
Fig 9. Planned Failover
Fig 10. Failover
The reason for my failover (or “server switching”) is because server 2 is faster than server 1 (SAS HDDs). Here are my (easy) steps:
· Turn off the virtual machine(s) that will be “victim(s)” for planned failover (can’t be turned on, see Fig 11)
Fig 11. Bummer!
· Initiate the planned failover
o Will actually replicate quite fast (only changes)
o Short downtime
· Primary server changes from server 1 to server 2
· Same thing on all three virtual machines (or just the ones you prefer)
· Reconfigure vm networking on the new host if needed
· Awesomeness and success 🙂
Here are some more screenshots from failover and replication:
Fig 12. Waiting for virtual machine to fail over.
Fig 13. Health checking on one of the virtual machines. Everything is ok!
That’s it; VMware is now replaced by Hyper-V! I know a lot more now than I did before I started this little project. Best of all, everything is working just the way it was intended 🙂
At the moment I have two of the virtual machines running from server 2 and one from server 1 just to even out the load a bit.
Stay tuned for more posts!
Mentioned in the text