mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
VMware: Update other parameters in vSwitch (#43883)
Allow parameter update for vSwitch without any NICs Fixes: #43821 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
d06d1d4840
commit
e6f0f8073d
1 changed files with 2 additions and 7 deletions
|
@ -308,16 +308,11 @@ class VMwareHostVirtualSwitch(PyVmomi):
|
|||
vswitch_pnic_info['num_ports'] != self.number_of_ports:
|
||||
diff = True
|
||||
|
||||
if not all_nics:
|
||||
diff = False
|
||||
results['result'] += " as no NICs provided / found which are required while updating vSwitch."
|
||||
|
||||
try:
|
||||
if diff:
|
||||
# vSwitch needs every parameter again while updating,
|
||||
# even if we are updating any one of them
|
||||
vss_spec = vim.host.VirtualSwitch.Specification()
|
||||
vss_spec.bridge = vim.host.VirtualSwitch.BondBridge(nicDevice=all_nics)
|
||||
if all_nics:
|
||||
vss_spec.bridge = vim.host.VirtualSwitch.BondBridge(nicDevice=all_nics)
|
||||
vss_spec.numPorts = self.number_of_ports
|
||||
vss_spec.mtu = self.mtu
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue