vSphere Management Assistant
Setup
Install vMA Appliance
- Get the OVF URL of the latest version from http://www.vmware.com/support/developer/vima/
- Import OVF into vCentre
- You'll need to specify a cluster/host, datastore, and hostname
- Once imported, power on
- The VM will go into a Wizard
- Update IP information
- Enter a passsword for the
vi-admin
account (dictionary words not allowed)
Setup Date Time
- Remove existing date time zone
sudo rm /etc/localtime
- Add link to appropriate locale
sudo ln -s /usr/share/zoneinfo/Europe/London /etc/localtime
- Enable NTP daemon
sudo chkconfig ntpd on
- Edit the NTP config file to add your NTP server(s)
sudo vi /etc/ntp.conf
- Edit the
server
entries as required
- Start the NTP daemon
sudo /etc/rc.d/init.d/ntpd start
Add ESX to vMA
- Log into the vMA as
vi-admin
- Use
vifp addserver
command to add ESX and enter root password- EG
vifp addserver esx-server.domain.com
- EG
- To test, set the session to use the server
vifptarget --set esx-server.domain.com
- and show NICS
vicfg-nics -l
- To enable logging for all servers
vilogger enable
Enable root
Normally there should be no reason to run as root, everything you need to do can be done via sudo.
- Set root password to something you know
sudo passwd root
- Enable root to login, edit
/etc/passwd
, and change the root line toroot:x:0:0:root:/root:/bin/bash
vilogger
Command | Description |
---|---|
vilogger enable |
Enable vilogger for all connected hosts |
vilogger list |
List vilogger hosts and status |
vilogger disable |
Disable vilogger for all hosts |
sudo /etc/init.d/vmware-vilogd restart |
Restart the vilogger service |
Service Checker
For me the vilogger service has a habit of giving up monitoring of hosts, therefore I've written the following script to check for failures, and restart as appropriate. Note that the script looks for more than 10 fails (there's 3 logs per ESX, so logging has to fail for at least 4 ESX's before the script tries to restart). This is to allow for the occasions when ESX's are genuinely down, and I don't want the logger service being restarted every minute.
#!/bin/sh
NUMFAILED=`vilogger list | grep -c Failed`
if [ $NUMFAILED -gt 10 ]; then
echo "`date` Restart the service"
/etc/init.d/vmware-vilogd restart
else
#echo "`date` Don't restart the service"
fi
The above is placed in the file /home/vi-admin/scripts/vilogger_check
and scheduled to run every minute by adding the following line to
/etc/crontab
/2 * * * * root /home/vi-admin/scripts/vilogger_check >> /home/vi-admin/scripts/vilogger_check.log 2>&1
Note that you need to Enable root in order for the script to run