Browse Source

NSX|V: fix vnic allocation for AZ and metadata

When there are several availability zones using the same metadata
configuration, the DB vnic allocation failed to find the correct
internal network becasue it belongs to the default AZ and not the
specific one.

Change-Id: If35c814b55fd5632995cbace0689e4506563059d
changes/96/471696/4
Adit Sarfaty 4 years ago
parent
commit
bc0ca46f8e
  1. 8
      vmware_nsx/db/nsxv_db.py

8
vmware_nsx/db/nsxv_db.py

@ -387,6 +387,14 @@ def get_nsxv_internal_network(session, network_purpose, availability_zone):
if net_list:
# Should have only one results as purpose+az are the keys
return net_list[0]
else:
# try the default availability zone, since this zone does not
# have his own
net_list = (session.query(nsxv_models.NsxvInternalNetworks).
filter_by(network_purpose=network_purpose,
availability_zone='default').all())
if net_list:
return net_list[0]
def get_nsxv_internal_networks(session, network_purpose):

Loading…
Cancel
Save