-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteratermMacro.ttl
205 lines (143 loc) · 5.43 KB
/
teratermMacro.ttl
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
; Connect to the ESXi host
Connect '{{ hostname }} /ssh /2 /nosecuritywarning /auth=challenge /user=root /passwd=password'
wait '#'
; Open the log in teraterm program directory
loginfo logfilename
if result == -1 then
logopen '%Y%m%d_%H%M%S_{{ hostname }}.log' 0 1 0 1 1
else
logclose
logopen '%Y%m%d_%H%M%S_{{ hostname }}.log' 0 1 0 1 1
endif
; Get the host information
sendln 'uname -n'
wait '#'
sendln 'esxcfg-info -y |grep "System UUID"'
wait '#'
sendln 'esxcfg-advcfg -j netNetqueueEnabled'
wait '#'
sendln 'esxcfg-advcfg -j netPktHeapMaxMBPerGB'
wait '#'
; Stop the Shell-Warning
sendln 'esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1'
wait '#'
; Enable Password Authentication
sendln 'sed -i -e "s/PasswordAuthentication no/PasswordAuthentication yes/g" /etc/ssh/sshd_config'
wait '#'
; Add uplink to vSwitch0
sendln 'esxcli network vswitch standard uplink add -v vSwitch0 -u vmnic5'
wait '#'
sendln 'esxcli network vswitch standard uplink add -v vSwitch0 -u vmnic6'
wait '#'
; Activate the Uplinks
sendln 'esxcli network vswitch standard policy failover set -v vSwitch0 -a vmnic5,vmnic6'
wait '#'
; Change the vSwitch0 Failover policy
sendln 'esxcli network vswitch standard policy failover set -v vSwitch0 -l explicit'
wait '#'
sendln 'esxcli network vswitch standard policy failover set -v vSwitch0 -b false'
wait '#'
; Change MTU value of vSwitch0
sendln 'esxcli network vswitch standard set -v vSwitch0 -m 9000'
wait '#'
; Copy vSwitch parameters and append to portgroup
sendln 'esxcli network vswitch standard portgroup policy failover set -u -p "Management Network"'
wait '#'
sendln ''
wait '#'
sendln 'esxcli network vswitch standard portgroup policy security set -u -p "Management Network"'
wait '#'
sendln ''
wait '#'
sendln 'esxcli network vswitch standard portgroup policy shaping set -u -p "Management Network"'
wait '#'
sendln ''
wait '#'
; Change portgroup name
sendln 'vim-cmd hostsvc/net/portgroup_set --portgroup-name="Management" vSwitch0 "Management Network"'
wait '#'
; Configure portgroup policy
sendln 'esxcli network vswitch standard portgroup policy shaping set -e true -p "Management" -b 5242880 -k 5242880 -t 41943040'
wait '#'
sendln 'esxcli network vswitch standard portgroup policy failover set -p "Management" -a vmnic5 -s vmnic6'
wait '#'
sendln 'esxcli network vswitch standard portgroup policy failover set -p "Management" -b true'
wait '#'
; Enable vMotion trafic
sendln 'esxcli network ip interface tag add -i vmk0 -t VMotion'
wait '#'
; Add new Portgroup on vSwitch0
sendln 'esxcli network vswitch standard portgroup add -v vSwitch0 -p Storage1'
wait '#'
; Set vLAN ID on new portgroup
sendln 'esxcli network vswitch standard portgroup set -p Storage1 -v 3935'
wait '#'
; Activate uplinks to Portgroup
sendln 'esxcli network vswitch standard portgroup policy failover set -p Storage1 -a vmnic6'
wait '#'
; Assign vmk interface to portgroup
sendln 'esxcli network ip interface add -i vmk1 -p Storage1'
wait '#'
; Set IP address to vmk interface
sendln 'esxcli network ip interface ipv4 set -i vmk1 -I {{ vmk1-ipaddr }} -N {{ vmk1-netmask }} -t static'
wait '#'
; Change MTU value of portgroup
sendln 'esxcfg-vmknic --mtu 9000 "Storage1"'
wait '#'
; Add new Portgroup on vSwitch0
sendln 'esxcli network vswitch standard portgroup add -v vSwitch0 -p Storage2'
wait '#'
; Set vLAN ID on new portgroup
sendln 'esxcli network vswitch standard portgroup set -p Storage2 -v 3936'
wait '#'
; Activate uplinks to Portgroup
sendln 'esxcli network vswitch standard portgroup policy failover set -p Storage2 -a vmnic5'
wait '#'
; Assign vmk interface to portgroup
sendln 'esxcli network ip interface add -i vmk2 -p Storage2'
wait '#'
; Set IP address to vmk interface
sendln 'esxcli network ip interface ipv4 set -i vmk2 -I {{ vmk2-ipaddr }} -N {{ vmk2-netmask }} -t static'
wait '#'
; Change MTU value of portgroup
sendln 'esxcfg-vmknic --mtu 9000 "Storage2"'
wait '#'
; Create new vSwitch on ESXi host
sendln 'esxcli network vswitch standard add -v vSwitch1'
wait '#'
sendln 'esxcli network vswitch standard policy shaping set -e true -v vSwitch1 -b 1048576 -k 1048576 -t 8388608'
wait '#'
; Add Uplinks to vSwitch1
sendln 'esxcli network vswitch standard uplink add -v vSwitch1 -u vmnic7'
wait '#'
sendln 'esxcli network vswitch standard uplink add -v vSwitch1 -u vmnic4'
wait '#'
; Activate the Uplinks
sendln 'esxcli network vswitch standard policy failover set -v vSwitch1 -a vmnic7,vmnic4'
wait '#'
; Change the vSwitch1 Failover policy
sendln 'esxcli network vswitch standard policy failover set -v vSwitch1 -l explicit'
wait '#'
sendln 'esxcli network vswitch standard policy failover set -v vSwitch1 -b false'
wait '#'
; Change MTU value of vSwitch1
sendln 'esxcli network vswitch standard set -v vSwitch1 -m 9000'
wait '#'
; Add new portgroup on vSwitch1
sendln 'esxcli network vswitch standard portgroup add -v vSwitch1 -p HeartBeat'
wait '#'
; Set vLAN ID on new portgroup
sendln 'esxcli network vswitch standard portgroup set -p HeartBeat -v 4000'
wait '#'
; Activate uplinks to Portgroup
sendln 'esxcli network vswitch standard portgroup policy failover set -p HeartBeat -a vmnic7,vmnic4'
wait '#'
; Assign vmk interface to portgroup
sendln 'esxcli network ip interface add -i vmk3 -p HeartBeat'
wait '#'
; Set IP address to vmk interface
sendln 'esxcli network ip interface ipv4 set -i vmk3 -I {{ vmk3-ipaddr }} -N {{ vmk3-netmask }} -t static'
wait '#'
sendln 'vim-cmd hostsvc/net/refresh'
sendln 'exit'
wait '#'