| Article Index |
|---|
| VMware vSphere - Scripted Installer for ESX Server |
| The Pre Section |
| The Post Sections |
| The esx-post-script |
| The Actual Config |
| All Pages |
Page 4 of 5
The ESX-POST-SCRIPT script
That's everything that happens before the reboot sorted out. What we've go so far is a network configuration that's personalised for the server, a disk-partition and VMDK container that's personalised for the server, and a configuration-script.
Now that the server is also rebooted, we have full access to all the ESX tools, so we can do the final configuration.
The sole role of esx-post-script.sh is basically to create a runnable esxcfg.sh file that contains all the standard ESX commands for setting up a host.
esx-post-script
ESXID=$1 ESXCODE=`printf "%02d\n" "$ESXID"` ESXHOSTNAME="ESX-$ESXCODE" ESXSCIP="10.20.30.$ESXID" ESXSTORAGEIP="10.10.30.$ESXID" cat > /esxcfg.sh <<eofcfg> # MORE CONFIG WILL GO HERE, THAT COMES LATER EOFcfg cp -f /etc/rc.d/rc.local /etc/rc.d/rc.local.bak cat > /etc/rc.d/rc.local << EOFrc chmod a+x esxcfg.sh bash /esxcfg.sh > /root/post_install.log cp -f /etc/rc.d/rc.local /etc/rc.d/rc.postinstall cp -f /etc/rc.d/rc.local.bak /etc/rc.d/rc.local EOFrc
- esx-post-script.sh creates a new customised script esxcfg.sh
- esx-post-script.sh backs up the current /etc/rc.init file
- esx-post-script.sh puts esxcfg.sh into rc.init
Last Updated on Wednesday, 05 August 2009 12:53


