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 :
- Hyperv01 et Hyperv02
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 :
Then it’s a normal install.
Rename your servers
Set network :
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
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 :
and if you also want the management 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 :
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.
Configure VsWitch :
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 :
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.
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.