Bug 2316: Fix for Unable to do vertical scaling when VM is in Shutdown state 19/14019/4
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>
RO-VIM-openstack/osm_rovim_openstack/vimconn_openstack.py
releasenotes/notes/bug_fix_2316-94732548c63aea74.yaml [new file with mode: 0644]

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_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.