Browse Source

[MP2P] Do not assume Tier0 uplink ports are attached to LS

Attempt to collect uplink LS only if there is a linked logical
port switch id for the uplink port

Change-Id: I0774f7173d698039c80da85336a57cfd31c2add0
changes/68/787368/1
Salvatore Orlando 2 weeks ago
parent
commit
98c9df4cc0
1 changed files with 13 additions and 3 deletions
  1. +13
    -3
      vmware_nsx/shell/admin/plugins/nsxv3/resources/migration.py

+ 13
- 3
vmware_nsx/shell/admin/plugins/nsxv3/resources/migration.py View File

@ -502,9 +502,19 @@ def migrate_tier0s(nsxlib, nsxpolicy, plugin):
uplink_port = nsxlib.logical_router_port.get_tier0_uplink_port(tier0)
if uplink_port:
# Get the external LS id from the uplink port
port_id = uplink_port['linked_logical_switch_port_id']['target_id']
port = nsxlib.logical_port.get(port_id)
public_switches.append(port['logical_switch_id'])
linked_ls_id = uplink_port.get('linked_logical_switch_port_id')
if linked_ls_id:
try:
port_id = linked_ls_id['target_id']
port = nsxlib.logical_port.get(port_id)
public_switches.append(port['logical_switch_id'])
except KeyError as e:
LOG.info("Required attribute missing: %s. Cannot "
"add public switch to objects to migrate", e)
else:
LOG.info("Uplink port %s for Tier0 router %s is not "
"connected to a logical switch",
tier0, uplink_port['id'])
return public_switches, migrated_tier0s


Loading…
Cancel
Save