your home for end-user virtualization!

ESXi 5.1 serial console based (headless) kickstart

As you saw in my previous post, it takes a little work to get an Open Compute Platform (OCP) server to install ESXi 5.1. The main reason being the lack of video card, the second reason being that only “old people” know serial :)

Keep in mind, my OCP servers (Hyve) have three interfaces, eth2 (Intel 1GB), and eth0/1 (10GB)

That being said, here is the kickstart file I use for my Serial based ESXi install (headless)

accepteula
install --firstdisk --overwritevmfs
rootpw passw0rd
network --bootproto=dhcp --device=vmnic2
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 SSH AND SHELL ###
# 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
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
### NETWORK CONFIGURATION ###
#add vswitch1
esxcli network vswitch standard add --ports 256 --vswitch-name vSwitch1

#Rename Management Network to ESX_MGMT
vim-cmd hostsvc/net/portgroup_set --portgroup-name="ESX_MGMT" vSwitch0 "Management Network"

#configure CDP on vswitch0
esxcli network vswitch standard set --cdp-status both --vswitch-name vSwitch0

#configure CDP on vswitch0
esxcli network vswitch standard set --cdp-status both --vswitch-name vSwitch1

# attach vmnic0,vmnic1 to vSwitch0 (Please insure upstream switches are configured before adding second vmnic to vSwitch0)
esxcli network vswitch standard uplink add --uplink-name vmnic0 --vswitch-name vSwitch1
esxcli network vswitch standard uplink add --uplink-name vmnic1 --vswitch-name vSwitch1

# configure active and standby uplinks for vSwitch1
esxcli network vswitch standard policy failover set --active-uplinks vmnic0,vmnic1 --vswitch-name vSwitch1

#security configuration on vSwitch0
esxcli network vswitch standard policy security set --allow-forged-transmits yes --allow-mac-change no --allow-promiscuous no --vswitch-name vSwitch0

#security configuration on vSwitch1
esxcli network vswitch standard policy security set --allow-forged-transmits yes --allow-mac-change no --allow-promiscuous no --vswitch-name vSwitch1

# configure portgroup
esxcli network vswitch standard portgroup add --portgroup-name ESX_VMKernel --vswitch-name vSwitch1

# 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

### FINISH ####
#enter maintenance mode
esxcli system maintenanceMode set -e true

# 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

%firstboot
#modify bootloader to use text/serial mode
sed -i '/no-auto-partition/ s/$/ text nofb com1_baud=115200 com1_Port=0x3f8 tty2Port=com1 gdbPort=none logPort=none/' /bootbank/boot.cfg

Tags: , ,

Search

Categories