Add NSX-T Logical Switch support in vmware_guest (#37979)

* Add NSX-T Logical Switch support in vmware_guest

* Update vmware_guest.py

add space after % operator
pull/38175/merge
Yasen Simeonov 7 years ago committed by ansibot
parent 0cdba9ff70
commit b4debfad9a

@ -1117,6 +1117,14 @@ class PyVmomiHelper(PyVmomi):
dvs_port_connection.switchUuid = pg_obj.config.distributedVirtualSwitch.uuid
nic.device.backing = vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo()
nic.device.backing.port = dvs_port_connection
elif isinstance(self.cache.get_network(network_name), vim.OpaqueNetwork):
# NSX-T Logical Switch
nic.device.backing = vim.vm.device.VirtualEthernetCard.OpaqueNetworkBackingInfo()
nic.device.backing.opaqueNetworkType = 'nsx.LogicalSwitch'
nic.device.backing.opaqueNetworkId = self.cache.get_network(network_name).summary.opaqueNetworkId
nic.device.deviceInfo.summary = 'nsx.LogicalSwitch: %s' % (self.cache.get_network(network_name).summary.opaqueNetworkId)
else:
# vSwitch
if not isinstance(nic.device.backing, vim.vm.device.VirtualEthernetCard.NetworkBackingInfo):

Loading…
Cancel
Save