diff --git a/ironic/drivers/modules/agent.py b/ironic/drivers/modules/agent.py index 65aba00c51..0c9814bd8d 100644 --- a/ironic/drivers/modules/agent.py +++ b/ironic/drivers/modules/agent.py @@ -486,6 +486,10 @@ class AgentVendorInterface(agent_base_vendor.BaseAgentVendor): else: image_info['deploy_boot_mode'] = 'bios' image_info['boot_option'] = boot_option + disk_label = deploy_utils.get_disk_label(node) + if disk_label is not None: + image_info['disk_label'] = disk_label + image_info['node_uuid'] = node.uuid # Tell the client to download and write the image with the given args self._client.prepare_image(node, image_info) diff --git a/ironic/tests/unit/drivers/modules/test_agent.py b/ironic/tests/unit/drivers/modules/test_agent.py index 147612e3ee..c22a4c1e47 100644 --- a/ironic/tests/unit/drivers/modules/test_agent.py +++ b/ironic/tests/unit/drivers/modules/test_agent.py @@ -690,7 +690,8 @@ class TestAgentVendor(db_base.DbTestCase): i_info['image_type'] = 'partition' i_info['root_mb'] = 10240 i_info['deploy_boot_mode'] = 'bios' - i_info['capabilities'] = '{"boot_option": "local"}' + i_info['capabilities'] = {"boot_option": "local", + "disk_label": "msdos"} self.node.instance_info = i_info driver_internal_info = self.node.driver_internal_info driver_internal_info['is_whole_disk_image'] = False @@ -700,6 +701,7 @@ class TestAgentVendor(db_base.DbTestCase): expected_image_info = { 'urls': [test_temp_url], 'id': 'fake-image', + 'node_uuid': self.node.uuid, 'checksum': 'checksum', 'disk_format': 'qcow2', 'container_format': 'bare', @@ -715,7 +717,8 @@ class TestAgentVendor(db_base.DbTestCase): 'image_type': 'partition', 'root_mb': 10240, 'boot_option': 'local', - 'deploy_boot_mode': 'bios' + 'deploy_boot_mode': 'bios', + 'disk_label': 'msdos' } client_mock = mock.MagicMock(spec_set=['prepare_image']) diff --git a/releasenotes/notes/disk-label-fix-7580de913835ff44.yaml b/releasenotes/notes/disk-label-fix-7580de913835ff44.yaml new file mode 100644 index 0000000000..b7a8d53143 --- /dev/null +++ b/releasenotes/notes/disk-label-fix-7580de913835ff44.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Fixes the bug where the user specified + disk_label is ignored for the agent + drivers for partition images.