I am creating a install esx3 script booting from CD. Can install the esx server fine with it though still trying to work out how add the script in the post section. I also want to be able to copy files form the cd on to the esx server after the build. I need some help with copying files and also a post install script afterwards.
in the cfg file I have put this entry in
%pre
./mnt/source/sleeper.sh &
create a sleep.sh and put in the root of the cd. contents are:
cd /mnt/source
while true
do
sleep 120
done
to ensure that the cd stays in after the install. special thanks to dougdavis22.
then copy the files
cp -f -R /mnt/source/files /mnt/sysimage/tmp - how do I specify copying files to their locations after the post? any ideas?
Below is the script that I want to run. I created it, called it esxcfg.sh copy it into /etc/rc.d and run chmod +x /tmp/esxconfig.sh, tried to run it ./esxconfig to test. though got errors. works if I do it line by line manually. any ideas? Do I have to have the script in a specfic format?
Create a vswitch and add vm portgroups, vlans and physical nics
esxcfg-vswitch -a vSwitch1
sleep 30
esxcfg-vswitch -A "70 VM Network BNE" vSwitch1
esxcfg-vswitch -A "74 VM Network BNE" vSwitch1
esxcfg-vswitch -A "76 VM Network BNE" vSwitch1
esxcfg-vswitch --pg="70 VM Network BNE" --vlan=70 vSwitch1
esxcfg-vswitch --pg="74 VM Network BNE" --vlan=74 vSwitch1
esxcfg-vswitch --pg="76 VM Network BNE" --vlan=76 vSwitch1
esxcfg-vswitch -L vmnic2 vSwitch1
esxcfg-vswitch -L vmnic3 vSwitch1
service mgmt-vmware restart
sleep 20
Create a VMkernel setup with ip, vlan settings
esxcfg-vswitch -A VMkernel vSwitch0
esxcfg-vswitch -L vmnic1 vSwitch0
esxcfg-vmknic -a VMkernel -i 10.4.76.173 -n 255.255.255.0
esxcfg-route 10.4.76.1
esxcfg-vswitch --pg=VMkernel --vlan=76 vSwitch0
sleep 30
service mgmt-vmware restart
sleep 30
Setup active and standby settings for SC and vmkernel
vimsh -n -e "hostsvc/net/portgroup_set --nicorderpolicy-active vmnic1 vSwitch0 VMkernel"
vimsh -n -e "hostsvc/net/portgroup_set --nicorderpolicy-standby vmnic0 vSwitch0 VMkernel"
vimsh -n -e "hostsvc/net/portgroup_set --nicorderpolicy-active vmnic0 vSwitch0 'Service Console'"
vimsh -n -e "hostsvc/net/portgroup_set --nicorderpolicy-standby vmnic1 vSwitch0 'Service Console'"