Test lab setup

Post TechNet test lab: Part 2 (Hyper-V Host Configuration)

Post TechNet test lab: Part 2 (Hyper-V Host Configuration)

I’ve increased my mighty test lab to 4 hyper-v hosts and each of them runs Hyper-V 2012 R2, I recently tried the tech preview (OCT 2014) of Hyper-V, but it incorrectly stated my machines don’t support SLAT, so I had to revert to 2012R2.

Hyper-v server 2012 R2 is different to normal 2012 R2, as for one, its free.Its fully featured as far as the Hyper-V role is concerned, but you can’t install any other roles or features.It’s also running the core interface.However, I haven’t found this a massive problem or should I say I haven’t found it as much of a problem as working out how to manage this when the machine isn’t connected to a domain this was a head scratcher.

Installing Hyper-V 2012 R2 is a just the same as installing the full server, the fun comes once its installed.When you log in, you’ll get two command windows open.The first is just normal command prompt, the second which will pop to the front is sconfig. Microsoft have published this article on Sconfig. Run through that configuring remote access, network connections etc and you’ve got a basic setup.

If you do already have a domain, then you just add the host to this and off you go, however if that was the case you’d probably not be reading this.The other way to manage the server is using pass through authentication.This is pretty old school and involves creating two identical accounts on your management pc and the server. For my environment I added both the servers and my client to the workgroup “WORKGROUP” and created a local account called “Hyperv”. This can be done in the normal way on the client, however you need to use option 3 in Sconfig (Add administrator).

Once you have your pass through account setup, you will need to make changes to the firewall (or disable) and configure remote management because were not in a domain just enable winrm is not enough.I use the below powershell to do this

# Disable Firewall
Set-NetFirewallProfile -Name * -Enabled False
#Run winrm quickconfig defaults
echo Y | winrm quickconfig
#Run enable psremoting command with defaults
enable-psremoting -force
#Enabled Trusted Hosts for Universal Access
cd wsman:
cd localhost\client
Set-Item TrustedHosts * -force
restart-Service winrm
echo "Complete"

Once you have your client and server talking to each other, run up Server manager on your client (Make sure its windows 8 if you’re using 2012R2) and add the servers in.

Once you can manage them,check your disks/partitions are how you would like them.I create an OS volume, a template volume and a volume to hold my VMs.This means if I have to rebuild my hosts I just format the OS and VMs volume and leave my templates in place.Which saves me about 40 mins.Keeping the drive setup uniform across your hosts, means you can script simple tasks like pushing out new template files.I used the below from the host

set-location "\\\share\VM Files\Templates"
Copy-Item -Path "\\\share\VM Files\Templates\TP2014OCT_Server.vhdx" -Destination D:\Templates
Copy-Item -Path "\\\share\VM Files\Templates\TP2014OCT_Windows 10.vhdx" -Destination D:\Templates

(at some point I will reuse some code I’ve written and keep the template folders in sync with my nas box)

Once you can manage the servers from your client machine and you have the templates copied to the correct location, your ready to start provisioning vms.

Just make sure you check you have the VM/SLAT settings correctly specified in your host’s bios

Post 1: Post TechNet test lab

Post 2: Hyper-V Host Configuration

Post 3 Creating the VM templates

Post 4 PS Script to deploy VMs

Post 5 Configure deployed VMs General

Post 6 PS Script to install and configure AD

Post 7 Antivirus

Post 8 SSDs, ISCSI and a new layout