VMware Cloud Community
jcw0009
Enthusiast
Enthusiast
Jump to solution

Semi-Interactive Automated ISO Install esxi5.5 [solved]

My hostnames all line up with the ip address: esx101.local = 10.10.10.101, esx102.local = 10.10.10.102.

I'm working on a iso-based scripted install that would ask for the hostname, then setup networking. Is this possible?

Thanks,

Jeff

0 Kudos
1 Solution

Accepted Solutions
jcw0009
Enthusiast
Enthusiast
Jump to solution

Finally got this working, Much thanks to William Lam.

Didnt need to follow http://www.virtuallyghetto.com/2011/05/semi-interactive-automated-esxi.html exactly with 5.5. The boot options are already written to the esxi_installer.log file by the installer. But it's written multiple times, so gotta do 'grep blah blah | head -1' to get just the first instance of the boot options. Next steps will include setting up all the vmk interfaces based off the nodenumber.

So, my ks.cfg looks like:

root@deb7:~/esxiso# cat ks.cfg

accepteula

rootpw asdf1234

install --firstdisk --overwritevmfs

reboot

network --bootproto=static --hostname=tempname001 --ip=1.1.1.251 --gateway=1.1.1.254 --nameserver=1.1.1.250 --netmask=255.255.255.128 --device=vmnic0 --addvmportgroup=0

%firstboot

sleep 60

grep 'Got boot options' /var/log/esxi_install.log | head -1 | sed -e's/.*node=\([^ ]*\).*/\1/' >> /vmfs/volumes/datastore1/nodenumber.txt

NODENUMBER=$(grep 'Got boot options' /var/log/esxi_install.log | head -1 | sed -e's/.*node=\([^ ]*\).*/\1/')

esxcli system hostname set --fqdn=mptc-esx${NODENUMBER}.ps-msite.com

#enable ssh & tsm

vim-cmd hostsvc/enable_ssh

vim-cmd hostsvc/start_ssh

vim-cmd hostsvc/enable_esx_shell

vim-cmd hostsvc/start_esx_shell

# rename local datastore to something more meaningful

vim-cmd hostsvc/datastore/rename datastore1 "$(hostname -s)-local-storage-01"

#disable ipv6

esxcli system module parameters set -m tcpip3 -p ipv6=0

# backup ESXi configuration to persist changes

/sbin/auto-backup.sh

# enter maintenance mode

esxcli system maintenanceMode set -e true

# copy %first boot script logs to persisted datastore

cp /var/log/hostd.log "/vmfs/volumes/$(hostname -s)-local-storage-1/firstboot-hostd.log"

cp /var/log/esxi_install.log "/vmfs/volumes/$(hostname -s)-local-storage-1/firstboot-esxi_install.log"

root#deb7:~/esxiso#

View solution in original post

0 Kudos
2 Replies
vfk
Expert
Expert
Jump to solution

I think you should be to do this if you are python scripting in your kick-start  script.  You will get more flexibility with python.  Check out this link for kickstart tips http://www.virtuallyghetto.com/vmware-kickstart

--- If you found this or any other answer helpful, please consider the use of the Helpful or Correct buttons to award points. vfk Systems Manager / Technical Architect VCP5-DCV, VCAP5-DCA, vExpert, ITILv3, CCNA, MCP
jcw0009
Enthusiast
Enthusiast
Jump to solution

Finally got this working, Much thanks to William Lam.

Didnt need to follow http://www.virtuallyghetto.com/2011/05/semi-interactive-automated-esxi.html exactly with 5.5. The boot options are already written to the esxi_installer.log file by the installer. But it's written multiple times, so gotta do 'grep blah blah | head -1' to get just the first instance of the boot options. Next steps will include setting up all the vmk interfaces based off the nodenumber.

So, my ks.cfg looks like:

root@deb7:~/esxiso# cat ks.cfg

accepteula

rootpw asdf1234

install --firstdisk --overwritevmfs

reboot

network --bootproto=static --hostname=tempname001 --ip=1.1.1.251 --gateway=1.1.1.254 --nameserver=1.1.1.250 --netmask=255.255.255.128 --device=vmnic0 --addvmportgroup=0

%firstboot

sleep 60

grep 'Got boot options' /var/log/esxi_install.log | head -1 | sed -e's/.*node=\([^ ]*\).*/\1/' >> /vmfs/volumes/datastore1/nodenumber.txt

NODENUMBER=$(grep 'Got boot options' /var/log/esxi_install.log | head -1 | sed -e's/.*node=\([^ ]*\).*/\1/')

esxcli system hostname set --fqdn=mptc-esx${NODENUMBER}.ps-msite.com

#enable ssh & tsm

vim-cmd hostsvc/enable_ssh

vim-cmd hostsvc/start_ssh

vim-cmd hostsvc/enable_esx_shell

vim-cmd hostsvc/start_esx_shell

# rename local datastore to something more meaningful

vim-cmd hostsvc/datastore/rename datastore1 "$(hostname -s)-local-storage-01"

#disable ipv6

esxcli system module parameters set -m tcpip3 -p ipv6=0

# backup ESXi configuration to persist changes

/sbin/auto-backup.sh

# enter maintenance mode

esxcli system maintenanceMode set -e true

# copy %first boot script logs to persisted datastore

cp /var/log/hostd.log "/vmfs/volumes/$(hostname -s)-local-storage-1/firstboot-hostd.log"

cp /var/log/esxi_install.log "/vmfs/volumes/$(hostname -s)-local-storage-1/firstboot-esxi_install.log"

root#deb7:~/esxiso#

0 Kudos