Best Practices


Script Consolidation

by Steve  | January 29th, 2009

Consolidation is a word that if you are into virtualization then you know all about it.  One of the biggest selling points of virtualization is consolidation of your servers.  As most of you know I am a huge fan of an automated server build process but as the number of host servers increased so did the number of configuration and build scripts.  Most ESX servers will be built the same way with a few exceptions, like network configuration, for example.  The code below will show you a way to run specific tasks on a server based on the server’s hostname.  In this example the variables are defined for the networking setup.

if [ `hostname -s` == "esx001" ] ; then
SRVCFG=ESX001
SCIP=10.10.126.11
VMIP=192.168.121.1
DGW=10.10.126.1
VMKGW=192.168.121.1
SetVMFS
SetConsoleNIC
SetVMotion
SetNet
SetDMZ
SetLocalNet
fi
if [ `hostname -s` == "esx002" ] ; then
SRVCFG=ESX002
SCIP=10.10.126.12
VMIP=192.168.121.2
DGW=10.10.126.1
VMKGW=192.168.121.2
SetVMFS
SetConsoleNIC
SetVMotion
SetNet
SetDMZ
SetLocalNet
Fi 

Not too much to it right?  So now you can have one script that all hosts can use which will make your life easier as well as help you keep some sanity.


Tags , , , , , , ,

This entry was posted on Thursday, January 29th, 2009 at 10:04 am and is filed under Virtual Tech. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Add a Comment

x

Subscribe to The Virtual Black Hole RSS Feed Email Notification

Enter your email address:

Delivered by FeedBurner