-
Notifications
You must be signed in to change notification settings - Fork 0
/
ks.cfg
62 lines (47 loc) · 2.45 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
# Accept the VMware End User License Agreement
vmaccepteula
# Set the root password for DCUI
rootpw SenhaExemplo1.
# Install on the first local disk available on machine
install --firstdisk --overwritevmfs
# Set the network to Static on the first network adapter
network --hostname=esxi --device=vmnic0 --bootproto=static --ip=192.168.99.50 --netmask=255.255.255.0 --gateway=192.168.99.1 --nameserver=192.168.99.1
# Reboot
reboot
# Use busybox interpreter
%firstboot --interpreter=busybox
# Set DNS Suffix
esxcli network ip dns search add --domain=tchecode.local
# Disable IPv6
esxcli network ip set --ipv6-enabled=false
# Enable NTP
echo "server 0.br.pool.ntp.org" >> /etc/ntp.conf;
echo "server 1.br.pool.ntp.org" >> /etc/ntp.conf;
/sbin/chkconfig ntpd on;
# Create vSwitches
esxcli network vswitch standard add -v vSwitch1
esxcli network vswitch standard add -v vSwitch2
# Set vSwitch MTU's
esxcli network vswitch standard set -v vSwitch1 -m 9000
esxcli network vswitch standard set -v vSwitch2 -m 9000
# Add Additional NIC to vSwitches
esxcli network vswitch standard uplink add --uplink-name=vmnic1 --vswitch-name=vSwitch0
esxcli network vswitch standard uplink add --uplink-name=vmnic2 --vswitch-name=vSwitch1
esxcli network vswitch standard uplink add --uplink-name=vmnic3 --vswitch-name=vSwitch1
esxcli network vswitch standard uplink add --uplink-name=vmnic4 --vswitch-name=vSwitch2
esxcli network vswitch standard uplink add --uplink-name=vmnic5 --vswitch-name=vSwitch2
# Create VMKernel Ports
esxcli network vswitch standard portgroup add --portgroup-name=vMotion --vswitch-name=vSwitch1
esxcli network vswitch standard portgroup add --portgroup-name=NFS --vswitch-name=vSwitch2
esxcli network ip netstack add --netstack=vmotion
esxcli network ip interface add --interface-name=vmk1 --portgroup-name=vMotion --netstack=vmotion --mtu=9000
esxcli network ip interface add --interface-name=vmk2 --portgroup-name=NFS --mtu=9000
esxcli network ip interface ipv4 set --interface-name=vmk1 --ipv4=192.168.10.215 --netmask=255.255.255.0 --type=static
esxcli network ip interface ipv4 set --interface-name=vmk2 --ipv4=192.168.5.215 --netmask=255.255.255.0 --type=static
# Put host in maintenance mode
esxcli system maintenanceMode set -e true
# Reboot to apply settings (disabling IPv6)
esxcli system shutdown reboot -d 15 -r "rebooting after disabling IPv6"
# Enable SSH
vim-cmd hostsvc/enable_ssh
vim-cmd hostsvc/start_ssh