I believe in Hyper-V!

AdministrationCategory Archives

Hyper-V Replica [test environment]

In one of my latest post I wrote about how to install Hyper-V role inside Hyper-V virtual machine. Many of my colleagues asked me, why you do that? Actually, I have two answers. The first is: I don’t have free hardware in my company for testing purposes, and the second is; for my lectures/demos on various conferences when I talk about Hyper-V Replica (not only about Hyper-V Replica). When I have test environment on my laptop I’m pretty sure that demos will work.
So, let’s go back to the title. In one of my demos I need to do Hyper-V Replica between two Hyper-V hosts and you can see step-by-step guide in the pictures and short explanations below.

1. In this test environment I want replicate VM RHV from Hyper-V host called WD2012CORE to Hyper-V host called Hyper-VReplica. The procedure is straight forward, just follow the wizard :). Select VM which you wont replicate and select Enable Replication.

1
2

Choose on which Hyper-V host you want replicate your VM’s. As I mention before, I replicate from WS2012CORE to Hyper-VReplica Hyper-V host.

3
4

Under the Specify Connection Parameters tab can choose Authentication Type. Be default wizard offers us Kerberos authentication (HTTP), but we can use certificate-based authentication (HTTPS) if we wont secure transmission between Hyper-V hosts. Of course, if you want use certificate based authentication need to have certificate. But considering that this is test environment I chose Kerberos authentication.

5 

On the next tab select virtual disk location and click Next

6 

In my case I chose option Only the latest recovery point, but in production environment we need to have another plan, depends of your needs.

7

When you go to Choose Initial Replication Method can choose three ways how want to transfer initial copy to Hyper-V Replica server. In my case I chose option Send initial copy over the network. For my production environment is very interesting to use option Send initial copy using external media. Why this is a good solution? For example; if have very big virtual machines (I mean on big capacity) than you can send initial copy on an external media (external HDD) and take it to a remote location. In this case, does not overload the network resources if you have slow connection between two locations, like I have.

8

At the end check parameters on Summary and click Finish.
9

Log on Hyper-V Replica server and will see your replicated Hyper-V virtual machine.
10

If you want to check replica status right click on VM and you will be see Replication Health for replicated VM.
11

All above we do through GUI, but I like do that with PowerShell. So, how to replicate VM with PowerShell from Hyper-V host to Hyper-V Replica server you can see below.

PowerShell 3.0 includes 22 Cmdlets for configuring, enabling, monitoring, and managing Hyper-V Replica on an automated basis. This time I’ll be just write PS script for above mentioned example. I one of my next blog post I’ll be describe how to use PowerShell for Hyper-V Replica step-by-step.

So, in this example I replicate virtual machine WinDays13 from Hyper-V host WS2012CORE to Hyper-V host Hyper-V Replica. First I need to enable Hyper-V Replica on Hyper-V host.

1

And the second I need to enable replication for virtual machine.

2

Voila! VM WinDays13 is replicated.

3

At the end of this article I’d like to mention one very important thing! Hyper-V Replica isn’t BACKUP! We use Hyper-V Replica for a DISASTER RECOVERY.

It’s Monday, let’s get to work.

Cheers,

Romeo.

Unable to Add…/Edit…/Delete Domain Controllers computer set on TMG/ISA

This blog post isn’t related to my expertise (Virtualization), but I had this problem and want share with you!

In my domain I installed two new WS2012 domain controllers and wanted to add to the Domain Controllers under Computer Sets folder on TMG in my primary site and on ISA 2006 in my branch office. When I opened Domain Controller properties buttons Add… Edit… and Delete were dimmed.

16a

So, what to do? Follow the pictures below and you will see how to resolve that issue…

– Launch ADSI Edit from TMG Server

– Connect to localhost on port 2171 [localhost:2171] and Naming context CN=FPC2

2

– Expand CN=FPC2—>CN=Array-Root—>CN=Arrays—>CN={xxxxxxx-xxxxx-xxxx}*—>CN=RuleElements —>CN=ComputerSets

4

How to find right entry? Expand CN=ComputerSets, on the each entry open Properties until you find the right: Domain Controllers in domain in which the TMG/ISA Server is a member.

Like in the picture below.

 5a

At the same Attribute Editor mark msFPCPredefined, click on Edit and from TRUE change to FALSE.

5

Now you can Add… Edit… or Delete domain controllers as you wish.

6

Enjoy in day!

Romeo

Hyper-V Server 2012 from a USB stick

In this blog post I’ll describe how to install Hyper-V Server 2012 from a USB stick.

Hyper-V Server 2012 is the free version of Hyper-V and it offers almost all the components and features that are available in Windows Server 2012 with Hyper-V role installed.
This is very nice scenario if you want have your Hyper-V on USB stick wherever you go.
In my scenario, I have Kingston Ultimate 16GB USB stick and I’ll be install Hyper-V Server 2012 on it.
 46733-usb-stick-16gb-kingston-usb-30-datatraveler-ultimate-g2

The computer which is to run the Hyper-V needs to support boot from USB and all the Hyper-V pre-requisites, like VT, etc…
First you need to install the Windows Assessment and Deployment Kit (ADK) for Windows 8 (Former WAIK). You can download ADK from here.

Also, need to install .NET Framework 3.5 or newer version, and you need prepare Hyper-V Server 2012 installation.
When you are ready, open the Hyper-V Server 2012 image file, navigate to the Sources folder, and copy the Install.wim file to a local folder on your computer.

Prepare USB flash drive to create a bootable Hyper-V Server 2012.
Open the command prompt as an administrator to create the VHD file.
Create “boot” folder, for example Hyper-Vboot,
1
and the VHD file named Hyper-V.vhd with 10GB capacity, attach vdisk, create primary partition, assign letter, format disk, etc…
4

Apply a Hyper-V Server 2012 image

After creating the VHD file, you can apply the Hyper-V Server image using the Install.wim like in picture below.
6

Use the DiskPart tool to detach the virtual disk from your computer after applying the image.
7

Now you can attach the USB stick you want to use to be formatted and to receive the VHD file created in the previous step.
Use the DiskPart tool again to identify the USB stick disk number (UFD).
8

Select, clean, create partition and format the volume…
 9

Copy created VHD file to the M: drive where the USB stick is attached.
10

Use the BootSect tool to update the master boot code on the UFD to be compatible with Bootmgr.
12 

Use the DiskPart tool again to attach the VHD file to the M: drive.
13

Use the BCDboot tool to copy the necessary boot files so that you can boot your USB stick.
14

Disable paging & detach VHD

Paging may cause the flash device to wear out sooner. Disable paging prior to deploying the UFD. Use the following commands to load, clear, delete and unload the registry from VHD file:
15

Detach the VHD

At a command prompt, type:
16

Now you can remove the USB stick from your computer and attach it onto another computer to boot Hyper-V Server 2012. You may need to change the boot order from your computer BIOS.
At the first boot up, your bootable Hyper-V Server 2012 will be loaded and the system will prompt you to enter the new administrator password.
After the first login, Hyper-V Server 2012 will load the SConfig tool, allowing you to change settings using command-line interface. You can set up Hyper-V Server 2012 and enable remote administration to manage it, using Hyper-V Manager console from another computer.
17
18

I hope this will helpful!

Aidan Finn, thank you for reminding me for this ;)

Very important NOTE:

Quote from Aidan Finn’s blog: “Please pay careful attention: It refers to the free product Hyper-V Server 2012.  No where, I repeat … NO WHERE does it say that Windows Server 2012 Hyper-V is supported on USB.  It’ll be entirely your fault if you assume that you have support to install Windows Server 2012 on USB and enable Hyper-V.  The TechNet text only mentions Hyper-V Server 2012 and that is a different product.
If you follow the link to the USB instructions (which are dated for Hyper-V Server 2008 R2) you will see another important sentence:

The scenario described in this document is only supported for original equipment manufacturers (OEM).

In other words, it is OK for Dell, HP, etc, to install Hyper-V Server 2012 on a USB stick and ship it to you.  It is not supported if you do this for yourself.  The instructions are there; you can use them to build yourself a lab that runs from USB.  And that’s that.  Do not go building this for yourself for production support.  You have been warned.”

At the end I’d like to thanks my Virtual Machine MVP fellow Lenardo Carvalho, author of the book Windows Server 2012 Hyper-V Cookbook who helped me a lot with this great and amazing book.
Thank you mate ;)
Capture

This is my last blog post for this year. See you again in 2013. ;)

I wish you a Merry Christmas and a Happy New Year!
(and happy VIRTUALIZATION :) )

2329-merry-christmas-and-happy-new-year