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
This commit is contained in:
Yasen Simeonov 2018-04-02 11:35:13 +02:00 committed by ansibot
parent 0cdba9ff70
commit b4debfad9a

View file

@ -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):