+
+ if wim_account_name and self.vim.config["wim_external_ports"]:
+ # add external port to connect WIM. Try with compute node __WIM:wim_name and __WIM
+ action_text = "attaching external port to ovim network"
+ sdn_port_name = sdn_net_id + "." + task["vim_id"]
+ sdn_port_name = sdn_port_name[:63]
+ sdn_port_data = {
+ "compute_node": "__WIM:" + wim_account_name[0:58],
+ "pci": None,
+ "vlan": network["vlan"],
+ "net_id": sdn_net_id,
+ "region": self.vim["config"]["datacenter_id"],
+ "name": sdn_port_name,
+ }
+ try:
+ sdn_external_port_id = self.ovim.new_external_port(sdn_port_data)
+ except ovimException:
+ sdn_port_data["compute_node"] = "__WIM"
+ sdn_external_port_id = self.ovim.new_external_port(sdn_port_data)
+ self.logger.debug("Added sdn_external_port {} to sdn_network {}".format(sdn_external_port_id,
+ sdn_net_id))
+