I seem to be having a problem running a post install script during my kickstart installation of ESXi 4.1. Everything completes without error but upon reboot, none of my changes are there. Here is my configuration file:
accepteula
vmserialnum --esx=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
rootpw secretpw
autopart --firstdisk --overwritevmfs
install url nfs://IP/path_to_esx
network --bootproto=static --ip=xxx.x.xx.xxx --gateway=xxx.x.xx.xxx --netmask=255.255.255.0 --nameserver=xxx.x.xx.xxx --hostname=hostname.domain.com --addvmportgroup=0
%post --unsupported --interpreter=busybox
sleep 10
Enable Management
/sbin/chkconfig --level 345 TSM on
/sbin/chkconfig --level 345 TSM-SSH on
Modify /etc/resolv.conf
/bin/cat > /etc/resolv.conf << EOF
search domain.com
nameserver dns_server_ip1
nameserver dns_server_ip2
EOF
NTP configuration
/sbin/chkconfig --level 345 ntpd on
/bin/cat >> /etc/ntp.conf << EOF
server ntp_serverip1
server ntp_serverip2
server ntp_serverip3
EOF
I don't see any errors in the install log. Am I missing something?
Thanks!
My #'s were replaced by 1. above. They are actually comment lines in the script.
As a workaround, I changed the script from running post install to first boot and added a reboot at the end. I probably don't need the reboot but threw it in there for good measure.
Any clue on why post install didn't work?
-
%firstboot --unsupported --interpreter=busybox
sleep 10
Enable Management
/sbin/chkconfig --level 345 TSM on
/sbin/chkconfig --level 345 TSM-SSH on
Modify /etc/resolv.conf
/bin/cat > /etc/resolv.conf << EOF
search domain.com
nameserver dns_server_ip1
nameserver dns_server_ip2
EOF
#NTP configuration
/sbin/chkconfig --level 345 ntpd on
/bin/cat >> /etc/ntp.conf << EOF
server ntp_serverip1
server ntp_serverip2
server ntp_serverip3
EOF
/sbin/reboot
how did you write the post script? if you wrote it in notepad/wordpad that changes the type to DOS and the system has trouble reading it. if you have a base one I recomend putting it on a linux system and use winscp to edit the file.
My guess is that %firstboot is the way to go.
Think of it this way: When %post is running, you are not booted from your freshly installed ESXi, but from your install media. All changes are made to the running system (the one booted from install media), which are lost as soon as you reboot. Only after a reboot, you are booted from your installed ESXi, and changes made at that point (%firstboot) are applied to your installation.