From 089604d201ec4ba6a150d1e583d5e6e20d82aca0 Mon Sep 17 00:00:00 2001 From: jskunda Date: Wed, 21 Jun 2023 12:11:05 +0200 Subject: [PATCH 1/4] Drop Fedora support We are about to drop Fedora support as the latest image in upstream has been transitioned to EOL. Centos 9 Stream has evolved as replacement platform for new features. Patch which removes fedora jobs and nodeset from devstack: https://review.opendev.org/c/openstack/devstack/+/885467 This is needed for https://review.opendev.org/c/openstack/devstack/+/925837 Change-Id: Ib7d3dd93602c94fd801f8fe5daa26353b04f589b (cherry picked from commit 86c542c56a1da23b1ba71cf2f6f2b76332c3b0a6) (cherry picked from commit fde9368dd7c50c2e5601d5683ded60677c657dc8) (cherry picked from commit 25aafcfce38711eb61a653fb0d09162ea72c5c84) --- .zuul.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 92b88560f6b..1afdbaa2b63 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -705,10 +705,6 @@ irrelevant-files: *nova-base-irrelevant-files - os-vif-ovs: irrelevant-files: *nova-base-irrelevant-files - - devstack-platform-fedora-latest: - irrelevant-files: *nova-base-irrelevant-files - - devstack-platform-fedora-latest-virt-preview: - irrelevant-files: *nova-base-irrelevant-files - devstack-plugin-ceph-compute-local-ephemeral: irrelevant-files: *nova-base-irrelevant-files - devstack-tobiko-nova: From e31c2a5c7df19e5b8fb357f46581199f9f3fa978 Mon Sep 17 00:00:00 2001 From: "zhong.zhou" Date: Wed, 17 Jul 2024 18:29:46 +0800 Subject: [PATCH 2/4] nova-manage: modify image properties in request_spec At present, we can modify the properties in the instance system_metadata through the sub command image_property of nova-manage, but there may be inconsistencies between their values and those in request_specs. And the migration is based on request_specs, so the same image properties are also written to request_specs. Closes-Bug: 2078999 Change-Id: Id36ecd022cb6f7f9a0fb131b0d202b79715870a9 (cherry picked from commit 2a1fad41453ca7ce15b1cd9b517055c4ccdd12cf) (cherry picked from commit ebae97c62f1af6b3b9f6da2abfa920d6528ddb1b) (cherry picked from commit ee30457accabcea10a62652d14d2cf08a6d57ac0) (cherry picked from commit 3fe5c69b73f01a95fa6df017ea0557298fd6126c) (cherry picked from commit 44995b430a604ec24e56f49f9dde27c65ed8cc45) --- nova/cmd/manage.py | 10 ++++++++-- nova/tests/unit/cmd/test_manage.py | 14 ++++++++++++-- ...mage-property-bug-2078999-c493fc259d316c24.yaml | 8 ++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/nova-manage-image-property-bug-2078999-c493fc259d316c24.yaml diff --git a/nova/cmd/manage.py b/nova/cmd/manage.py index 7067facde70..f13f6fddfc2 100644 --- a/nova/cmd/manage.py +++ b/nova/cmd/manage.py @@ -3266,9 +3266,10 @@ def _validate_image_properties(self, image_properties): # Return the dict so we can update the instance system_metadata return image_properties - def _update_image_properties(self, instance, image_properties): + def _update_image_properties(self, ctxt, instance, image_properties): """Update instance image properties + :param ctxt: nova.context.RequestContext :param instance: The instance to update :param image_properties: List of image properties and values to update """ @@ -3292,8 +3293,13 @@ def _update_image_properties(self, instance, image_properties): for image_property, value in image_properties.items(): instance.system_metadata[f'image_{image_property}'] = value + request_spec = objects.RequestSpec.get_by_instance_uuid( + ctxt, instance.uuid) + request_spec.image = instance.image_meta + # Save and return 0 instance.save() + request_spec.save() return 0 @action_description(_( @@ -3328,7 +3334,7 @@ def set(self, instance_uuid=None, image_properties=None): instance = objects.Instance.get_by_uuid( cctxt, instance_uuid, expected_attrs=['system_metadata']) return self._update_image_properties( - instance, image_properties) + ctxt, instance, image_properties) except ValueError as e: print(str(e)) return 6 diff --git a/nova/tests/unit/cmd/test_manage.py b/nova/tests/unit/cmd/test_manage.py index 82c3d3c84ad..3775a0b2c96 100644 --- a/nova/tests/unit/cmd/test_manage.py +++ b/nova/tests/unit/cmd/test_manage.py @@ -4052,6 +4052,8 @@ def test_show_image_properties_unknown_failure( image_property='hw_disk_bus') self.assertEqual(1, ret, 'return code') + @mock.patch('nova.objects.RequestSpec.save') + @mock.patch('nova.objects.RequestSpec.get_by_instance_uuid') @mock.patch('nova.objects.Instance.get_by_uuid') @mock.patch('nova.context.target_cell') @mock.patch('nova.objects.Instance.save') @@ -4060,7 +4062,8 @@ def test_show_image_properties_unknown_failure( @mock.patch('nova.context.get_admin_context', new=mock.Mock(return_value=mock.sentinel.ctxt)) def test_set_image_properties( - self, mock_instance_save, mock_target_cell, mock_get_instance + self, mock_instance_save, mock_target_cell, mock_get_instance, + mock_get_request_spec, mock_request_spec_save ): mock_target_cell.return_value.__enter__.return_value = \ mock.sentinel.cctxt @@ -4069,9 +4072,11 @@ def test_set_image_properties( vm_state=obj_fields.InstanceState.STOPPED, system_metadata={ 'image_hw_disk_bus': 'virtio', - } + }, + image_ref='' ) mock_get_instance.return_value = instance + mock_get_request_spec.return_value = objects.RequestSpec() ret = self.commands.set( instance_uuid=uuidsentinel.instance, image_properties=['hw_cdrom_bus=sata'] @@ -4088,7 +4093,12 @@ def test_set_image_properties( instance.system_metadata.get('image_hw_disk_bus'), 'image_hw_disk_bus' ) + image_props = mock_get_request_spec.return_value.image.properties + self.assertEqual('sata', image_props.get('hw_cdrom_bus')) + self.assertEqual('virtio', image_props.get('hw_disk_bus')) + mock_instance_save.assert_called_once() + mock_request_spec_save.assert_called_once() @mock.patch('nova.objects.Instance.get_by_uuid') @mock.patch('nova.objects.InstanceMapping.get_by_instance_uuid', diff --git a/releasenotes/notes/nova-manage-image-property-bug-2078999-c493fc259d316c24.yaml b/releasenotes/notes/nova-manage-image-property-bug-2078999-c493fc259d316c24.yaml new file mode 100644 index 00000000000..03123855e0e --- /dev/null +++ b/releasenotes/notes/nova-manage-image-property-bug-2078999-c493fc259d316c24.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Before the `Bug 2078999 `_ was fixed, + the ``nova-manage image_property set`` command would update the image properties + embedded in the instance but would not update the ones in the request specs. This + led to an unexpected rollback of the image properties that were updated by the + command after an instance migration. From bde1adca16ac8fd4377320222f7037af957dc6cd Mon Sep 17 00:00:00 2001 From: Elod Illes Date: Tue, 13 May 2025 15:06:27 +0200 Subject: [PATCH 3/4] [tool] Fix backport validator for non-SLURP non-SLURP branches are EOL'd in case they reach their end of maintained phase. This could produce a situation when a patch is merged in a non-SLURP branch that was deleted in the meantime and it's further backports fail on gate with backport validator as the hash of the non-SLURP version of the patch is not on any branch. This patch fixes the above issue as follows: in case a hash is not found on any branch, then it checks if it can be found under any *-eol tag and only fails if there is not found either. Change-Id: I56705bce8ee4354cd5cb1577a520c2d1c525f57b (cherry picked from commit e383b465458969ec9271013f2b9e9f24b8225418) (cherry picked from commit 8b0ae7243f8d581e1e73f0b9dcccf710666d931f) (cherry picked from commit 88e49dd65c58536ba8dd39ab7cfde669a433f3f6) (cherry picked from commit db438e55e62599faf2931d0992a5c7689ade3610) (cherry picked from commit 0fdd21fb4ba4d8c0f5ad45cb8bf1d2698c382c6d) (cherry picked from commit 75497b0ba61e85afed3f4a0660c20b2d13cb2ae0) --- tools/check-cherry-picks.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/check-cherry-picks.sh b/tools/check-cherry-picks.sh index 74887a9178b..fe75867e59f 100755 --- a/tools/check-cherry-picks.sh +++ b/tools/check-cherry-picks.sh @@ -26,8 +26,11 @@ branches+="" for hash in $hashes; do branch=$(git branch -a --contains "$hash" 2>/dev/null| grep -oE '(master|stable/[a-z0-9.]+|unmaintained/[a-z0-9.]+)') if [ $? -ne 0 ]; then - echo "Cherry pick hash $hash not on any master, stable or unmaintained branches" - exit 1 + branch=$(git tag --contains "$hash" 2>/dev/null| grep -oE '([0-9.]+-eol)') + if [ $? -ne 0 ]; then + echo "Cherry pick hash $hash not on any master, stable, unmaintained or EOL'd branches" + exit 1 + fi fi branches+=" $branch" checked=$(($checked + 1)) From 371892dbcf507dbaf466f4b4ab2906cb2d9084c3 Mon Sep 17 00:00:00 2001 From: Elod Illes Date: Thu, 24 Jul 2025 15:37:20 +0200 Subject: [PATCH 4/4] [CI][stable-only] Remove fedora based jobs devstack-platform-fedora-latest and devstack-platform-fedora-latest-virt-preview jobs (in experimental queue) are not defined anymore, so zuul drops config error because of them, thus they have to be removed. Change-Id: I29e4c3640c6187b2c97596ec09b96c2c6feb74de Signed-off-by: Elod Illes --- .zuul.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index ea488401cf2..4a0d9e03281 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -715,10 +715,6 @@ irrelevant-files: *nova-base-irrelevant-files - os-vif-ovs: irrelevant-files: *nova-base-irrelevant-files - - devstack-platform-fedora-latest: - irrelevant-files: *nova-base-irrelevant-files - - devstack-platform-fedora-latest-virt-preview: - irrelevant-files: *nova-base-irrelevant-files - devstack-plugin-ceph-compute-local-ephemeral: irrelevant-files: *nova-base-irrelevant-files - devstack-tobiko-nova: