Feature 10910: Migration of Openstack based VM instances 64/11964/3
authorelumalai <deepika.e@tataelxsi.co.in>
Thu, 28 Apr 2022 11:56:24 +0000 (17:26 +0530)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 24 May 2022 11:25:43 +0000 (13:25 +0200)
Added feature support for Migration of Openstack based VM instances
from OSM

Change-Id: I7db836401c5b9fee71f032884064593135fb88d9
Signed-off-by: elumalai <deepika.e@tataelxsi.co.in>
osm_nbi/instance_topics.py
osm_nbi/nbi.py
osm_nbi/resources_to_operations.yml
osm_nbi/validation.py

index 74815ca..787f6e1 100644 (file)
@@ -28,6 +28,7 @@ from osm_nbi.validation import (
     ns_scale,
     ns_update,
     nsi_instantiate,
+    ns_migrate,
 )
 from osm_nbi.base_topic import (
     BaseTopic,
@@ -1158,6 +1159,7 @@ class NsLcmOpTopic(BaseTopic):
         "update": ns_update,
         "scale": ns_scale,
         "terminate": ns_terminate,
+        "migrate": ns_migrate,
     }
 
     def __init__(self, db, fs, msg, auth):
index ff2f6de..f57258f 100644 (file)
@@ -85,6 +85,7 @@ URL: /osm                                                       GET     POST
                     terminate                                           O5
                     action                                              O
                     scale                                               O5
+                    migrate                                             O
                     heal                                                5
                     update                                              05
             /ns_lcm_op_occs                                     5       5
@@ -444,6 +445,10 @@ valid_url_methods = {
                         "METHODS": ("POST",),
                         "ROLE_PERMISSION": "ns_instances:id:instantiate:",
                     },
+                    "migrate": {
+                        "METHODS": ("POST",),
+                        "ROLE_PERMISSION": "ns_instances:id:migrate:",
+                    },
                     "action": {
                         "METHODS": ("POST",),
                         "ROLE_PERMISSION": "ns_instances:id:action:",
index 1f75a5b..3c5ba3d 100644 (file)
@@ -135,6 +135,8 @@ resources_to_operations:
 
   "POST /nslcm/v1/ns_instances/<nsInstanceId>/scale": "ns_instances:id:scale:post"
 
+  "POST /nslcm/v1/ns_instances/<nsInstanceId>/migrate": "ns_instances:id:migrate:post"
+
   "GET /nslcm/v1/ns_lcm_op_occs": "ns_instances:opps:get"
 
   "GET /nslcm/v1/ns_lcm_op_occs/<nsLcmOpOccId>": "ns_instances:opps:id:get"
index 5c75522..3373b84 100644 (file)
@@ -526,6 +526,28 @@ ns_scale = {  # TODO for the moment it is only VDU-scaling
     "additionalProperties": False,
 }
 
+ns_migrate = {
+    "title": "ns migrate input schema",
+    "$schema": "http://json-schema.org/draft-04/schema#",
+    "type": "object",
+    "properties": {
+        "lcmOperationType": string_schema,
+        "nsInstanceId": id_schema,
+        "vnfInstanceId": id_schema,
+        "migrateToHost": string_schema,
+        "vdu": {
+            "type": "object",
+                "properties": {
+                    "vduId": name_schema,
+                    "vduCountIndex": integer0_schema,
+                },
+                "required": ["vduId"],
+                "additionalProperties": False,
+        },
+    },
+    "required": ["vnfInstanceId"],
+    "additionalProperties": False
+}
 
 schema_version = {"type": "string", "enum": ["1.0"]}
 schema_type = {"type": "string"}