Skip to content

Commit

Permalink
Add NSX-T Logical Switch support in vmware_guest (ansible#37979)
Browse files Browse the repository at this point in the history
* Add NSX-T Logical Switch support in vmware_guest

* Update vmware_guest.py

add space after % operator
  • Loading branch information
yasensim authored and ansibot committed Apr 2, 2018
1 parent 0cdba9f commit b4debfa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ansible/modules/cloud/vmware/vmware_guest.py
Expand Up @@ -1117,6 +1117,14 @@ def configure_network(self, vm_obj):
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):
Expand Down

0 comments on commit b4debfa

Please sign in to comment.