diff --git a/nova/tests/unit/virt/ironic/test_driver.py b/nova/tests/unit/virt/ironic/test_driver.py index e696a24c00b2..d640663a2dab 100644 --- a/nova/tests/unit/virt/ironic/test_driver.py +++ b/nova/tests/unit/virt/ironic/test_driver.py @@ -2219,8 +2219,9 @@ class IronicDriverTestCase(test.NoDBTestCase): mock_add_instance_info.assert_called_once_with( node, instance, test.MatchType(objects.ImageMeta), + flavor, test.MatchType(driver.InstanceDriverMetadata), - flavor, preserve) + preserve_ephemeral=preserve) self.mock_conn.set_node_provision_state.assert_called_once_with( node_uuid, ironic_states.REBUILD, config_drive=mock.ANY, ) diff --git a/nova/virt/ironic/driver.py b/nova/virt/ironic/driver.py index 271728d989ec..5daca40d5cad 100644 --- a/nova/virt/ironic/driver.py +++ b/nova/virt/ironic/driver.py @@ -1737,8 +1737,9 @@ class IronicDriver(virt_driver.ComputeDriver): node = self._get_node(node_id) metadata = self.get_instance_driver_metadata(instance, network_info) - self._add_instance_info_to_node(node, instance, image_meta, metadata, - instance.flavor, preserve_ephemeral) + self._add_instance_info_to_node(node, instance, image_meta, + instance.flavor, metadata, + preserve_ephemeral=preserve_ephemeral) # Config drive configdrive_value = None diff --git a/releasenotes/notes/bug-2092570-fix-parameter-order-in-add_instance_info_to_node.yaml b/releasenotes/notes/bug-2092570-fix-parameter-order-in-add_instance_info_to_node.yaml new file mode 100644 index 000000000000..7e1da8e9d643 --- /dev/null +++ b/releasenotes/notes/bug-2092570-fix-parameter-order-in-add_instance_info_to_node.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixed an issue where the instance rebuild option failed for Ironic instances. + The problem was caused by an incorrect parameter order in the ``add_instance_info_to_node`` + function, which was introduced by commit `93b90d2b` . + For more details, see `bug 2092570` .