So here is the back story on this idea/script:
I was at my VMware Fast-track class in Dallas when the instructors mentioned an interesting story. They said they knew of a IT shop that had a pretty strict policy on labeling their servers. That was fine and good pre-virtualization. But after moving to a VMotion-enabled VMware cluster they had the problem of their servers not matching their labels. So did they change the policy? Nope, they got magnetic labels and had an admin run down to the server room every time they used VMotion. True? Maybe, but it got me thinking.
Why not use the front panel LCD on newer Dell servers to list what VM‘s are residing on the host? I pitched the idea to the instructors and they thought it was spiffy. A couple months later I have finally given it a shot. I debated whether to try and write this in C but opted to use Bash because it is easier to implement and I am so rusty at C it isn’t funny(and I should be spending those hours on Powershell).
To start off here are the prereqs:
- Dell OpenManage installed and running on the ESX host (needed for ipmi drivers)
- ipmitool 1.8.10 installed (SCP over, ./configure, make, make install….)
- My lcd_update.sh script
I wrote the script to only use what was available on the ESX 3.5 host(besides prereqs). I place mine in the /root folder and put “/root/lcd_update >> /dev/null &” into my /etc/rc.d/rc.local file to make it start on boot.
If you prefer you can just start it manually with nohup.
The script is pretty simple. It takes inventory of what VM’s are running and lists them on the LCD using IPMI. It keeps a semaphore file in /etc to keep track (index) of what VM it listed last. The Dell LCD can only display 14 characters (unless someone out there figured something else out) so if your VM name is longer it will be truncated. Overall the effect is pretty slick and with the way it is timed it appears to be a scrolling marquee of server names. Also, if you host has no VM’s or there is a problem with vmware-cmd it will just list the ESX hostname (it will trim a FQDN).
I am sure major improvements can be made to this and I am planning on writing one for server health and hosts in maintenance mode. This is more of a ‘can it be done’ utility and my first *public* script for something VMware related.
***Update*** v .2
I changed the script to use vmware-vim-cmd instead of vmware-cmd. This should give a list of VM names instead of just taking the name from the VMX file (incase they don’t match). Kudos to Duncan Epping’s post @ Yellow-Bricks which gave me the idea.