From 6a1334a0683121dc94390c8a57aec1c3af208398 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 7 Jul 2022 16:37:28 +0200 Subject: Drop support for instance netboot Change-Id: I2b4c543537dac8904028fdcdb590c1c214238e10 --- ironic_python_agent/extensions/standby.py | 3 --- ironic_python_agent/partition_utils.py | 7 +++--- .../tests/unit/extensions/test_standby.py | 26 +--------------------- .../tests/unit/test_partition_utils.py | 26 ++++++++++------------ .../notes/no-netboot-d034bb1d1d9166c5.yaml | 5 +++++ zuul.d/ironic-python-agent-jobs.yaml | 1 - 6 files changed, 21 insertions(+), 47 deletions(-) create mode 100644 releasenotes/notes/no-netboot-d034bb1d1d9166c5.yaml diff --git a/ironic_python_agent/extensions/standby.py b/ironic_python_agent/extensions/standby.py index 1e7855c4..a78056cd 100644 --- a/ironic_python_agent/extensions/standby.py +++ b/ironic_python_agent/extensions/standby.py @@ -152,7 +152,6 @@ def _write_partition_image(image, image_info, device, configdrive=None): node_uuid = image_info.get('node_uuid') preserve_ep = image_info['preserve_ephemeral'] - boot_option = image_info.get('boot_option', 'local') boot_mode = utils.get_node_boot_mode(cached_node) disk_label = utils.get_partition_table_type_from_specs(cached_node) root_mb = image_info['root_mb'] @@ -175,7 +174,6 @@ def _write_partition_image(image, image_info, device, configdrive=None): image, node_uuid, preserve_ephemeral=preserve_ep, configdrive=configdrive, - boot_option=boot_option, boot_mode=boot_mode, disk_label=disk_label, cpu_arch=cpu_arch) @@ -253,7 +251,6 @@ def _message_format(msg, image_info, device, partition_uuids): efi_system_partition_uuid = ( partition_uuids.get('efi system partition uuid')) if (image_info.get('deploy_boot_mode') == 'uefi' - and image_info.get('boot_option') == 'local' and efi_system_partition_uuid): result_msg = msg + 'root_uuid={} efi_system_partition_uuid={}' message = result_msg.format(image_info['id'], device, diff --git a/ironic_python_agent/partition_utils.py b/ironic_python_agent/partition_utils.py index d82d0072..cb8225fb 100644 --- a/ironic_python_agent/partition_utils.py +++ b/ironic_python_agent/partition_utils.py @@ -187,7 +187,7 @@ def get_labelled_partition(device_path, label, node_uuid): def work_on_disk(dev, root_mb, swap_mb, ephemeral_mb, ephemeral_format, image_path, node_uuid, preserve_ephemeral=False, - configdrive=None, boot_option="netboot", boot_mode="bios", + configdrive=None, boot_mode="bios", tempdir=None, disk_label=None, cpu_arch="", conv_flags=None): """Create partitions and copy an image to the root partition. @@ -206,7 +206,6 @@ def work_on_disk(dev, root_mb, swap_mb, ephemeral_mb, ephemeral_format, partition table has not changed). :param configdrive: Optional. Base64 encoded Gzipped configdrive content or configdrive HTTP URL. - :param boot_option: Can be "local" or "netboot". "netboot" by default. :param boot_mode: Can be "bios" or "uefi". "bios" by default. :param tempdir: A temporary directory :param disk_label: The disk label to be used when creating the @@ -248,7 +247,7 @@ def work_on_disk(dev, root_mb, swap_mb, ephemeral_mb, ephemeral_format, root_mb, swap_mb, ephemeral_mb, configdrive_mb, node_uuid, commit=commit, - boot_option=boot_option, + boot_option='local', boot_mode=boot_mode, disk_label=disk_label, cpu_arch=cpu_arch) @@ -278,7 +277,7 @@ def work_on_disk(dev, root_mb, swap_mb, ephemeral_mb, ephemeral_format, # If it's a uefi localboot, then we have created the efi system # partition. Create a fat filesystem on it. - if boot_mode == "uefi" and boot_option == "local": + if boot_mode == "uefi": efi_system_part = part_dict.get('efi system partition') utils.mkfs(fs='vfat', path=efi_system_part, label='efi-part') diff --git a/ironic_python_agent/tests/unit/extensions/test_standby.py b/ironic_python_agent/tests/unit/extensions/test_standby.py index bce88a00..ccfecc01 100644 --- a/ironic_python_agent/tests/unit/extensions/test_standby.py +++ b/ironic_python_agent/tests/unit/extensions/test_standby.py @@ -53,7 +53,6 @@ def _build_fake_partition_image_info(): 'ephemeral_format': 'abc', 'preserve_ephemeral': 'False', 'image_type': 'partition', - 'boot_option': 'netboot', 'disk_label': 'msdos', 'deploy_boot_mode': 'bios'} @@ -234,7 +233,6 @@ class TestStandbyExtension(base.IronicAgentTest): node_uuid = image_info['node_uuid'] pr_ep = image_info['preserve_ephemeral'] boot_mode = image_info['deploy_boot_mode'] - boot_option = image_info['boot_option'] disk_label = image_info['disk_label'] cpu_arch = self.fake_cpu.architecture @@ -257,7 +255,6 @@ class TestStandbyExtension(base.IronicAgentTest): configdrive='configdrive', preserve_ephemeral=pr_ep, boot_mode=boot_mode, - boot_option=boot_option, disk_label=disk_label, cpu_arch=cpu_arch) @@ -281,7 +278,6 @@ class TestStandbyExtension(base.IronicAgentTest): node_uuid = image_info['node_uuid'] pr_ep = image_info['preserve_ephemeral'] boot_mode = image_info['deploy_boot_mode'] - boot_option = image_info['boot_option'] disk_label = image_info['disk_label'] cpu_arch = self.fake_cpu.architecture @@ -304,7 +300,6 @@ class TestStandbyExtension(base.IronicAgentTest): configdrive='configdrive', preserve_ephemeral=pr_ep, boot_mode=boot_mode, - boot_option=boot_option, disk_label=disk_label, cpu_arch=cpu_arch) @@ -353,7 +348,6 @@ class TestStandbyExtension(base.IronicAgentTest): node_uuid = image_info['node_uuid'] pr_ep = image_info['preserve_ephemeral'] boot_mode = image_info['deploy_boot_mode'] - boot_option = image_info['boot_option'] disk_label = image_info['disk_label'] cpu_arch = self.fake_cpu.architecture @@ -374,7 +368,6 @@ class TestStandbyExtension(base.IronicAgentTest): configdrive='configdrive', preserve_ephemeral=pr_ep, boot_mode=boot_mode, - boot_option=boot_option, disk_label=disk_label, cpu_arch=cpu_arch) @@ -1346,24 +1339,9 @@ class TestStandbyExtension(base.IronicAgentTest): '/dev/fake root_uuid=root_uuid') self.assertEqual(expected_msg, result_msg) - def test__message_format_partition_uefi_netboot(self): + def test__message_format_partition_uefi(self): image_info = _build_fake_partition_image_info() image_info['deploy_boot_mode'] = 'uefi' - image_info['boot_option'] = 'netboot' - msg = ('image ({}) already present on device {} ') - device = '/dev/fake' - partition_uuids = {'root uuid': 'root_uuid', - 'efi system partition uuid': None} - result_msg = standby._message_format(msg, image_info, - device, partition_uuids) - expected_msg = ('image (fake_id) already present on device ' - '/dev/fake root_uuid=root_uuid') - self.assertEqual(expected_msg, result_msg) - - def test__message_format_partition_uefi_localboot(self): - image_info = _build_fake_partition_image_info() - image_info['deploy_boot_mode'] = 'uefi' - image_info['boot_option'] = 'local' msg = ('image ({}) already present on device {} ') device = '/dev/fake' partition_uuids = {'root uuid': 'root_uuid', @@ -1430,7 +1408,6 @@ class TestStandbyExtension(base.IronicAgentTest): ephemeral_format = image_info['ephemeral_format'] node_uuid = image_info['node_uuid'] pr_ep = image_info['preserve_ephemeral'] - boot_option = image_info['boot_option'] cpu_arch = self.fake_cpu.architecture image_path = standby._image_location(image_info) @@ -1452,7 +1429,6 @@ class TestStandbyExtension(base.IronicAgentTest): configdrive='configdrive', preserve_ephemeral=pr_ep, boot_mode='uefi', - boot_option=boot_option, disk_label='gpt', cpu_arch=cpu_arch) diff --git a/ironic_python_agent/tests/unit/test_partition_utils.py b/ironic_python_agent/tests/unit/test_partition_utils.py index 000d98c4..4923642b 100644 --- a/ironic_python_agent/tests/unit/test_partition_utils.py +++ b/ironic_python_agent/tests/unit/test_partition_utils.py @@ -321,7 +321,7 @@ class WorkOnDiskTestCase(base.IronicAgentTest): self.swap_mb, self.ephemeral_mb, self.configdrive_mb, self.node_uuid, commit=True, - boot_option="netboot", + boot_option="local", boot_mode="bios", disk_label=None, cpu_arch="") @@ -340,7 +340,7 @@ class WorkOnDiskTestCase(base.IronicAgentTest): self.swap_mb, self.ephemeral_mb, self.configdrive_mb, self.node_uuid, commit=True, - boot_option="netboot", + boot_option="local", boot_mode="bios", disk_label=None, cpu_arch="") @@ -368,7 +368,7 @@ class WorkOnDiskTestCase(base.IronicAgentTest): self.swap_mb, ephemeral_mb, self.configdrive_mb, self.node_uuid, commit=True, - boot_option="netboot", + boot_option="local", boot_mode="bios", disk_label=None, cpu_arch="") @@ -395,14 +395,13 @@ class WorkOnDiskTestCase(base.IronicAgentTest): self.swap_mb, self.ephemeral_mb, self.ephemeral_format, self.image_path, self.node_uuid, preserve_ephemeral=False, - configdrive=configdrive_url, - boot_option="netboot") + configdrive=configdrive_url) self.assertEqual(self.mock_ibd.call_args_list, calls) self.mock_mp.assert_called_once_with(self.dev, self.root_mb, self.swap_mb, self.ephemeral_mb, configdrive_mb, self.node_uuid, commit=True, - boot_option="netboot", + boot_option="local", boot_mode="bios", disk_label=None, cpu_arch="") @@ -436,7 +435,7 @@ class WorkOnDiskTestCase(base.IronicAgentTest): self.swap_mb, ephemeral_mb, self.configdrive_mb, self.node_uuid, commit=True, - boot_option="netboot", + boot_option="local", boot_mode="bios", disk_label=None, cpu_arch="") @@ -474,7 +473,7 @@ class WorkOnDiskTestCase(base.IronicAgentTest): self.swap_mb, ephemeral_mb, self.configdrive_mb, self.node_uuid, commit=True, - boot_option="netboot", + boot_option="local", boot_mode="bios", disk_label='gpt', cpu_arch="") @@ -483,8 +482,8 @@ class WorkOnDiskTestCase(base.IronicAgentTest): @mock.patch.object(disk_utils, 'block_uuid', autospec=True) @mock.patch.object(disk_utils, 'populate_image', autospec=True) @mock.patch.object(utils, 'mkfs', autospec=True) - def test_uefi_localboot(self, mock_mkfs, mock_populate_image, - mock_block_uuid, mock_trigger_device_rescan): + def test_uefi(self, mock_mkfs, mock_populate_image, + mock_block_uuid, mock_trigger_device_rescan): """Test that we create a fat filesystem with UEFI localboot.""" root_part = '/dev/fake-part1' efi_part = '/dev/fake-part2' @@ -498,7 +497,7 @@ class WorkOnDiskTestCase(base.IronicAgentTest): self.swap_mb, self.ephemeral_mb, self.ephemeral_format, self.image_path, self.node_uuid, - boot_option="local", boot_mode="uefi") + boot_mode="uefi") self.mock_mp.assert_called_once_with(self.dev, self.root_mb, self.swap_mb, self.ephemeral_mb, @@ -544,7 +543,7 @@ class WorkOnDiskTestCase(base.IronicAgentTest): self.swap_mb, ephemeral_mb, self.configdrive_mb, self.node_uuid, commit=False, - boot_option="netboot", + boot_option="local", boot_mode="bios", disk_label=None, cpu_arch="") @@ -568,8 +567,7 @@ class WorkOnDiskTestCase(base.IronicAgentTest): partition_utils.work_on_disk(self.dev, self.root_mb, self.swap_mb, self.ephemeral_mb, self.ephemeral_format, self.image_path, - self.node_uuid, boot_option="local", - cpu_arch='ppc64le') + self.node_uuid, cpu_arch='ppc64le') self.assertEqual(self.mock_ibd.call_args_list, calls) self.mock_mp.assert_called_once_with(self.dev, self.root_mb, self.swap_mb, self.ephemeral_mb, diff --git a/releasenotes/notes/no-netboot-d034bb1d1d9166c5.yaml b/releasenotes/notes/no-netboot-d034bb1d1d9166c5.yaml new file mode 100644 index 00000000..4502429c --- /dev/null +++ b/releasenotes/notes/no-netboot-d034bb1d1d9166c5.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + No longer supports network boot of instances (``boot_option=netboot``). + This feature is dropped from Ironic in the Zed cycle. diff --git a/zuul.d/ironic-python-agent-jobs.yaml b/zuul.d/ironic-python-agent-jobs.yaml index 05c8116b..3e06c8c0 100644 --- a/zuul.d/ironic-python-agent-jobs.yaml +++ b/zuul.d/ironic-python-agent-jobs.yaml @@ -39,7 +39,6 @@ s-proxy: True devstack_localrc: IRONIC_BOOT_MODE: bios - IRONIC_DEFAULT_BOOT_OPTION: netboot IRONIC_DEFAULT_DEPLOY_INTERFACE: direct SWIFT_ENABLE_TEMPURLS: True SWIFT_TEMPURL_KEY: secretkey -- cgit v1.2.1