I'm having one hell of a time getting my post scritp working and I'm a little unsure what to do now. here is my script
Auto-Generated Scripted Install Configuration file.
This file is used for VMware ESX Server Scripted Install Deployment
Installation Method
cdrom
root Password
rootpw --
Authconfig
auth --enableshadow --enablemd5
BootLoader ( The user has to use grub by default )
bootloader --location=mbr
Timezone
timezone US/Eastern
X windowing System
skipx
Install or Upgrade
install
Text Mode
text
Network install type
network --bootproto static --ip 192.168.2.57 --netmask 255.255.248.0 --gateway 192.168.1.249 --nameserver 192.168.1.249 --hostname peter.pan.com --addvmportgroup=0 --vlanid=0
Language
lang en_US
Langauge Support
langsupport --default en_US
Keyboard
keyboard us
Mouse
mouse none
Reboot after install ?
reboot
Firewall settings
firewall --disabled
Clear Partitions
clearpart --all --initlabel --drives=cciss/c0d0
Partitioning
part /boot --fstype ext3 --size 300 --ondisk cciss/c0d0
part / --fstype ext3 --size 4069 --ondisk cciss/c0d0
part swap --size 1638 --ondisk cciss/c0d0
part None --fstype vmfs3 --size 10000 --grow --ondisk cciss/c0d0
part None --fstype vmkcore --size 110 --ondisk cciss/c0d0
part /var/log --fstype ext3 --size 1992 --ondisk cciss/c0d0
part /home --fstype ext3 --size 2096 --ondisk cciss/c0d0
part /admin --fstype ext3 --size 4096 --ondisk cciss/c0d0
part /vmimages --fstype ext3 --size 15360 --ondisk cciss/c0d0
VMware Specific Commands
vmaccepteula
vmlicense --mode=server --server=27000@192.168.1.249 --edition=esxFull
%packages
@base
%vmlicense_text
%post
cat << \EOF > /etc/rc3.d/S99postconfig.sh
#!/bin/sh
Change the amount of RAM allocated to the Service Console
cp /etc/vmware/esx.conf /etc/vmware/esx.conf.ORIG
perl -spi -e 's|/boot/memSize = \"272\"|/boot/memSize = \"800\"|' /etc/vmware/esx.conf
cp /etc/grub.conf /etc/grub.conf.ORIG
esxcfg-boot -g
esxcfg-boot -b
Unlink the default Virtual Switches created during install
since it was created with < 64 virtual ports:
/usr/sbin/esxcfg-vswitch -U vmnic0 vSwitch0
/usr/sbin/esxcfg-vswif -d vswif0
/usr/sbin/esxcfg-vswitch -d vSwitch0
Create the vSwitch0 vSwitch and the Service Console port group
/usr/sbin/esxcfg-vswitch -a vSwitch0:64
/usr/sbin/esxcfg-vswitch -A 'Service Console' vSwitch0
/usr/sbin/esxcfg-vswitch -M vmnic0 vSwitch0 -p "Service Console"
/usr/sbin/esxcfg-vswitch -L vmnic0 vSwitch0
Create the vSwitch1 vSwitch and the VMotion port group
/usr/sbin/esxcfg-vswitch -a vSwitch1:64
/usr/sbin/esxcfg-vswitch -A "VMotion" vSwitch1
/usr/sbin/esxcfg-vswitch -M vmnic1 vSwitch1 -p "VMotion"
/usr/sbin/esxcfg-vswitch -L vmnic1 vSwitch1
Create the vSwitch2 vSwitch for VM traffic
/usr/sbin/esxcfg-vswitch -a vSwitch2:64
/usr/sbin/esxcfg-vswitch -A "Virtural Maching Network" vSwitch2
/usr/sbin/esxcfg-vswitch -M vmnic2 vSwitch2 -p "Virtural Maching Network"
/usr/sbin/esxcfg-vswitch -M vmnic3 vSwitch2 -p "Virtural Maching Network"
/usr/sbin/esxcfg-vswitch -L vmnic2 vSwitch2
/usr/sbin/esxcfg-vswitch -L vmnic3 vSwitch2
Assign IP addresses to the Service Console interface and save it permanently:
/usr/sbin/esxcfg-vswif -a -i 192.168.2.57 -n 255.255.248.0 -p 'Service Console' vswif0
/sbin/route add default gw ESX_GATEWAY
Assign an IP addresses to the VMotion interface and add a VMkernel default route:
/usr/sbin/esxcfg-vmknic -a -i 192.168.0.132 -n 255.255.248.0 VMotion
/usr/sbin/esxcfg-route -a default VMOTION_GATEWAY
Enable VMotion on the VMKernel Interface ( this only works on ESX 3.5 )
vimsh -n -e "/hostsvc/vmotion/vnic_set vmk0" #not working#
Reset system to normal boot mode
echo "Seting System to normal boot up mode"
rm /etc/rc3.d/S99postconfig.sh
EOF
So I take this file and add it to a floppy called ks.cfg - boot off of the CD and point the install to esx ks=floppy and let it rip. Everything runs fine and when I get back to the server everything is installed. However from some reason nothing in the %post script runs. Non of my vswitch configs work.
When I nav to /etc/rc3.d/S99postconfig.sh I can see all of the commands but nothing has run. I'm new to Linux and scripting so I'm sorry if this is a stupid question.
Thank you for your help