Bug 2316: Fix for Unable to do vertical scaling when VM is in Shutdown state 19/14019/4 v14.0
authorelumalai <deepika.e@tataelxsi.co.in>
Tue, 14 Nov 2023 17:19:08 +0000 (22:49 +0530)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 25 Jun 2024 21:52:52 +0000 (23:52 +0200)
Change-Id: I141db0fa789daa966283a99f01c6693b0ab4d363
Signed-off-by: elumalai <deepika.e@tataelxsi.co.in>
NG-RO/osm_ng_ro/ns.py
NG-RO/osm_ng_ro/ns_thread.py
NG-RO/osm_ng_ro/tests/test_ns.py
RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
releasenotes/notes/bug_2310_fix-a89efc73f53f5578.yaml [new file with mode: 0644]
releasenotes/notes/bug_fix_2316-94732548c63aea74.yaml [new file with mode: 0644]
releasenotes/notes/fix_bug_2303-ce9784503f03a941.yaml [new file with mode: 0644]

index a1d2736..9678366 100644 (file)
@@ -1611,9 +1611,9 @@ class Ns(object):
 
         extra_dict["params"] = {
             "name": "{}-{}-{}-{}".format(
-                indata["name"][:16],
-                vnfr["member-vnf-index-ref"][:16],
-                target_vdu["vdu-name"][:32],
+                indata["name"],
+                vnfr["member-vnf-index-ref"],
+                target_vdu["vdu-name"],
                 target_vdu.get("count-index") or 0,
             ),
             "description": target_vdu["vdu-name"],
@@ -1844,9 +1844,9 @@ class Ns(object):
 
         extra_dict["params"] = {
             "name": "{}-{}-{}-{}".format(
-                db_nsr["name"][:16],
-                vnfr["member-vnf-index-ref"][:16],
-                existing_vdu["vdu-name"][:32],
+                db_nsr["name"],
+                vnfr["member-vnf-index-ref"],
+                existing_vdu["vdu-name"],
                 existing_vdu.get("count-index") or 0,
             ),
             "description": existing_vdu["vdu-name"],
index 42a8a59..b1949b3 100644 (file)
@@ -1005,8 +1005,6 @@ class VimInteractionUpdateVdu(VimInteractionBase):
         task = ro_task["tasks"][task_index]
         task_id = task["task_id"]
         db_task_update = {"retries": 0}
-        created = False
-        created_items = {}
         target_vim = self.my_vims[ro_task["target_id"]]
 
         try:
@@ -1020,10 +1018,6 @@ class VimInteractionUpdateVdu(VimInteractionBase):
             ro_vim_item_update = {
                 "vim_id": vim_vm_id,
                 "vim_status": "ACTIVE",
-                "created": created,
-                "created_items": created_items,
-                "vim_details": None,
-                "vim_message": None,
             }
             self.logger.debug(
                 "task={} {} vm-migration done".format(task_id, ro_task["target_id"])
@@ -1036,7 +1030,6 @@ class VimInteractionUpdateVdu(VimInteractionBase):
             )
             ro_vim_item_update = {
                 "vim_status": "VIM_ERROR",
-                "created": created,
                 "vim_message": str(e),
             }
 
@@ -1446,8 +1439,6 @@ class VimInteractionMigration(VimInteractionBase):
         db_task_update = {"retries": 0}
         target_vim = self.my_vims[ro_task["target_id"]]
         vim_interfaces = []
-        created = False
-        created_items = {}
         refreshed_vim_info = {}
 
         try:
@@ -1486,8 +1477,6 @@ class VimInteractionMigration(VimInteractionBase):
             ro_vim_item_update = {
                 "vim_id": vim_vm_id,
                 "vim_status": "ACTIVE",
-                "created": created,
-                "created_items": created_items,
                 "vim_details": None,
                 "vim_message": None,
             }
@@ -1514,7 +1503,6 @@ class VimInteractionMigration(VimInteractionBase):
             )
             ro_vim_item_update = {
                 "vim_status": "VIM_ERROR",
-                "created": created,
                 "vim_message": str(e),
             }
 
@@ -1526,9 +1514,7 @@ class VimInteractionResize(VimInteractionBase):
         task = ro_task["tasks"][task_index]
         task_id = task["task_id"]
         db_task_update = {"retries": 0}
-        created = False
         target_flavor_uuid = None
-        created_items = {}
         refreshed_vim_info = {}
         target_vim = self.my_vims[ro_task["target_id"]]
 
@@ -1562,8 +1548,6 @@ class VimInteractionResize(VimInteractionBase):
             ro_vim_item_update = {
                 "vim_id": vim_vm_id,
                 "vim_status": "ACTIVE",
-                "created": created,
-                "created_items": created_items,
                 "vim_details": None,
                 "vim_message": None,
             }
@@ -1584,7 +1568,6 @@ class VimInteractionResize(VimInteractionBase):
             )
             ro_vim_item_update = {
                 "vim_status": "VIM_ERROR",
-                "created": created,
                 "vim_message": str(e),
             }
 
index c692c51..b5c81fd 100644 (file)
@@ -181,7 +181,7 @@ expected_extra_dict = {
         "disk_list": [],
         "flavor_id": f"TASK-{ns_preffix}:flavor.0",
         "image_id": f"TASK-{ns_preffix}:image.0",
-        "name": "sample_name-vnf-several-volu-several_volumes-VM-0",
+        "name": "sample_name-vnf-several-volumes-several_volumes-VM-0",
         "net_list": [],
         "start": True,
     },
@@ -201,7 +201,7 @@ expected_extra_dict2 = {
         "disk_list": [],
         "flavor_id": f"TASK-{ns_preffix}:flavor.0",
         "image_id": f"TASK-{ns_preffix}:image.0",
-        "name": "sample_name-vnf-several-volu-without_volumes-VM-0",
+        "name": "sample_name-vnf-several-volumes-without_volumes-VM-0",
         "net_list": [],
         "start": True,
     },
index 9d47437..2017d56 100644 (file)
@@ -3902,7 +3902,9 @@ class vimconnector(vimconn.VimConnector):
                     self.nova.servers.resize(server=vm_id, flavor=new_flavor_id)
                     vm_state = self.__wait_for_vm(vm_id, "VERIFY_RESIZE")
                     if vm_state:
-                        instance_resized_status = self.confirm_resize(vm_id)
+                        instance_resized_status = self.confirm_resize(
+                            vm_id, instance_status
+                        )
                         return instance_resized_status
                     else:
                         raise nvExceptions.BadRequest(
@@ -3923,7 +3925,7 @@ class vimconnector(vimconn.VimConnector):
         ) as e:
             self._format_exception(e)
 
-    def confirm_resize(self, vm_id):
+    def confirm_resize(self, vm_id, instance_state):
         """
         Confirm the resize of an instance
         param:
@@ -3932,7 +3934,7 @@ class vimconnector(vimconn.VimConnector):
         self._reload_connection()
         self.nova.servers.confirm_resize(server=vm_id)
         if self.get_vdu_state(vm_id)[0] == "VERIFY_RESIZE":
-            self.__wait_for_vm(vm_id, "ACTIVE")
+            self.__wait_for_vm(vm_id, instance_state)
         instance_status = self.get_vdu_state(vm_id)[0]
         return instance_status
 
diff --git a/releasenotes/notes/bug_2310_fix-a89efc73f53f5578.yaml b/releasenotes/notes/bug_2310_fix-a89efc73f53f5578.yaml
new file mode 100644 (file)
index 0000000..830f002
--- /dev/null
@@ -0,0 +1,21 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+fixes:
+  - |
+    This fixes the bug 2310 - NS Termination/Update failing after
+    Vertical-Scaling/Migration/Operate-VNF
diff --git a/releasenotes/notes/bug_fix_2316-94732548c63aea74.yaml b/releasenotes/notes/bug_fix_2316-94732548c63aea74.yaml
new file mode 100644 (file)
index 0000000..cdc420d
--- /dev/null
@@ -0,0 +1,21 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+fixes:
+  - |
+    Fix for bug 2316 Unable to do vertical scaling when VM is in shutdown
+    state.
diff --git a/releasenotes/notes/fix_bug_2303-ce9784503f03a941.yaml b/releasenotes/notes/fix_bug_2303-ce9784503f03a941.yaml
new file mode 100644 (file)
index 0000000..af477b7
--- /dev/null
@@ -0,0 +1,24 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+---
+fixes:
+  - |
+    Fix bug 2303: RO Openstack connector was truncating each of the fields used to
+    build the name of VM instances. This fix removes that truncate in favor of
+    generating the whole name `<NS_NAME>-<VNF_MEMBER>-<VDU_NAME>-<COUNT>`. In case
+    the name must be truncated, it should be done from the resulting full name.
+