|
|
|
|
|
vmaccepteula |
|
|
|
# Set the root password for the DCUI and Tech Support Mode |
|
rootpw --iscrypted $1$pk5LuH4K$D/nWHCxKsDMldrqBpZzc00 |
|
|
|
# Grab foreman disk layout |
|
#Do Nothing |
|
|
|
# If SAN install change to |
|
# install --firstdisk=,,remote --overwritevmfs |
|
install --firstdisk --overwritevmfs |
|
|
|
# First interface IP configuration |
|
network --bootproto=static --ip=172.23.41.99 --gateway=172.23.41.1 --nameserver=172.20.0.111 --netmask=255.255.255.0 --hostname=currahee.deploy.lab.beer.town --device=vmnic0 --addvmportgroup=0 |
|
%post --interpreter=busybox |
|
#Notify foreman |
|
wget -q -O /dev/null http://puppet.lab.beer.town/unattended/built |
|
reboot |
|
# Configure additional commands at first boot. |
|
%firstboot --interpreter=busybox |
|
|
|
#Enable shell access |
|
vim-cmd hostsvc/enable_ssh |
|
vim-cmd hostsvc/start_ssh |
|
vim-cmd hostsvc/enable_esx_shell |
|
vim-cmd hostsvc/start_esx_shell |
|
/adv/UserVars/SuppressShellWarning = "1" |
|
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1 |
|
|
|
#Enable NTP |
|
echo restrict default kod nomodify notrap noquerynopeer > /etc/ntp.conf |
|
echo restrict 127.0.0.1 >> /etc/ntp.conf |
|
echo server 0.pool.ntp.org >> /etc/ntp.conf |
|
echo server 1.pool.ntp.org >> /etc/ntp.conf |
|
echo driftfile /var/lib/ntp/drift >> /etc/ntp.conf |
|
/sbin/chkconfig –level 345 ntpd on |
|
/etc/init.d/ntpd stop |
|
/etc/init.d/ntpd start |
|
|
|
esxcli network vswitch standard add -v vSwitch1 |
|
esxcli network vswitch standard portgroup add -v vSwitch1 -p iscsi1 |
|
esxcli network vswitch standard portgroup add -v vSwitch1 -p iscsi2 |
|
esxcli network vswitch standard uplink add -v vSwitch1 -u vmnic1 |
|
esxcli network vswitch standard uplink add -v vSwitch1 -u vmnic2 |
|
esxcli network vswitch standard portgroup add -v vSwitch0 -p vMotion |
|
esxcli network vswitch standard portgroup add -v vSwitch0 -p 'VM Network' |
|
esxcli network vswitch standard uplink add -v vSwitch0 -u vmnic3 |
|
esxcli network ip interface add -i vmk1 -p iscsi1 |
|
esxcli network ip interface add -i vmk2 -p iscsi2 |
|
esxcli network ip interface ipv4 set -i vmk1 -t dhcp |
|
esxcli network ip interface ipv4 set -i vmk2 -t dhcp |
|
esxcli network ip interface add -i vmk3 -p vMotion |
|
esxcli network ip interface ipv4 set -i vmk3 -t dhcp |
|
vim-cmd hostsvc/vmotion/vnic_set vmk3 |
|
esxcli network vswitch standard set -v vSwitch0 -m 9000 |
|
esxcli network vswitch standard set -v vSwitch1 -m 9000 |
|
esxcli network ip interface set -i vmk0 -m 9000 |
|
esxcli network ip interface set -i vmk1 -m 9000 |
|
esxcli network ip interface set -i vmk2 -m 9000 |
|
esxcli network ip interface set -i vmk3 -m 9000 |
|
esxcli network vswitch standard portgroup policy failover set -p iscsi1 -a vmnic2 |
|
esxcli network vswitch standard portgroup policy failover set -p iscsi2 -a vmnic1 |
|
esxcli network vswitch standard portgroup policy failover set -p iscsi1 -a vmnic1 |
|
esxcli network vswitch standard portgroup policy failover set -p iscsi2 -a vmnic2 |
|
|
|
#Enable iSCSI software adapter and set configuration |
|
esxcli iscsi software set -e true |
|
ADAPTER=`esxcli iscsi adapter list | grep Software | awk '{print $1;}'` |
|
HOSTNAME=esx01-automation |
|
esxcli iscsi adapter set -A $ADAPTER --name iqn.1998-01.com.vmware:$HOSTNAME |
|
esxcli iscsi adapter discovery sendtarget add -A $ADAPTER -a 10.125.77.8 |
|
esxcli iscsi adapter discovery sendtarget add -A $ADAPTER -a 10.125.77.13 |
|
esxcli iscsi adapter discovery sendtarget add -A $ADAPTER -a 10.125.77.14 |
|
#esxcli iscsi adapter discovery sendtarget add -A $ADAPTER -a 10.125.77.135 |
|
esxcli iscsi adapter discovery sendtarget add -A $ADAPTER -a 10.125.78.214 |
|
esxcli storage core adapter rescan --all |
|
|
|
esxcli iscsi networkportal add -A $ADAPTER -n vmk1 |
|
esxcli iscsi networkportal add -A $ADAPTER -n vmk2 |
|
|
|
|
|
# assign license |
|
vim-cmd vimsvc/license --set F149L-0Y3EJ-58T8R-0DC24-CXM1J |
|
|
|
|
|
|
|
# Reboot host to finish all setup |
|
esxcli system shutdown reboot -d 60 -r "rebooting after host configurations" |