Difference between revisions of "Kickstart ESXi"

From HackerNet
Jump to: navigation, search
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
ESXi 5.5
+
ESXi 6.0
 
   
 
   
 
  accepteula
 
  accepteula
 
  install --firstdisk --overwritevmfs
 
  install --firstdisk --overwritevmfs
  #For USB install use below
+
  #For USB install use below instead
 
  #install --firstdisk --novmfsondisk
 
  #install --firstdisk --novmfsondisk
 
  rootpw bueno
 
  rootpw bueno
 +
keyboard Swedish
 
  reboot
 
  reboot
 
   
 
   
Line 11: Line 12:
 
   
 
   
 
  %firstboot --interpreter=busybox
 
  %firstboot --interpreter=busybox
 
#If planning on running nested ESXi, uncomment
 
#grep -i "vhv.enable" /etc/vmware/config || echo "vhv.enable = \"TRUE\"" >> /etc/vmware/config
 
 
   
 
   
 
  #SSH
 
  #SSH
Line 32: Line 30:
 
  /sbin/chkconfig ntpd on
 
  /sbin/chkconfig ntpd on
 
   
 
   
 +
# EHC
 +
esxcli software vib install -v http://download3.vmware.com/software/vmw-tools/esxui/esxui_signed.vib
 +
 +
#If planning on running nested ESXi, uncomment
 +
#grep -i "vhv.enable" /etc/vmware/config || echo "vhv.enable = \"TRUE\"" >> /etc/vmware/config
 +
 +
# Mgmt
 +
esxcli network vswitch standard portgroup set --portgroup-name "Management Network" --vlan-id 2
 
   
 
   
 
  # vSwitch0
 
  # vSwitch0
Line 51: Line 57:
 
  esxcli network vswitch standard portgroup add --portgroup-name DMZ2 --vswitch-name vSwitch2
 
  esxcli network vswitch standard portgroup add --portgroup-name DMZ2 --vswitch-name vSwitch2
 
  esxcli network vswitch standard portgroup set --portgroup-name DMZ2 --vlan-id 2
 
  esxcli network vswitch standard portgroup set --portgroup-name DMZ2 --vlan-id 2
 
== Unattended KS fil ==
 
 
#
 
# ESXi kickstart file.
 
#
 
 
# Accept the VMware End User License Agreement
 
vmaccepteula
 
 
# Set the root password
 
rootpw Pa$$w0rd
 
 
# The install media is the SD drive
 
clearpart --firstdisk --overwritevmfs
 
install --firstdisk --overwritevmfs
 
 
# Set keyboard to Swedish
 
keyboard Swedish
 
 
# Set an static ip on the Management lan on vmnic3(Port 4 on server)
 
 
#ESXi hostnam & ip
 
network --bootproto=static --device=vmnic3 --ip=192.168.204.242 --gateway=192.168.204.7 --netmask=255.255.255.0 --hostname=ESXi
 
 
 
 
 
  
 
   
 
   
 
[[Category:Kickstart]]
 
[[Category:Kickstart]]
 
[[Category:VMware]]
 
[[Category:VMware]]

Latest revision as of 20:22, 17 March 2016

ESXi 6.0

accepteula
install --firstdisk --overwritevmfs
#For USB install use below instead
#install --firstdisk --novmfsondisk
rootpw bueno
keyboard Swedish
reboot

network --bootproto=static --device=vmnic0 --hostname=esxi2.hackernet.se --ip=172.20.0.2 --netmask=255.255.255.0 --gateway=172.20.0.1 --nameserver=172.20.0.10 --addvmportgroup=false

%firstboot --interpreter=busybox

#SSH
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh
esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1

vim-cmd hostsvc/datastore/rename datastore1 "LocalHDD"
vim-cmd vimsvc/license --set 11111-BBBBB-CCCCC-BH951-CAW3U
esxcli system module parameters set -m tcpip3 -p ipv6=0

cat > /etc/ntp.conf << __NTP_CONFIG__
restrict default kod nomodify notrap noquerynopeer
restrict 127.0.0.1
server 0.vmware.pool.ntp.org
server 1.vmware.pool.ntp.org
__NTP_CONFIG__
/sbin/chkconfig ntpd on

# EHC
esxcli software vib install -v http://download3.vmware.com/software/vmw-tools/esxui/esxui_signed.vib

#If planning on running nested ESXi, uncomment
#grep -i "vhv.enable" /etc/vmware/config || echo "vhv.enable = \"TRUE\"" >> /etc/vmware/config

# Mgmt
esxcli network vswitch standard portgroup set --portgroup-name "Management Network" --vlan-id 2

# vSwitch0
esxcli network vswitch standard set --mtu 9000 --cdp-status both --vswitch-name vSwitch0
esxcli network vswitch standard portgroup add --portgroup-name LAN --vswitch-name vSwitch0

# vSwitch1
esxcli network vswitch standard add --ports 256 --vswitch-name vSwitch1
esxcli network vswitch standard uplink add --uplink-name vmnic1 --vswitch-name vSwitch1
esxcli network vswitch standard set --cdp-status listen --vswitch-name vSwitch1
esxcli network vswitch standard portgroup add --portgroup-name WAN --vswitch-name vSwitch1

# vSwitch2 
esxcli network vswitch standard add --ports 256 --vswitch-name vSwitch2
esxcli network vswitch standard uplink add --uplink-name vmnic2 --vswitch-name vSwitch2
esxcli network vswitch standard set --mtu 9000 --cdp-status both --vswitch-name vSwitch2
esxcli network vswitch standard portgroup add --portgroup-name DMZ1 --vswitch-name vSwitch2
esxcli network vswitch standard portgroup set --portgroup-name DMZ1 --vlan-id 1
esxcli network vswitch standard portgroup add --portgroup-name DMZ2 --vswitch-name vSwitch2
esxcli network vswitch standard portgroup set --portgroup-name DMZ2 --vlan-id 2