summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdit Sarfaty <asarfaty@vmware.com>2017-06-07 12:56:56 +0300
committerAdit Sarfaty <asarfaty@vmware.com>2017-06-08 09:38:50 +0000
commit7030a99cc07efa709a3145bd044913b16982d59b (patch)
tree932fa65426052271c24bc09486b7be932bdf2f5c
parent50ef64ceb1715c127f743e3b66ecb5eadecc9730 (diff)
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
Notes
Notes (review): Code-Review+2: Adit Sarfaty <asarfaty@vmware.com> Workflow+1: Adit Sarfaty <asarfaty@vmware.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 08 Jun 2017 11:02:21 +0000 Reviewed-on: https://review.openstack.org/471698 Project: openstack/vmware-nsx Branch: refs/heads/stable/ocata
-rw-r--r--vmware_nsx/db/nsxv_db.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/vmware_nsx/db/nsxv_db.py b/vmware_nsx/db/nsxv_db.py
index 88be7ff..a414eef 100644
--- a/vmware_nsx/db/nsxv_db.py
+++ b/vmware_nsx/db/nsxv_db.py
@@ -386,6 +386,14 @@ def get_nsxv_internal_network(session, network_purpose, availability_zone):
386 if net_list: 386 if net_list:
387 # Should have only one results as purpose+az are the keys 387 # Should have only one results as purpose+az are the keys
388 return net_list[0] 388 return net_list[0]
389 else:
390 # try the default availability zone, since this zone does not
391 # have his own
392 net_list = (session.query(nsxv_models.NsxvInternalNetworks).
393 filter_by(network_purpose=network_purpose,
394 availability_zone='default').all())
395 if net_list:
396 return net_list[0]
389 397
390 398
391def get_nsxv_internal_networks(session, network_purpose): 399def get_nsxv_internal_networks(session, network_purpose):