VMWARE ESX Server Management Script

Posted on November 7th, 2008 in Data Center, Operating Systems, Others, Tips, Virtualization | 2 Comments »

Have you ever experience your Virtual Console down and VMWare Infrastructure Client not working?

Here’s an alternative solution for you: a Bash script to run on your ESX Server.

Sample screen shot:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
VMWARE ESX Management Tool Script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Author : http://malaysiavm.com/blog
Version : 1.00.20081107.14.31
Supported ESX Version : 2.5 – 3.5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0. VM Informations
1. Register VM
2. Unregister VM
3. Check VM Status
4. Power ON VM
5. Power OFF VM
6. Suspend VM
E. Exit

Choice:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Read more »

Get VM guests MAC Address Script

Posted on October 15th, 2008 in Tips | 1 Comment »

This is just to share a simple script – “How to find out VM guest MAC address for each VMware ESX” server as below:

## Script START here

#!/bin/bash
#
# Get VM Guest Mac Address – getmacadd.sh
#
# The getmacadd.sh script must run as root on VMware ESX server.
#
# This work is licensed under a Creative Commons License permitting non-commercial sharing with attribution
#
# Change Log:
# 15 Oct 2008 – version 0.1
#

export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

id_check() {

if [ `id -u` -ne 0 ]
then
echo “You must be root to run this script!”
exit
fi
}

id_check

for COUNT in $(vmware-cmd -l); do
echo `echo $COUNT|awk -F’/’ ‘{print $6}’`
echo ” “`echo $COUNT`
echo ” “`cat $COUNT|grep “displayName”`
#MAC Address may refer to “Address” instead of “generatedAddress”
echo ” “`cat $COUNT|grep “generatedAddress”`
echo
done

## Script END here

Read more »