Thursday, March 3, 2011

Performance Testing Hyper-V

I’ve been reading up on everything Hyper-V, but I’m still very curious as to the specific performance characteristics of different configurations. Specifically (at this stage) I want to know if there is a sweet spot for RAM, and the effect of adding more virtual processors to the guest. I’ll use this information to make better choices when it comes to selecting VM configurations for my SharePoint farm (or whatever else I happen to feel like playing around with)
I’d also like to form a solid baseline for comparison if I make hardware changes etc.

I hopped on to Bing and found the PassMark Performance Test software. It looks like it does everything I need, so I decide to give it a go.

My testing methodology is to spin up each configuration and run the test 4 times. Reboot and run it another 4. I’ll disregard the highest and lowest total score, and average the remaining 4. I’ll run this over a range of configurations and compare the results. I’ll also compare the results to a “max theoretical score”, which is obtained from running the tests on the host machine.
At this stage I am not going to work out standard deviations or significant difference, however, depending on the ‘logic’ of the results I get, I might do this in the future.

I have scripted the test to only run CPU, memory and disk benchmarks (thanks to this forum post - http://www.passmark.com/forum/showthread.php?t=1701). I don’t have a graphics card installed, and I’m not sure that would be valid in an RDP window anyway…
I will dedicate a particular VM to this task, which I will use for nothing else. I plan to revisit the testing a number of times (it would take too long to do all the test I want to do in one go).

I ran tests on the host and 2 different CPU configs for a guest. I was planning to do 1, 2, 3 and 4 CPU configurations, but after doing 1 and 4 – it didn’t seems worth continuing. There was no real difference…

  Host Guest 1 Guest 2
CPU Mark 5523.3 1013.78333 1031.36667
Memory Mark 2109.1 814.266667 767.4
Disk Mark 908.183333 7131.95 6100.25
PassMark Rating 2448.1 826.8 827.583333

image

Host = Phenom x6, 16GB RAM, included reference
Guest 1 = 4 virtual CPU, 4GB static RAM Hyper-V guest
Guest 2 = 1 virtual CPU, 4GB static RAM Hyper-V guest
Value in graph expressed as % vs host result.

My conclusion – either the way Hyper-V schedules CPU time means that there is no difference when the VM load does not tax the host, or my testing software is flawed in a VM. I’m going to need to do some reading, and perhaps retest with multiple VMs at once (say, 3 VMs of the same config running the tests simultaneously). 

Monday, February 28, 2011

Hyper-V Templates for SharePoint 2010 using Sysprep

I’ve decided on a very simple farm for my first attempt at virtualising SharePoint 2010 at home – I’m creating 4 servers.

Server 1 is a domain controller. I’ll reuse this server over and over again. So once it is set-up, I’ll take a copy of the virtual hard drive. In the case I need to start from scratch, I can. I’ll allocate the DC 512meg RAM as this is the Windows Server 2008 R2 minimum spec, and it’s not exactly going to be taxed controlling a domain of 4 servers.

Server 2 is a SQL Server. Again, I’m likely to reuse this server, so I’ll take a copy of the VHD. I’ll allocate 4096meg RAM to this server

Server 3 and 4 are web and app servers respectively. Again, 4096meg RAM each.

Creating multiple servers is actually pretty easy in Hyper-V.
- I started by creating a single server running Windows 2008 R2, and installed all the latest updates, service pack 1, and enabled things like remote desktop.
- Next I shut down the VM I have just created, and logged in to the host and took a back-up of the VHD. This will be useful later when I need to update my base image (or, potentially, install things like a virus scanner by default)
- Next, restart the VM. Once in windows run the sysprep utility. As it turns out, sysprep comes with Windows these days and can be found at C:\Windows\System32\sysprep
- I selected the following options;
image
Selecting generalize ensures a new SSID is created each time the image is used so the machines don’t clash.
- Sysprep will do its thing, and then shutdown the machine. At this point, take a copy of the VHD and mark it as read-only. This is your system template
- I copied the VHD 4 times, one for each server I wanted created. Then I created 4 new VMs, each attached to one of the copied VHDs with the appropriate amount of RAM and fired them up.

There you have it. 4 servers created in the time it takes to install 1 OS Smile.

Sunday, February 27, 2011

Remote Management for Hyper-V

As part of my virtual lab project, I want to be able to manage my virtual machines from my lap-top. It’s usual practice in most organisations to only remote in to servers when absolutely needed, so I’m going to take the same approach at home (may as well replicate a real environment as much as I can!).

First things first, I’m going to need the Hyper-V MMC snap-in for Windows 7. The remote server administration tools (RSAT) can be found on MS here;
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d&displaylang=en
Once you’ve installed that, you’ll need to enable the hyper-v features using the ‘Turn Windows Features on or off’ link in Programs and Features in control panel.

Next you’ll need to configure the hyper-v role on the server to allow you to administer it remotely; by default, if you add the server to the hyper-v manager in Windows 7, you’ll get an error stating you don’t have permissions. In my set-up, the virtual host and my lap-top are both workgroup computers, any domains I set-up will be at the guest level. Getting it to work when both computers share a domain is straight forward, when they’re in a workgroup, not so much. A quick Google search pointed me to HVRemote, a script written by John Howard. His blog can be found here - http://blogs.technet.com/b/jhoward/ and the script can be found on MSDN here - http://archive.msdn.microsoft.com/HVRemote.

Following the instructions for workgroup-workgroup configuration on the MSDN page – and it works.

Setting up a Virtual Lab for SharePoint 2010

So - having always run virtual machines on my lap-top with the previous version of SharePoint, its 4gb of RAM just isn't enough anymore. I figured I may as well take advantage of rock-bottom hardware prices and set up a virtual lab.

For home use, consumer grade hardware is perfectly capable of hosting virtual machines reliably, so I logged on to Umart to see what was on offer.
After a while, I settled on an AMD based system, as the prices seemed lower for what I wanted to do (raw computing power per dollar was higher). I settled on the following hardware;
AMD Phenom II x6 1055t
Gigabyte GA-870A-UD3 motherboard
Kingmax 8GB (2 x 4GB) DDR3 RAM kit x 2
Western Digital 1TB SATA3 Harddrive x 2

I stuck it all in an Antec NSK6582b case, with an Earthwatts 430w powersupply.

I plan at a later stage on installing a couple of extra hard drives and getting a RAID array going for performance, which the motherboard will support, but that is a battle for another day.

All in all, I've ended up with a 6-core, 16GB RAM machine for under $800. Since the whole thing is for dev and testing, my TechNet subscription will cover any licensing, so I went ahead and installed Windows Server 2008R2 and configured the Hyper-v role.
Now to create a virtual machine template using sysprep... let the games begin!