From 759f7cf2a6fb5bc0ec55f6658012f102573c9a8e Mon Sep 17 00:00:00 2001 From: vallard Date: Tue, 12 May 2009 20:14:28 +0000 Subject: [PATCH] initial vmware esx 3.5 post install script git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3363 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../share/xcat/install/scripts/post.esx | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 xCAT-server/share/xcat/install/scripts/post.esx diff --git a/xCAT-server/share/xcat/install/scripts/post.esx b/xCAT-server/share/xcat/install/scripts/post.esx new file mode 100644 index 000000000..226ab5d8d --- /dev/null +++ b/xCAT-server/share/xcat/install/scripts/post.esx @@ -0,0 +1,54 @@ +# +# Setup hostname +# +echo "post scripts" >/root/post.log +export HOSTNAME=#TABLE:nodelist:THISNODE:node# +LAST=$(echo $HOSTNAME | awk -Fhab '{print $2}' | sed 's/^0//g') +IP=192.168.99.$LAST +export $IP +echo "HOSTNAME: $HOSTNAME IP: $IP" >>/root/post.log +echo "Changing switch" >>/root/post.log +# +# Setup hostname +# +echo "post scripts" >/root/post.log +export PRINIC=#TABLE:noderes:THISNODE:primarynic# +if [ -z "$PRINIC" ] +then + export PRINIC=eth0 +fi +IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') +if [ -z $IP ] +then + dhclient eth0 + IP=$(ifconfig $PRINIC | grep inet | awk '{print $2}' | awk -F: '{print $2}') +fi +echo "search #TABLE:site:key=domain:value#" >/etc/resolv.conf +for i in $(echo #TABLE:site:key=nameservers:value# | tr ',' ' ') +do + echo "nameserver $i" +done >>/etc/resolv.conf + +hostname $HOSTNAME +# +# Run xCAT post install +# +export MASTER_IP="#XCATVAR:XCATMASTER#" +export MASTER_IPS="#XCATVAR:XCATMASTER#" +export MASTER="#XCATVAR:XCATMASTER#" +cd /tmp +mkdir -p /xcatpost +mount $MASTER_IP:/install/postscripts /xcatpost +cd /xcatpost +export PATH=/xcatpost:$PATH +export NODE=#TABLE:nodelist:THISNODE:node# +export OSVER=#TABLE:nodetype:THISNODE:os# +export ARCH=#TABLE:nodetype:THISNODE:arch# +syslog +remoteshell +setupntp +setupesx $HOSTNAME +updateflag.awk $MASTER 3002 +umount /xcatpost +cd / +exit 0