Friday, June 22, 2012

Pictures from Honduras

The team leader from our Honduras trip put together a slideshow of the trip. While it has been a while, better late than never...

Free online courses: Intro to Statistics

In my day-to-day life as a computer geek, I find myself surrounded by information. For better or worse, it is my job to try an take this data and make intelligent decisions based on it. To be quite honest, I have been fumbling with how to organize and use the data. Between high-school statistics class and various blogs I have been somewhat successful, but there is something to be said for a structured educational process.

Today I came across a course by Udacity ( that may be just what I am looking for. The course - Intro to Statistics - uses information to visualize data and make intelligent decisions based on it. The class starts on the 25th, so I shouldn't have to wait long to begin using it.

Wednesday, June 20, 2012

Configuring syslog in ESX

It happens every time - an error occurs in VMware, and causes a lot of VMotions. By the time you get the logs off the ESX host, they have rolled off and are no longer valid.

To combat this, we setup a syslog server for all our ESX hosts to report into. To configure the hosts, you either configure each system manually, or you can use the Set-vmHostSyslogServer powershell command. The following command will set all ESX hosts in your datacenter to report to the same syslog server.
get-datacenter "My Datacenter" | get-vmhost | set-vmhostsyslogserver -syslogserver

When your done, use the following command to confirm everything is configured correctly.
get-datacenter "My Datacenter" | get-vmhost | get-vmhostsyslogserver

Wednesday, June 13, 2012

Finding VM disk details in powershell

Occasionally I have to do some VMware datastore maintenance (remove datastores, migrate SANs, etc...) that requires me to move VMs from one DS to another. Traditionally this should be simple: find all VMs on a DS, sVmotion the VMs to a target DS, and remove the original. To make it easier, I rename the datastores as DontUse_XXXX, to easily identify which ones I am clearing, and to keep others from adding VMs to them.
In vSphere 5 this gets even easier: put the DS into maintenance mode and the VMs are migrated automatically.

To complicate things, we have some VMs that are on shared datastores, some that are on dedicated datastores (such as databases), and some that are on both. This means I can't arbitrarily migrate VMs from 1 DS to another DS. If I did this, then database servers would be moved from dedicated RAID 10 LUNs to shared disks without any guaranteed performance.

The first major step is to identify what VMs I have, and how I need to move them. The below powershell script will query all VMs on my DontUse datastores and return the VM name, total size in GB, number of disks, and number of DataStores the VM is on.

get-vm -datastore dontuse* | select Name, @{name="GB";expression={($_ | get-harddisk | Measure-Object -prop CapacityKB -sum).sum /1024/1024}}, @{name="disks";expression={($_ | get-harddisk | measure-object ).count}}, @{name="DS";expression={($_ | get-harddisk| %{($_.filename -split " ")[0]} | sort-object | get-unique).count}}

This quickly alerts me to any VMs I can migrate without issue, and which ones to look deeper into prior to migrating