Instantly share code, notes, and snippets.

anonymous /PXELinux Secret
Created Sep 29, 2016

Embed
What would you like to do?
#!ipxe
kernel -n mboot.c32 http://puppet.lab.beer.town:717/sources/VMWare/ESXi/6.02/mboot.c32
imgargs mboot.c32 -c http://puppet.lab.beer.town:717/sources/VMWare/ESXi/6.02/boot.cfg text ks=http://puppet.lab.beer.town/unattended/provision; ignoreHeadless="True"
boot mboot.c32
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"
#Do nothing
bootstate=0
title=Loading ESXi installer
prefix=http://puppet.lab.beer.town:717/sources/VMWare/ESXi/6.02/
kernel=tboot.b00
kernelopt=runweasel
modules=b.b00 --- jumpstrt.gz --- useropts.gz --- k.b00 --- chardevs.b00 --- a.b00 --- user.b00 --- uc_intel.b00 --- uc_amd.b00 --- sb.v00 --- s.v00 --- mtip32xx.v00 --- ata_pata.v00 --- ata_pata.v01 --- ata_pata.v02 --- ata_pata.v03 --- ata_pata.v04 --- ata_pata.v05 --- ata_pata.v06 --- ata_pata.v07 --- block_cc.v00 --- ehci_ehc.v00 --- elxnet.v00 --- emulex_e.v00 --- weaselin.t00 --- esx_dvfi.v00 --- ima_qla4.v00 --- ipmi_ipm.v00 --- ipmi_ipm.v01 --- ipmi_ipm.v02 --- lpfc.v00 --- lsi_mr3.v00 --- lsi_msgp.v00 --- lsu_hp_h.v00 --- lsu_lsi_.v00 --- lsu_lsi_.v01 --- lsu_lsi_.v02 --- lsu_lsi_.v03 --- lsu_lsi_.v04 --- misc_cni.v00 --- misc_dri.v00 --- net_bnx2.v00 --- net_bnx2.v01 --- net_cnic.v00 --- net_e100.v00 --- net_e100.v01 --- net_enic.v00 --- net_forc.v00 --- net_igb.v00 --- net_ixgb.v00 --- net_mlx4.v00 --- net_mlx4.v01 --- net_nx_n.v00 --- net_tg3.v00 --- net_vmxn.v00 --- nmlx4_co.v00 --- nmlx4_en.v00 --- nmlx4_rd.v00 --- nvme.v00 --- ohci_usb.v00 --- qlnative.v00 --- rste.v00 --- sata_ahc.v00 --- sata_ata.v00 --- sata_sat.v00 --- sata_sat.v01 --- sata_sat.v02 --- sata_sat.v03 --- sata_sat.v04 --- scsi_aac.v00 --- scsi_adp.v00 --- scsi_aic.v00 --- scsi_bnx.v00 --- scsi_bnx.v01 --- scsi_fni.v00 --- scsi_hps.v00 --- scsi_ips.v00 --- scsi_meg.v00 --- scsi_meg.v01 --- scsi_meg.v02 --- scsi_mpt.v00 --- scsi_mpt.v01 --- scsi_mpt.v02 --- scsi_qla.v00 --- uhci_usb.v00 --- xhci_xhc.v00 --- tools.t00 --- xorg.v00 --- vsanheal.v00 --- imgdb.tgz --- imgpayld.tgz
build=
updated=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment