Archives for October 2010

Build a home ESX 4.x Server for $1,000

Update: I came up with a new parts list based on Sandy Bridge parts. You can check it out here.

Currently I dual-boot my home computer with ESXi 4.1, but that’s getting old. Yes, you can run ESXi 4.1 inside of VMware Workstation 7.1 (and I do), but you can’t run any 64-bit guest operating systems within that ESXi instance. Since Server 2008 R2 is 64-bit only, along with many other applications like Exchange 2010, that really limits what you can do with nested VMs.

So I broke down today and put together a white box micro-ATX computer for home use that should scream. Total cost was about $1,000, which I don’t think is too shabby for the hardware specs. I ordered most of the parts through Directron.com, since they don’t charge CA tax and have reasonable shipping costs.

Important factors for me were size (small case), noise level (very quiet), 16GB RAM, and dual NICs that were on the ESXi 4.1 HCL. I looked at Intel Clarksdale motherboards with on-die graphics, so I could eliminate the graphics card, but from what I read their memory performance is in the toilet due to an off-die memory controller. So I opted for a separate graphics card and a 45nm Intel Lynnfield processor. Next year when Intel Sandy Bridge processors are released, that should fix the terrible memory performance due to the new ring-bus micro-archtiecture.

You could ceratinly shave off a few dollars by getting a cheaper case, slower hard drive, less full-featured MB, and a single port NIC.

Antec MicroATX Minuet 350 case $98.99
Western Digital 1TB 7200 RPM 6Gb/s SATA $86.99
Asus Maximus III GENE MicroATX MB $136.98 (after rebate)
Intel Core i5-760 2.8GHz Quad-Core $204.99
Qty 2 Mushkin 8GB DDR3 PC3-10666 kit $129 x 2
Sapphire Radeon HD5450, low profile, fanless $29.99 (after rebate)
SuperMicro AOC-SG-i2 dual-port GiGE NIC $82
NetGear GS088T-200NAS Managed 8-port GigE switch $105.98

Total comes to about $1004.00, plus a few dollars shipping. I already had a DVD drive, so I didn’t need to get one. The NetGear switch supports VLANs, jumbo packets, and other features that got my interest. While doing some research, I also found a web site that has a pretty long list of whitebox hardware and an unofficial ESX(i) 4.x HCL. You can check it out here.  I can’t wait to get all of the parts and put the server together.

Change your VMware VM UUIDs to be Unique

UUID (Universally Unique IDentifier) are also known as GUIDs (Globally Unique IDentifier). A UUID is 128 bits long, and can guarantee uniqueness across space and time. Why do I care about UUIDs? Well VMware attempts to assign a unique UUID to every VM. Generally they succeed, but sometimes you can end up with VMs with duplicate UUIDs. UUIDs are present in physical hardware and also manifest themselves in Windows.

Recently I discovered this was happening for our VM templates, as we were using a unique method to transport and upload large templates to standalone ESX hosts before they were managed by vCenter. Basically we were using Veeam Backup to quickly restore templates to a host prior to shipping them to remote locations. What we didn’t realize was that all the templates would have the same UUID. Our backup software is now VMware aware and detected all of these duplicate UUIDs threw some errors. So I need a way to make sure our standalone VMs get built with unique UUIDs.

A VM’s .VMX file contains the UUID, and there are several methods to change it. First, you could just locate the BIOS.UUID value and change a few digits at random with Wordpad. This is fine, but prone to human error and not time efficient. So I cobbled together a little PowerShell script that attaches to an ESX host, enumerates all VMs, and tweaks the last eight digits in the UUID to make them all pseudo-unique.

All you need to do is run the PowerShell script via PowerCLI and give the IP address of the ESX host as an argument. A window will pop up asking for credentials, then it will enumerate all VMs and modify the UUID value. There’s nothing magical about the static portion of the UUID string in the script, so you can change that to a value from your environment if you wish.

The script pauses two seconds between each VM, so that the time stamp is unique for all VMs.


 # Usage: .changeUUID.ps1

if ($args[0].length -gt 0) {
connect-viserver $args[0]
$VMs = get-vm
foreach ($vm in $VMs){
$date = get-date -format “dd hh mm ss”
$newUuid = “56 4d 50 2e 9e df e5 e4-a7 f4 21 3b ” + $date
echo “VM: ” $VM.name “New UUID: ” $newuuid
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.uuid = $newUuid
$vm.Extensiondata.ReconfigVM_Task($spec)
start-sleep -s 2
}
}
else {Echo “Must supply IP address of ESX host. e.g. .changeUUID.ps1 192.168.0.10”}

So there you go, a way to easily change the UUID of your VMware virtual machines using PowerCLI.