From 55d234c0d00b9936a83b632513379b9e13999126 Mon Sep 17 00:00:00 2001 From: tierno Date: Wed, 4 Jul 2018 18:29:21 +0200 Subject: [PATCH] avoid openstack default gateway creation at VLD ip-profile. Change vnf instance order to nsd:constituent-vnfd list order. Ensure interface are deployed in order Change-Id: I3f2d43643f6cd25a09d0f21407544657168c3513 Signed-off-by: tierno --- openmanod | 4 ++-- osm_ro/nfvo.py | 8 ++++---- osm_ro/nfvo_db.py | 4 ++-- osm_ro/vimconn_openstack.py | 4 +++- .../scenario_2vdu_set_ip_mac.yaml | 4 ++-- .../vnfd_2vdu_set_ip_mac.yaml | 18 +++++++++--------- .../vnfd_2vdu_set_ip_mac2.yaml | 6 +++--- 7 files changed, 25 insertions(+), 23 deletions(-) diff --git a/openmanod b/openmanod index 5bae20e4..e63ddf12 100755 --- a/openmanod +++ b/openmanod @@ -48,8 +48,8 @@ import osm_ro __author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes" __date__ = "$26-aug-2014 11:09:29$" -__version__ = "0.5.70-r580" -version_date = "Jun 2018" +__version__ = "0.5.71-r581" +version_date = "Jul 2018" database_version = 32 # expected database schema version diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index 5279b9ae..76e7244b 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -1149,8 +1149,8 @@ def new_vnfd_v3(mydb, tenant_id, vnf_descriptor): vnf=vnfd_id, vdu=vdu_id, iface=iface["name"], cp=iface.get("internal-connection-point-ref"), msg=str(e)), HTTP_Bad_Request) - if iface.get("position") is not None: - db_interface["created_at"] = int(iface.get("position")) - 1000 + if iface.get("position"): + db_interface["created_at"] = int(iface.get("position")) * 50 if iface.get("mac-address"): db_interface["mac"] = str(iface.get("mac-address")) db_interfaces.append(db_interface) @@ -3208,8 +3208,8 @@ def create_instance(mydb, tenant_id, instance_dict): "net2task_id": net2task_id, "sce_net2instance": sce_net2instance, } - sce_vnf_list = sorted(scenarioDict['vnfs'], key=lambda k: k['name']) - for sce_vnf in sce_vnf_list: + # sce_vnf_list = sorted(scenarioDict['vnfs'], key=lambda k: k['name']) + for sce_vnf in scenarioDict['vnfs']: # sce_vnf_list: instantiate_vnf(mydb, sce_vnf, vnf_params, vnf_params_out, rollbackList) task_index = vnf_params_out["task_index"] uuid_list = vnf_params_out["uuid_list"] diff --git a/osm_ro/nfvo_db.py b/osm_ro/nfvo_db.py index 3c0e7a55..43762781 100644 --- a/osm_ro/nfvo_db.py +++ b/osm_ro/nfvo_db.py @@ -812,10 +812,10 @@ class nfvo_db(db_base.db_base): if table_name in self.tables_with_created_field: if "created_at" in row: - created_time_param = created_time + row.pop("created_at")*0.00001 + created_time_param = created_time + (index + row.pop("created_at"))*0.00001 else: created_time_param = created_time + index*0.00001 - index += 1 + index += 1 else: created_time_param = 0 self._new_row_internal(table_name, row, add_uuid=False, root_uuid=None, diff --git a/osm_ro/vimconn_openstack.py b/osm_ro/vimconn_openstack.py index 43fdbc51..ae9dc121 100644 --- a/osm_ro/vimconn_openstack.py +++ b/osm_ro/vimconn_openstack.py @@ -463,7 +463,9 @@ class vimconnector(vimconn.vimconnector): } # Gateway should be set to None if not needed. Otherwise openstack assigns one by default if ip_profile.get('gateway_address'): - subnet['gateway_ip'] = ip_profile.get('gateway_address') + subnet['gateway_ip'] = ip_profile['gateway_address'] + else: + subnet['gateway_ip'] = None if ip_profile.get('dns_address'): subnet['dns_nameservers'] = ip_profile['dns_address'].split(";") if 'dhcp_enabled' in ip_profile: diff --git a/test/RO_tests/v3_2vdu_set_ip_mac/scenario_2vdu_set_ip_mac.yaml b/test/RO_tests/v3_2vdu_set_ip_mac/scenario_2vdu_set_ip_mac.yaml index 3357f3e5..fb760799 100644 --- a/test/RO_tests/v3_2vdu_set_ip_mac/scenario_2vdu_set_ip_mac.yaml +++ b/test/RO_tests/v3_2vdu_set_ip_mac/scenario_2vdu_set_ip_mac.yaml @@ -56,7 +56,7 @@ nsd:nsd-catalog: vnfd-connection-point-ref: eth0 - id: vld2 - name: vld2-name + name: nsd-vld2 short-name: vld2-sname type: ELAN ip-profile-ref: ipprofileA @@ -71,7 +71,7 @@ nsd:nsd-catalog: ip-address: 10.31.31.5 - id: vld3 - name: vld3-name + name: nsd-vld3 short-name: vld3-sname type: ELAN ip-profile-ref: no_dhcp diff --git a/test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac.yaml b/test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac.yaml index b6be27c1..e790a9cb 100644 --- a/test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac.yaml +++ b/test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac.yaml @@ -16,28 +16,28 @@ vnfd-catalog: internal-vld: - description: Internal VL id: net_internal - name: net_internal_name + name: internal_vld1 short-name: net_internal_sname type: ELAN internal-connection-point: - id-ref: eth2 - ip-address: 10.10.133.4 + ip-address: 10.10.135.4 - id-ref: eth3 - ip-address: 10.10.133.5 + ip-address: 10.10.135.5 ip-profile-ref: ip-profile1 ip-profiles: - description: Inter VNF Link ip-profile-params: - gateway-address: 10.10.133.1 + gateway-address: null ip-version: ipv4 - subnet-address: 10.10.133.0/24 + subnet-address: 10.10.135.0/24 dhcp-params: - count: 200 - start-address: 10.10.133.20 + count: 100 + start-address: 10.10.135.20 name: ip-profile1 vdu: - id: VM1 - name: VM1-name + name: VM11 image: US1604 interface: - name: iface11 @@ -67,7 +67,7 @@ vnfd-catalog: vcpu-count: '1' - id: VM2 image: US1604 - name: VM2-name + name: VM12 interface: - name: iface21 type: EXTERNAL diff --git a/test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac2.yaml b/test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac2.yaml index fe200bfc..6c4b6cfb 100644 --- a/test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac2.yaml +++ b/test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac2.yaml @@ -16,7 +16,7 @@ vnfd-catalog: internal-vld: - description: Internal VL id: net_internal - name: net_internal_name + name: internal_vld2 short-name: net_internal_sname type: ELAN internal-connection-point: @@ -37,7 +37,7 @@ vnfd-catalog: name: ip-profile1 vdu: - id: VM1 - name: VM1-name + name: VM21 image: US1604 interface: - name: iface11 @@ -67,7 +67,7 @@ vnfd-catalog: vcpu-count: '1' - id: VM2 image: US1604 - name: VM2-name + name: VM22 interface: - name: iface21 type: EXTERNAL -- 2.17.1