Upgrading Windows Server 2012 to Windows Server 2012 R2 on Hyper-V hosts

Introduction

I recently did a VMware to Hyper-V migration on two of our virtualization hosts. Everything has been working great, but now that Windows Server 2012 R2 is out I decided to give it a try. There are also cool new features in the new Hyper-V version, so why not upgrade. Here’s a link for 10 great new features in Windows Server 2012 R2 Hyper-V:

http://www.infoworld.com/slideshow/104337/10-great-new-features-in-windows-server-2012-r2-hyper-v-220067

For me, the most interesting features are VM Direct Connect and Copy / Paste between Host and VM via Shared Clipboard. Online VM exporting and cloning & Online VHDX resizing also seems like usable features.

 

 

Upgrade

Enough with the features, it’s time to upgrade! As usual I started out in a virtual test environment. The process was actually very easy and pain-free. Here are my steps:

 

· Inserted/mounted Server 2012 R2 media

· Chose upgrade

· Windows ran its own Windows Compatibility Report

· Told me to reboot

· I also received the following notification:

“Setup has detected one or more virtual machines which are part of a replication relationship. To avoid replication failures, upgrade the Replica server before upgrading the primary server. Once the Replica server is upgraded, any uncommitted failover operations will be committed, test failover virtual machines will be deleted, and the recovery history of the Replica virtual machines will be deleted. Setup has detected that one or more virtual drives are directly attached to physical devices. You might need to reconnect the virtual drives to these devices after the upgrade is complete”.

 

· I did a planned failover on one of the virtual machines on the replica server and then resumed the setup. Now every virtual machine had the same primary server.

· Upgraded the replica server. Upgrade went fine, no problems with virtual drives directly attached to physical devices. (Nothing to worry about, apparently it has to do with connected/mounted .iso to vm’s:

http://social.technet.microsoft.com/Forums/windowsserver/en-US/2d669709-f7d0-4bdc-974b-e0f5ab5552df/warning-compatibility-issue-during-upgrade-von-2008-r2-to-2012)

· One of the virtual machines had problems with replication (Fig 1) after the upgrade: 

 

clip_image002

 

Fig 1. Replication health

 

 

From event viewer:

 

Could not replicate changes for virtual machine ‘server 2012 r2’ as the Replica server ‘hyper1’ on port ‘443’ is not reachable. The operation timed out (0x00002EE2). (Virtual Machine ID 54519BBA-5127-4D5E-B9C3-D988BB6591F7)

 

Nothing critical, the server was just not able to replicate when the other server was down due to the upgrade. I reset the statistics and resumed replication. Everything went back to normal.

 

Now it was time to upgrade the other server, which basically follows the same concept. Just to test, I didn’t even shut down the virtual machines before the upgrade. The Server setup was smart enough to tell me to shut down the virtual machines before attempting an upgrade however. I was also told to restart the server before upgrading. I did both and resumed setup. As this server was the primary server and not the replica server, I could ignore the message about first upgrading the replica server (already done).

 

That’s it. It was really that simple 🙂

 

 

Production environment

The upgrade procedure in the production environment was obviously about the same as in the virtual test environment. Here are my steps:

 

· Shut down the virtual machines on the Hyper-V host

· Paused replication on both Hyper-V hosts. This way I didn’t have to worry about which server was primary and which was replica. (I didn’t find any information about this online so I just tested this theory. Worked great 🙂 )

· Ran the upgrade

· A bit of waiting (about 30 min in total, Fig 2)

 

clip_image004

 

Fig 2. Upgrading…

 

· Everything went fine on the first Hyper-V host

· …and also on the second 🙂

· Upgraded Hyper-V Integration Services in the virtual machines

· Resumed replication and did a reset on the replication statistics. Have some patience, replication will start automatically within a couple of minutes after this.

· Success, everything is back to normal except now I’m running Windows Server 2012 R2 instead of Windows Server 2012 (Fig 3) 🙂

 

clip_image006

 

Fig 3. Windows Server 2012 R2

 

 

Post installation tweaks

As this was an upgrade installation, Windows left its old installation in “Windows.old”. I’m only running the Hyper-V server role on these servers so I don’t need any of the old files as the servers are working just fine. To remove Windows.old, follow these steps:

 

· Enable Disk Cleanup Utility in Windows Server 2012 R2

· Run Disk Cleanup Utility and remove “Previous Windows Installations & Windows Upgrade log files”

· Done

 

Sources:

http://thenrml.wordpress.com/2013/06/26/remove-windows-old-after-using-in-place-upgrade-method-on-windows-server-2012-r2-preview/

http://blogs.technet.com/b/chad/archive/2012/10/08/tip-51-cleanup-on-isle-3-get-back-disk-cleanup-wizard-on-windows-server-2008-amp-2012.aspx

 

 

I also re-enabled ping (Echo request – ICMPv4) in the firewall as it was disabled by the upgrade.

 

 

Advertisements

Migrating from VMware to Hyper-V (including File Server Migration)

Topics covered: 

 

· 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

 

 

Introduction

 

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).

 

Current problems:

· 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…

 

Solutions:

· 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

 

 

Current hardware

 

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)

 

Old server:

· 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

 

 

 

Preparation

 

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.  

 

clip_image002

 

Fig 1. Copying virtual machines in VMware Infrastructure Client

 

 

clip_image004

 

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:

 

Replica

 

· 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

 

//Begin quote

“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.”

 

Source: http://technet.microsoft.com/en-us/library/jj134172.aspx

 

More information:

 

“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”.

 

clip_image006

“For small and medium business, Hyper-V replica is a technically easy to implement and financially very affordable disaster recovery (DR) solution”.

 

Source: http://blogs.technet.com/b/yungchou/archive/2013/04/21/mad-about-windows-server-2012-in-7-ways.aspx

 

//End quote

 

 

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

 

//Begin quote

“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.”

 

Source: http://technet.microsoft.com/en-us/library/hh831435.aspx

 

More information:

 

“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”.

 

clip_image008

 

“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”.

 

Source: http://blogs.technet.com/b/yungchou/archive/2013/04/21/mad-about-windows-server-2012-in-7-ways.aspx

 

//End quote

 

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. 

 

clip_image010

 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.

 

 

clip_image012

 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)

 

Sources:

http://www.virtualizationadmin.com/articles-tutorials/microsoft-hyper-v-articles/networking/working-replicas-hyper-v-30-part1.html

 

http://blogs.msdn.com/b/mvpawardprogram/archive/2012/11/05/windows-server-2012-hyper-v-high-availability-without-a-san.aspx

 

http://www.youtube.com/watch?v=BDbPcGGTYmw&list=PLB0C0DCC004458603&index=3

http://www.aidanfinn.com/?p=12147

http://www.altaro.com/hyper-v/live-migration-in-hyper-v-explained-part-1/

http://blogs.technet.com/b/yungchou/archive/2013/01/10/hyper-v-replica-explained.aspx

 

 

 

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…

 

Network setup

 

Virtual Switches:

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/ )

 

Remote Access

 

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:

http://blogs.technet.com/b/jhoward/archive/2008/03/28/part-1-hyper-v-remote-management-you-do-not-have-the-requested-permission-to-complete-this-task-contact-the-administrator-of-the-authorization-policy-for-the-computer-computername.aspx

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:

http://code.msdn.microsoft.com/windowsdesktop/Hyper-V-Remote-Management-26d127c6

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).

 

Tweaking

 

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.

Sources:

http://blogs.technet.com/b/askpfeplat/archive/2013/03/10/windows-server-2012-hyper-v-best-practices-in-easy-checklist-form.aspx

 

 

 

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:

http://technet.microsoft.com/en-us/library/gg610642.aspx

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:

http://social.technet.microsoft.com/Forums/windowsserver/en-US/6a441588-24fd-4f39-9cbc-5d028fec7c41/hyper-v-and-vmtools-setup-failed-to-detemine-which-vm-product

· 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.

 

clip_image014

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.”

Sources:

http://technet.microsoft.com/en-us/library/hh831602.aspx

http://technet.microsoft.com/en-us/library/hh831700.aspx

http://blogs.technet.com/b/uspartner_ts2team/archive/2012/10/08/data-deduplication-in-windows-server-2012.aspx

 

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:

http://www.edugeek.net/forums/how-do-you-do/90602-robocopy-help.html

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:

http://heineborn.com/tech/enable-access-based-enumeration-in-windows-server-2012/

 

I also enabled Shadow Copies of the shared folders so I could take advantage of previous versions of files.

 

“Shadow Copies of Shared Folders provides point-in-time copies of files that are located on shared resources, such as a file server. With Shadow Copies of Shared Folders, users can view shared files and folders as they existed at points of time in the past. Accessing previous versions of files, or shadow copies, is useful because users can:

 

· Recover files that were accidentally deleted. If you accidentally delete a file, you can open a previous version and copy it to a safe location.

· Recover from accidentally overwriting a file. If you accidentally overwrite a file, you can recover a previous version of the file. (The number of versions depends on how many snapshots you have created.)

· Compare versions of a file while working. You can use previous versions when you want to check what has changed between versions of a file.”

 

Sources:

http://technet.microsoft.com/en-us/library/cc771305.aspx

http://technet.microsoft.com/en-us/library/cc771893.aspx

 

Now that deduplication was enabled, I had a look at the “statistics”. It was indeed doing its job, here’s a screenshot of the space savings (45% or 69,1GB):

 

clip_image016

 

Fig 6. Deduplication

 

 

 

 

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.

 

clip_image018

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”:

http://jsmcomputers.biz/wp/?p=360

The guide seems to be based on technet’s article “Prepare to Deploy Hyper-V Replica”:

http://technet.microsoft.com/en-us/library/jj134153.aspx

 

I didn’t add any dns-suffixes though; instead I used host names in

c:\windows\system32\drivers\etc\hosts

 

Do remember to enable the replication on both Hyper-V hosts so the replication direction can be reversed.

Source: http://technet.microsoft.com/en-us/library/jj134240.aspx#BKMK_2_4

 

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.

 

clip_image020

Fig 8. Import initial replica

 

“From this point onwards the VM is protected and will allow operations like Failover and Test Failover.”

Source: http://blogs.technet.com/b/virtualization/archive/2013/06/28/save-network-bandwidth-by-using-out-of-band-initial-replication-method-in-hyper-v-replica.aspx

 

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.”

 

Source: http://blogs.technet.com/b/virtualization/archive/2012/06/15/interpreting-replication-health-part-1.aspx

 

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).

 

clip_image022

Fig 9. Planned Failover

 

 

clip_image024

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)

 

             clip_image026

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:

 

clip_image028

Fig 12. Waiting for virtual machine to fail over.

 

 

clip_image030

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! 

 

 

 

Sources

 

Mentioned in the text

 

 

 

Building a small Windows Server 2008 R2 cluster

Note: This document was written in Word back in February 2012. I’m just posting it now when I’ve entered the blogging area Smile

 

I had some old servers and some spare computers so I decided to build a test cluster with both physical and virtual servers. My main goal was to test out Microsoft’s Hyper-V virtualization solution as I’ve been working with VMware ESXi until now. I also wanted to try out System Center Configuration Manager 2007 as it is a very useful piece of software.

 

The following configurations were used:

 

Hardware:

 

Rack servers

 

primergy1: Domain Controller, DNS, DHCP

 

·         Fujitsu Siemens Primergy RX300 S2

·         2 x Intel Xeon 3.20GHz CPUs

·         4GB RAM

·         Dual NIC

·         6 x 146GB SCSI HDDs in hw raid-5

·         Windows Server 2008 R2 Enterprise SP1

 

 

primergy2: Storage Server (iSCSI)

 

·         Fujitsu Siemens Primergy RX300 S2

·         2 x Intel Xeon 3.20GHz CPUs

·         4GB RAM

·         Dual NIC

·         6 x 146GB SCSI HDDs in hw raid-5

·         Windows Storage Server 2008 R2 Enterprise SP1

 

 

primergy3: System Center Virtual Machine Manager 2008 R2

 

·         Fujitsu Siemens Primergy RX200 S2

·         2 x Intel Xeon 3.20GHz CPUs

·         4GB RAM

·         Dual NIC

·         2 x 146GB SCSI HDDs in hw raid-1

·         Windows Server 2008 R2 Enterprise SP1

 

Hyper-V servers

 

hyperv1:

·         Intel Core 2 Duo 2.33GHz

·         8GB RAM

·         Dual NIC

·         250GB SATA HDD

·         300GB mounted iSCSI Clustered Disk space from primergy2

·         Windows Server 2008 R2 Enterprise SP1

 

VM1: System Center Configuration Manager 2007 r3 (sccm)

Windows Server 2008 R2 Enterprise SP1 as OS

 

VM2: Windows 7 64 bit (win7client1)

 

VM3: Windows Server 2008 R2 Enterprise (failovertest, running from iSCSI clustered disk)

 

 

hyperv2:

·         Intel Core 2 Duo 2.13GHz

·         4GB RAM

·         Dual NIC

·         300GB SATA HDD

·         300GB mounted iSCSI Clustered Disk  space from primergy2

·         Windows Server 2008 R2 Enterprise SP1

 

VM1: System Center Operations Manager 2007 R2 (scom)

Windows Server 2008 R2 Enterprise SP1 as OS

 

 


 

Software:

 

Windows Server 2008 R2 Enterprise SP1

Windows Storage Server 2008 R2 Enterprise SP1

Windows 7 SP1 64 bit

 

Microsoft Hyper-V with failover clustering

System Center Configuration Manager 2007 R3

System Center Virtual Machine Manager 2008 R2

System Center Operations Manager 2007 R2

Microsoft SQL Server 2008 R2 Enterprise

Microsoft SQL Server 2005 Express

Microsoft iSCSI Software Target

 

 

image

Fig 1. The cluster

 

 

image

Fig 2. Cluster network diagram

Fig 1 above shows you a picture of the actual cluster and fig 2 shows a picture of the network diagram showing the actual connections between different servers.

 

 

Primergy 1  (2, 3 later)

The project started with OS installation on the three Fujitsu Siemens rack servers. These servers are not able to handle virtualization so they can only run one (Windows) OS per server, Windows 2008 R2 Enterprise in my case. These servers were designed back in the days when Windows 2008 wasn’t even in beta stage, and the installer had problems detecting the onboard SCSI card. Luckily I was able to download some drivers (available only for Windows Server 2003 and older) that worked and I got the servers up and running quite fast. I then run Windows update on all of them to ensure they were up to date even if it was only for test lab usage.

 

Now it was time for some cabling and configuration of the network. I hooked up all the three servers to a gigabit switch for internal communication. I started configuring primergy1 as it would become the Domain Controller. I enabled Active Directory Domain Services, DNS Server and DHCP Server roles.  The servers were configured with the following static configurations:

 

Network interface 1 (internal network):

Primergy1:                         Primergy2:                         Primergy3:

IP: 10.10.1.201                    10.10.1.202                         10.10.1.203

Subnet: 255.255.255.0        255.255.255.0                     255.255.255.0

DNS: 10.10.1.201                10.10.1.201                         10.10.1.201

 

I had previously changed the server names so now I just joined primergy2 and primergy3 to the domain. My domain is called jgs.test. I didn’t install anything on primergy2 and primergy3 just yet. I’ll get back to those servers later on.

I wanted to create only an internal domain network so I wouldn’t mess around with other (external) networks. When the internal network was configured I added an extra network cable to primergy3 for external access with RDP. Primergy3 is used to administer the whole cluster. I use RDP from that server to access all of the other nodes/servers/machines on the internal network. Configuration for second NIC on the primergy servers:

 

Network interface 2 (external network):

Primergy1:                         Primergy2:                         Primergy3:

Not connected                    Not connected                    DHCP

Set to obtain 192.168.17.203 from an external dhcp server

 

 

Hyperv1, 2

Now it was time for Hyper-V server installations. I started by installing Windows 2008 R2 Enterprise on both servers. After the installation I enabled the Hyper-V role (and the failover feature which I will try later on). I hooked up both servers to the gigabit switch with the other servers for internal communication. The servers were configured with the following static configurations:

 

Network interface 1 (internal network):

Hyperv1:                            Hyperv2:                           

IP: 10.10.1.205                    10.10.1.204

Subnet: 255.255.255.0        255.255.255.0

DNS: 10.10.1.201                10.10.1.201

 

Network interface 2 (external network):

Hyperv1:                            Hyperv2:                           

DHCP                                  DHCP

192.168.17.205 from          192.168.17.204 from

an external dhcp server     an external dhcp server

 

Now I joined the servers to the domain. After this it was time to configure networking in the Hyper-V manager on both servers. The configurations are almost identical on both servers so I’ll only write about hyperv1. I know that you should use dedicated physical network adapters for different tasks in the cluster, but as this is only a test scenario and not a production environment, I’ll settle for two adapters per host.

I started Hyper-V Manager and went to Virtual Network Manager. This is the place for all networking options in Hyper-V. You have to create virtual networks for the virtual machines. The network(s) can be external, internal or private. I chose external as I wanted to use the network cards for external communication. I built one virtual network for internal usage (10.10.x.x, domain) and one for external usage (192.168.x.x). Both were set as external in Virtual Network Manager though. In the beginning of each virtual machine installation I chose the external network as default. I chose this option because I want all of the new installations to be able to access the internet at first. This is mostly for updates and activation. After updates and activation, I switch over from external to internal network.

Now it’s time for the actual virtual machines to be installed. This is quite straight forward, at least in my configuration, as I have all of the virtual machines stored locally on disk. (I have now expanded my configuration and tried failover configuration with shared storage. I’ll write more about that later on).

Right click on the server name in Hyper-V Manager and choose new virtual machine. Follow the guide and install either from disk image (.iso) or from physical cd/dvd-rom. All options are rather self explanatory. Remember to choose the right network settings and you are good to go. Below is a screenshot of Hyper-V Manager:

 

clip_image002

Fig 3. Hyper-V Manager

 

Virtual Machines

 

System Center Configuration Manager 2007 r3 (sccm, on hyperv1)

I installed a new virtual machine on hyperv1 called sccm. I installed Windows Server 2008 R2 Enterprise as the base in this machine as this was required for sccm. I then followed guides for both sccm installation and configuration. The installation guide I followed is called Install SCCM 2007 on Windows Server 2008 R2 – Step by Step and can be found at: http://www.petenetlive.com/KB/Article/0000297.htm. Thanks to the author for the guides! I’ll try to recap the guides in a couple of steps.

 

1.      Create sql and sccm domain admin accounts in Active Directory on the Domain Controller (primergy1).

 

2.      Install IIS server role on the sccm server. Add a couple of IIS Role Services and Server Features.

 

3.      Go to Server Manager and configure WebDAV. Lots of permission options.

 

4.      Install SQL Server 2008 R2. Tick Database Engine Services. Tick Management Tools (Basic and Complete).

 

5.      Use the sql admin/sccm admin account created earlier for service accounts.

 

6.      Prepare Active Directory for sccm -> Extend Active Directory Schema on the Domain Controller. From the sccm install media > SMSSETUP > BIN > 1386 > extadsch.exe.

 

7.      Create some Active Directory objects go to a domain controller > Start > Administrative tools > ADSI Edit > Action > connect to. Lots of options, but most important is to allow your sccm-server (sccm) and sccm-admin Full Control.

 

8.      Install SCCM. Follow the guide. Apply sccm updates.

 

9.      That’s it. Now it’s time to configure sscm. I followed yet another guide from the same website. It’s called SCCM 2007 Initial Setup and Configuration. It can be found at: http://www.petenetlive.com/KB/Article/0000300.htm

 

10.  Just followed the guide. Note to self: worked pretty well except for some permission problems in sccm (the sccm client wouldn’t install on client computers). This was due to missing permissions in System Center Configuration Manager – Site Database – Central Site – Site Settings – Client Installation Method – Client Push Installation – Properties. Added a domain administrator account with more rights than the sccm-admin account and everything worked fine.

There was also a permission error on the Domain Controller. In Active Directory Users and Computers – System – System Management – Properties – Security, make sure that the computer “sccm” has Full Control.

BIG thanks to by friend Mats Hellman for these tips (and all other tips).

 

I now have a working sccm environment. I‘ve (push) installed sccm clients to all the servers and computers. My next step is to create installation packets for software installations. After that I’ll probably look at whole operating system installations via PXE. Below you have a screenshot of sccm in action:

 

clip_image002[4]

 

Fig 4. System Center Configuration Manager 2007

 

 

Windows 7 64-bit (win7client1, on hyperv1)

I installed a new virtual machine on hyperv1 called win7client1. I installed Windows 7 64-bit as operating system. I joined the machine to the domain and disabled the firewall so that the sccm client could be installed without problems. I pushed the sccm client from the sccm server to this client. That’s it for this machine (for now).

 

Windows Server 2008 R2 Enterprise (failovertest, on hyperv1)

This virtual machine was installed to test the failover cluster configuration within Hyper-V. More about that later on.

 

System Center Operations Manager 2007 R2 (scom, on hyperv2)

This virtual machine gets installed after primergy2 and primergy3. I’ll get back to this one later in the document.

 

 

Primergy 2

As I said before, the project started with OS installation on the three Fujitsu Siemens rack servers, including Primery2&3. Windows Server 2008 R2 Enterprise SP1 was already installed on this server and all I had to do was to install the iSCSI component. There’s a very good guide for this called How to setup iSCSI on Windows Server 2008, available from:

http://technet.microsoft.com/en-us/edge/Video/ff710316

 

I’ll try to recap my steps:

 

1.      Start Microsoft iSCSI Software Target from Administrative Tools

2.      Create two new ISCSI Targets called iscsi-target1 and iscsi-target2. I made two targets because you can’t share the same target on the (hyper-v) servers if they aren’t configured as a failover cluster. I haven’t looked into this just yet, so I’m fine with having a separate iSCSI target for each server.

3.      Give the IP-address/host for the initiator, IQN Identifier (the computer that will connect to this ISCSI target).

4.      Create a virtual disk for iSCSI target. One for each target in my case.

5.      Go to the server/computer that will “mount” the iSCSI drive. Go to administrative tools and start iSCSI Initiator.

6.      Go to the discovery-tab and enter IP-address for the iSCSI target server. In my case 10.10.1.202. It should now discover the iSCSI target. Others steps are in the guide.

7.      Format the new drive. It can now be used as a normal hard drive attached to the computer.

Note: I had “offline” problems on one of the hyper-v servers. It got fixed by following the steps on: How to change default SAN disk status from offline to online

http://social.technet.microsoft.com/Forums/en-US/winserverfiles/thread/c14bdde3-6359-463d-9932-5fe7ec72505e

8.      I now have an iSCSI disk on both hyper-v servers. I’m going to install my next virtual machine on this drive instead of local storage just for the fun of it.

9.      Later on I created new targets for use with failover clustering.

 

Below you have a picture of the Microsoft iSCSI Software Target main window.

 

clip_image004

Fig 5. Microsoft iSCSI Software Target

 

 

Primergy 3

It was now a suitable time to install System Center Virtual Machine Manager 2008 R2 because it is dependent on the Hyper-V servers. Quote from Microsoft’s own site:

System Center Virtual Machine Manager 2008 R2 helps enable centralized management of physical and virtual IT infrastructure, increased server utilization, and dynamic resource optimization across multiple virtualization platforms. It includes end-to-end capabilities such as planning, deploying, managing, and optimizing the virtual infrastructure.

 

Nothing complicated about this installation. Windows Server 2008 R2 Enterprise SP1 was already installed on this server and now I just installed System Center Virtual Machine Manager 2008 R2 (SCVMM).  SCVMM requires sql so I installed the bundled Microsoft SQL Server 2005 Express Edition. Later on you enter the servers you want to administer, in my case hyperv1 and hyperv2. From here on, you can add or remove virtual machines from scvmm instead from the local hyper-v servers. Small installation guide if needed:

http://blogs.technet.com/b/scvmm/archive/2009/01/05/scvmm-2008-installation-step-by-step.aspx

 

Below is a screenshot from System Center Virtual Machine Manager 2008 R2 displaying connections to hyperv1 and hyperv2:

 

clip_image006

Fig 6. System Center Virtual Machine Manager 2008 R2

 

 

System Center Operations Manager 2007 R2, continued (scom, on hyperv2)

Last but definitely not least we have System Center Operations Manager 2007 R2. I saved this one for last because it’s more or less dependent on all other machines. It is “just” a (health) monitoring tool for all my virtual and physical servers/machines. In my initial configuration I had this one as a fourth physical server but it turned out that the server had some hardware problems L

 

I installed a new virtual machine on hyperv2 called scom. I installed Windows Server 2008 R2 Enterprise as the base operating system in this machine as it was required for sccm. I then joined it to the domain and installed SQL Server 2008 R2 as a SQL server was required for scom. At the time scom 2007 was released, there wasn’t support for SQL Server 2008 R2. No problem though, I just had to do some small tweaks before the scom installation. A good guide for this, Installing SCOM 2007 R2 on SQL 2008 R2, is available at:

http://systemcenterdynamics.wordpress.com/2011/01/12/installing-scom-2007-r2-on-sql-2008-r2/

After doing all the tweaks, the installation went just fine. After that I just fired up the application and did some required configuration settings. You can do/monitor A LOT with scom, but the initial configuration was more than enough for my little cluster test. Below is a screenshot of System Center Operations Manager 2007 R2:

 

clip_image008

 

Fig 7. System Center Operations Manager 2007 R2

 

 

 

 

Hyper-V Failover Clustering

 

Lastly I decided to try out Failover Clustering with Hyper-V. I went to Server Manager and enabled the Failover Cluster feature. I then followed a guide called Creating Hyper-V Failover Cluster (Part 1), available from:

http://blog.frankovic.net/2010/04/creating-hyper-v-failover-cluster-part-1/

I had already done the preparation work like setting up Windows 2008 Storage Server for iSCSI. I followed the guide and created two iSCSI Targets called “Storage” and “Quorum”. I added the disk resources to hyperv1 and hyperv2 (with help from the guide). With this part done, it was now time to create the actual failover cluster. Firstly I started the Failover Cluster Manager and validated my configuration which passed the test.

I then started Hyper-V console and created a new virtual machine. I didn’t start it just yet. I then minimized Hyper-V console and maximized Failover Cluster Manager. I right clicked Services and applications and selected Configure a Service or Application. I chose virtual machine from the bottom of the list and clicked next. I selected my newly created machine and clicked next. This virtual machine is now configured as highly available. I restored Hyper-V console and started up my virtual machine. It now installed Windows Server 2008 R2 as a new highly available virtual machine. That’s it for installation.

My cluster is now able to migrate the virtual machine “failovertest” from one node to another.

 

 

clip_image010

 

Fig 8. Failover Cluster Manager

 

 

 

Final words…

 

That’s it for now. This has been a really fun project and I’ve learned a lot on the way. Hyper-V turned out to be really easy to use and a fair competitor to VMware. System Center Virtual Machine Manager 2008 R2 supports both Hyper-V and VMware hosts so you can manage everything from one platform which is a very nice solution.

 

I will look more into System Center Configuration Manager 2007 (sccm), as it is an interesting and very useful product.

 

Big thanks to Mats Hellman for helping me out with problems on the way and for giving me ideas on what kind of infrastructure to build for this small scale test environment.

 

 

 

Sources

 

Mentioned in the text.