mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
vmware_guest: Fix nic configuration with already present nics (#20640)
This commit is contained in:
parent
e64ef8b0ab
commit
614390a310
1 changed files with 4 additions and 0 deletions
|
@ -811,6 +811,10 @@ class PyVmomiHelper(object):
|
||||||
if hasattr(self.cache.get_network(network_devices[key]['name']), 'portKeys'):
|
if hasattr(self.cache.get_network(network_devices[key]['name']), 'portKeys'):
|
||||||
# VDS switch
|
# VDS switch
|
||||||
pg_obj = get_obj(self.content, [vim.dvs.DistributedVirtualPortgroup], network_devices[key]['name'])
|
pg_obj = get_obj(self.content, [vim.dvs.DistributedVirtualPortgroup], network_devices[key]['name'])
|
||||||
|
|
||||||
|
if nic.device.backing and ( nic.device.backing.port.portgroupKey != pg_obj.key or nic.device.backing.port.switchUuid != pg_obj.config.distributedVirtualSwitch.uuid ):
|
||||||
|
nic_change_detected = True
|
||||||
|
|
||||||
dvs_port_connection = vim.dvs.PortConnection()
|
dvs_port_connection = vim.dvs.PortConnection()
|
||||||
dvs_port_connection.portgroupKey = pg_obj.key
|
dvs_port_connection.portgroupKey = pg_obj.key
|
||||||
dvs_port_connection.switchUuid = pg_obj.config.distributedVirtualSwitch.uuid
|
dvs_port_connection.switchUuid = pg_obj.config.distributedVirtualSwitch.uuid
|
||||||
|
|
Loading…
Reference in a new issue