Build a two node hyperv 2012 no share live migration “Cluster”

In this post I’ll describe the steps to build a two node “cluster”. Why cluster is between quotes, it’s simply because we will not use the clustering features of MS and you’ll neither have fault tolerance with this infrastructure but you’ll be able to live migrate manually VM between two hosts.
To build this infrastructure I’ll use my lab environment which is a normal computer (8cpu, 32GB, 3To) under win7 with VMWare workstation tech preview.

  • Infra01 :
    1,5GB
    2 CPU
    40GB
  • Hyperv01 et Hyperv02
    10GB
    4CPU
    40GB
    Path

To install the VM I’m using the unsuported HyperV os version.
screen02

Then install Windows Server 2012. As I explained in a previous post I prefer to install my server with the full GUI version and then after configuration disable it. So :

screen03

Then it’s a normal install.
Install VMTools
Rename your servers

Set network :

With Cmd

netsh interface ip set address name=Ethernet static 10.0.0.2 255.255.255.0
 netsh interface ip set dns name=Ethernet static 10.0.0.1

Or PowerShell

Get-NetIPAddress
Set-NetIPInterface –InterfaceAlias Ethernet –DHCP Disabled
New-NetIPAddress –InterfaceAlias Ethernet –IPAddress 10.0.0.10 –PrefixLength 24
Set-DnsClientServerAddress –InterfaceAlias Ethernet –ServerAddresses 10.0.0.1

Disable Firewall :
Set-NetFirewallProfile -Enabled False

Install HyperV :

screen04

Install-WindowsFeature Hyper-V

and if you also want the management tools

Install-WindowsFeature RSAT-Hyper-V-Tools

I asked myself a question. Can I build a standalone infrastructure, I mean not joined to an Active Directory Domain like I can do with Esx Servers ? Well you can with … 1 server but if you want to migrate VM without joining HyperV to domain u’ll have this kind message :

screen05

So now join your HyperV server to your domain :

Add-Computer –DomainName myLab.local –Credential myLabAdministrator –Restart

Then we are going to configure Hyper-V settings.
I think you don’t want to host VM and VHD on your C drive so :

set-VMHost –VirtualHardDiskPath E:HYPERVVHD –VirtualMachinePath E:HYPERVVM

If you want to do it on HYPERV02 you can connect directly to it or do it remotly like :

New-PSSession –ComputerName HYPERV02
Enter-PSSession –Id 1

# and then use the same configuration line. This will avoid copy error and different configurations.

screen08

Configure VsWitch :

External

Then we need to configure live migration settings. If you go to the settings with the UI you’ll see that there are two configurations :

screen09

I’ll not go in detailed security things here but basically the difference here is that with CredSSP you’ll have to do all your management tasks from a HyperV host and that’s not really what I want here.

So choose kerberos Authentification

Now if you try to move a virtual machine you will have this wonderfull error :

To solve this we need to create a trust relation between our servers.

Open an Active Directory Users and Computers console, then in Hyperv01 properties add delegation as shown below :

Do the same for Hyperv02.

Now it’s time to move VMs. To do so Create an empty VM named VM01.

From INFRA01 open a Powershell command prompt and open a Pssesion on Hyperv01 and Hyperv02.

From where the VM is located run the following command :

Move-VM VM01 Hyperv02  –IncludeStorage

And it should work … or not !

If like me you have the following error message : AccessDenied,Microsoft.HyperV.Powershell.Commands.MoveVMCommand

It should be because you installed HyperV role before joining the hosts to the domain.

To solve the problem simply add “Domain Admin” or any group you want to use to the HyperV administrator local group on each HyperV host.

 

Enjoy

Leave a Reply

Your email address will not be published. Required fields are marked *