forked from jedi4ever/veewee
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ks.cfg
63 lines (46 loc) · 2 KB
/
ks.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Sample kickstart for ESXi 5.1
# William Lam
# www.virtuallyghetto.com
#########################################
accepteula
install --firstdisk --overwritevmfs
rootpw vagrant
network --bootproto=dhcp
reboot
%firstboot --interpreter=busybox
# enable VHV (Virtual Hardware Virtualization to run nested 64bit Guests + Hyper-V VM)
grep -i "vhv.enable" /etc/vmware/config || echo "vhv.enable = \"TRUE\"" >> /etc/vmware/config
# enable & start remote ESXi Shell (SSH)
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh
# enable & start ESXi Shell (TSM)
vim-cmd hostsvc/enable_esx_shell
vim-cmd hostsvc/start_esx_shell
# supress ESXi Shell shell warning - Thanks to Duncan (http://www.yellow-bricks.com/2011/07/21/esxi-5-suppressing-the-localremote-shell-warning/)
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1
# ESXi Shell interactive idle time logout
esxcli system settings advanced set -o /UserVars/ESXiShellInteractiveTimeOut -i 3600
# Disable IPv6 for VMkernel interfaces
esxcli system module parameters set -m tcpip3 -p ipv6=0
### FIREWALL CONFIGURATION ###
# enable firewall
esxcli network firewall set --default-action false --enabled yes
# services to enable by default
FIREWALL_SERVICES="syslog sshClient ntpClient updateManager httpClient netdump"
for SERVICE in ${FIREWALL_SERVICES}
do
esxcli network firewall ruleset set --ruleset-id ${SERVICE} --enabled yes
done
# 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/datastore1/firstboot-hostd.log"
cp /var/log/esxi_install.log "/vmfs/volumes/datastore1/firstboot-esxi_install.log"
# Needed for configuration changes that could not be performed in esxcli
esxcli system shutdown reboot -d 60 -r "rebooting after host configurations"
%post --interpreter=python --ignorefailure=true
import time
stampFile = open('/finished.stamp', mode='w')
stampFile.write( time.asctime() )