-
Notifications
You must be signed in to change notification settings - Fork 0
/
lacp.ps1
29 lines (15 loc) · 951 Bytes
/
lacp.ps1
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
#---------------UpdateDVSLacpGroupConfig_Task---------------
$lacpGroupSpec = New-Object VMware.Vim.VMwareDvsLacpGroupSpec[] (1)
$lacpGroupSpec[0] = New-Object VMware.Vim.VMwareDvsLacpGroupSpec
$lacpGroupSpec[0].LacpGroupConfig = New-Object VMware.Vim.VMwareDvsLacpGroupConfig
$lacpGroupSpec[0].LacpGroupConfig.Mode = 'passive'
$lacpGroupSpec[0].LacpGroupConfig.Ipfix = New-Object VMware.Vim.VMwareDvsLagIpfixConfig
$lacpGroupSpec[0].LacpGroupConfig.LoadbalanceAlgorithm = 'srcDestIpTcpUdpPortVlan'
$lacpGroupSpec[0].LacpGroupConfig.Vlan = New-Object VMware.Vim.VMwareDvsLagVlanConfig
$lacpGroupSpec[0].LacpGroupConfig.Name = 'lag1'
$lacpGroupSpec[0].LacpGroupConfig.UplinkNum = 2
$lacpGroupSpec[0].Operation = 'add'
#$_this = Get-View -Id 'VmwareDistributedVirtualSwitch-dvs-1194'
$_this = Get-VDSwitch "DSwitch 1" | Get-View
$_this.UpdateDVSLacpGroupConfig_Task($lacpGroupSpec)
#----------------- End of code capture -----------------