avoid openstack default gateway creation at VLD ip-profile. 15/6315/4
authortierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 4 Jul 2018 16:29:21 +0000 (18:29 +0200)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Thu, 19 Jul 2018 12:34:17 +0000 (14:34 +0200)
Change vnf instance order to nsd:constituent-vnfd list order.
Ensure interface are deployed in order

Change-Id: I3f2d43643f6cd25a09d0f21407544657168c3513
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
openmanod
osm_ro/nfvo.py
osm_ro/nfvo_db.py
osm_ro/vimconn_openstack.py
test/RO_tests/v3_2vdu_set_ip_mac/scenario_2vdu_set_ip_mac.yaml
test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac.yaml
test/RO_tests/v3_2vdu_set_ip_mac/vnfd_2vdu_set_ip_mac2.yaml

index 5bae20e..e63ddf1 100755 (executable)
--- 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
 
 
index 5279b9a..76e7244 100644 (file)
@@ -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"]
index 3c0e7a5..4376278 100644 (file)
@@ -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,
index 43fdbc5..ae9dc12 100644 (file)
@@ -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:
index 3357f3e..fb76079 100644 (file)
@@ -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
index b6be27c..e790a9c 100644 (file)
@@ -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
index fe200bf..6c4b6cf 100644 (file)
@@ -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