From fb70e05ae9cd33d74122460dff073251afac9db0 Mon Sep 17 00:00:00 2001 From: Pavlo Shchelokovskyy Date: Thu, 6 Oct 2016 14:22:25 +0300 Subject: [PATCH] Cleanup unused (i)PXE kernel parameters Bash ramdisk is long deprecated already, but its options are still passed over as kernel parameters in boot config templates. This patch removes all options that are no longer used by IPA-based ramdisk. List of removed kernel parameters: - deployment_id, deployment_key, ironic_api_url, iscsi_target_iqn: used only in bash ramdisk - boot_option, boot_mode, disk: now are either auto-discovered by IPA or fetched from node - root_device: passing root device hints to IPA as kernel parameter was deprecated in Newton. With this change, usage of root device hints with ramdisks containing IPA of Mitaka release or older will not be possible. Change-Id: I5e434bf0cc7819cf003c29f01e822a8fbde034c8 Closes-Bug: #1630799 --- ironic/drivers/base.py | 2 +- ironic/drivers/modules/agent_config.template | 2 +- ironic/drivers/modules/deploy_utils.py | 6 -- .../modules/elilo_efi_pxe_config.template | 2 +- ironic/drivers/modules/ipxe_config.template | 2 +- ironic/drivers/modules/pxe_config.template | 2 +- .../drivers/modules/pxe_grub_config.template | 2 +- ironic/tests/unit/common/test_pxe_utils.py | 93 ++++--------------- .../unit/drivers/agent_pxe_config.template | 14 --- .../drivers/elilo_efi_pxe_config.template | 2 +- .../tests/unit/drivers/ipxe_config.template | 2 +- .../unit/drivers/ipxe_config_timeout.template | 2 +- .../unit/drivers/ipxe_uefi_config.template | 21 ----- .../unit/drivers/modules/test_deploy_utils.py | 8 -- ironic/tests/unit/drivers/pxe_config.template | 2 +- .../unit/drivers/pxe_grub_config.template | 2 +- ...vice-as-kernel-param-5e5326acae7b77a4.yaml | 11 +++ 17 files changed, 42 insertions(+), 133 deletions(-) delete mode 100644 ironic/tests/unit/drivers/agent_pxe_config.template delete mode 100644 ironic/tests/unit/drivers/ipxe_uefi_config.template create mode 100644 releasenotes/notes/no-root-device-as-kernel-param-5e5326acae7b77a4.yaml diff --git a/ironic/drivers/base.py b/ironic/drivers/base.py index af4aab9bc5..d7b114bedc 100644 --- a/ironic/drivers/base.py +++ b/ironic/drivers/base.py @@ -440,7 +440,7 @@ class BootInterface(object): different ways by passing parameters to them. For example, When Agent ramdisk is booted to deploy a node, it takes the - parameters ipa-driver-name, ipa-api-url, root_device, etc. + parameters ipa-driver-name, ipa-api-url, etc. Other implementations can make use of ramdisk_params to pass such information. Different implementations of boot interface will diff --git a/ironic/drivers/modules/agent_config.template b/ironic/drivers/modules/agent_config.template index cf1a871586..1392db6328 100644 --- a/ironic/drivers/modules/agent_config.template +++ b/ironic/drivers/modules/agent_config.template @@ -2,7 +2,7 @@ default deploy label deploy kernel {{ pxe_options.deployment_aki_path }} -append initrd={{ pxe_options.deployment_ari_path }} text {{ pxe_options.pxe_append_params }} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }}{% if pxe_options.root_device %} root_device={{ pxe_options.root_device }}{% endif %} coreos.configdrive=0 +append initrd={{ pxe_options.deployment_ari_path }} text {{ pxe_options.pxe_append_params }} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} coreos.configdrive=0 label boot_partition kernel {{ pxe_options.aki_path }} diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py index 32bb16deb1..cc3efca6c4 100644 --- a/ironic/drivers/modules/deploy_utils.py +++ b/ironic/drivers/modules/deploy_utils.py @@ -1049,12 +1049,6 @@ def build_agent_options(node): # NOTE: The below entry is a temporary workaround for bug/1433812 'coreos.configdrive': 0, } - # TODO(dtantsur): deprecate in favor of reading root hints directly from a - # node record. - root_device = parse_root_device_hints(node) - if root_device: - agent_config_opts['root_device'] = root_device - return agent_config_opts diff --git a/ironic/drivers/modules/elilo_efi_pxe_config.template b/ironic/drivers/modules/elilo_efi_pxe_config.template index 3aea37e3f1..daefabdd49 100644 --- a/ironic/drivers/modules/elilo_efi_pxe_config.template +++ b/ironic/drivers/modules/elilo_efi_pxe_config.template @@ -3,7 +3,7 @@ default=deploy image={{pxe_options.deployment_aki_path}} label=deploy initrd={{pxe_options.deployment_ari_path}} - append="selinux=0 disk={{ pxe_options.disk }} iscsi_target_iqn={{ pxe_options.iscsi_target_iqn }} deployment_id={{ pxe_options.deployment_id }} deployment_key={{ pxe_options.deployment_key }} ironic_api_url={{ pxe_options.ironic_api_url }} troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} ip=%I:{{pxe_options.tftp_server}}:%G:%M:%H::on {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} boot_option={{ pxe_options.boot_option }} boot_mode={{ pxe_options['boot_mode'] }} coreos.configdrive=0" + append="selinux=0 troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} ip=%I:{{pxe_options.tftp_server}}:%G:%M:%H::on ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} coreos.configdrive=0" image={{pxe_options.aki_path}} diff --git a/ironic/drivers/modules/ipxe_config.template b/ironic/drivers/modules/ipxe_config.template index 43519ef10a..64b8147d2e 100644 --- a/ironic/drivers/modules/ipxe_config.template +++ b/ironic/drivers/modules/ipxe_config.template @@ -6,7 +6,7 @@ goto deploy :deploy imgfree -kernel {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.deployment_aki_path }} selinux=0 disk={{ pxe_options.disk }} iscsi_target_iqn={{ pxe_options.iscsi_target_iqn }} deployment_id={{ pxe_options.deployment_id }} deployment_key={{ pxe_options.deployment_key }} ironic_api_url={{ pxe_options.ironic_api_url }} troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} boot_option={{ pxe_options.boot_option }} ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} boot_mode={{ pxe_options['boot_mode'] }} initrd=deploy_ramdisk coreos.configdrive=0 || goto deploy +kernel {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.deployment_aki_path }} selinux=0 troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} initrd=deploy_ramdisk coreos.configdrive=0 || goto deploy initrd {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.deployment_ari_path }} || goto deploy boot diff --git a/ironic/drivers/modules/pxe_config.template b/ironic/drivers/modules/pxe_config.template index f932448e57..3878ea71e6 100644 --- a/ironic/drivers/modules/pxe_config.template +++ b/ironic/drivers/modules/pxe_config.template @@ -2,7 +2,7 @@ default deploy label deploy kernel {{ pxe_options.deployment_aki_path }} -append initrd={{ pxe_options.deployment_ari_path }} selinux=0 disk={{ pxe_options.disk }} iscsi_target_iqn={{ pxe_options.iscsi_target_iqn }} deployment_id={{ pxe_options.deployment_id }} deployment_key={{ pxe_options.deployment_key }} ironic_api_url={{ pxe_options.ironic_api_url }} troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} boot_option={{ pxe_options.boot_option }} {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} boot_mode={{ pxe_options['boot_mode'] }} coreos.configdrive=0 +append initrd={{ pxe_options.deployment_ari_path }} selinux=0 troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} coreos.configdrive=0 ipappend 3 diff --git a/ironic/drivers/modules/pxe_grub_config.template b/ironic/drivers/modules/pxe_grub_config.template index bee7920f99..1b6de7a224 100644 --- a/ironic/drivers/modules/pxe_grub_config.template +++ b/ironic/drivers/modules/pxe_grub_config.template @@ -3,7 +3,7 @@ set timeout=5 set hidden_timeout_quiet=false menuentry "deploy" { - linuxefi {{ pxe_options.deployment_aki_path }} selinux=0 troubleshoot=0 text disk={{ pxe_options.disk }} iscsi_target_iqn={{ pxe_options.iscsi_target_iqn }} deployment_id={{ pxe_options.deployment_id }} deployment_key={{ pxe_options.deployment_key }} ironic_api_url={{ pxe_options.ironic_api_url }} {{ pxe_options.pxe_append_params|default("", true) }} boot_server={{pxe_options.tftp_server}} {% if pxe_options.root_device %}root_device={{ pxe_options.root_device }}{% endif %} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} boot_option={{ pxe_options.boot_option }} boot_mode={{ pxe_options['boot_mode'] }} coreos.configdrive=0 + linuxefi {{ pxe_options.deployment_aki_path }} selinux=0 troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} boot_server={{pxe_options.tftp_server}} ipa-api-url={{ pxe_options['ipa-api-url'] }} ipa-driver-name={{ pxe_options['ipa-driver-name'] }} coreos.configdrive=0 initrdefi {{ pxe_options.deployment_ari_path }} } diff --git a/ironic/tests/unit/common/test_pxe_utils.py b/ironic/tests/unit/common/test_pxe_utils.py index e35992fb8a..781a69b8b9 100644 --- a/ironic/tests/unit/common/test_pxe_utils.py +++ b/ironic/tests/unit/common/test_pxe_utils.py @@ -46,38 +46,15 @@ class TestPXEUtils(db_base.DbTestCase): 'pxe_append_params': 'test_param', 'deployment_ari_path': u'/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7' u'f33c123/deploy_ramdisk', - 'root_device': 'vendor=fake,size=123', 'ipa-api-url': 'http://192.168.122.184:6385', 'ipxe_timeout': 0, } self.pxe_options = { - 'deployment_key': '0123456789ABCDEFGHIJKLMNOPQRSTUV', - 'iscsi_target_iqn': u'iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33' - u'c123', - 'deployment_id': u'1be26c0b-03f2-4d2e-ae87-c02d7f33c123', - 'ironic_api_url': 'http://192.168.122.184:6385', - 'disk': 'cciss/c0d0,sda,hda,vda', - 'boot_option': 'netboot', 'ipa-driver-name': 'pxe_ssh', } self.pxe_options.update(common_pxe_options) - self.pxe_options_bios = { - 'boot_mode': 'bios', - } - self.pxe_options_bios.update(self.pxe_options) - - self.pxe_options_uefi = { - 'boot_mode': 'uefi', - } - self.pxe_options_uefi.update(self.pxe_options) - - self.agent_pxe_options = { - 'ipa-driver-name': 'agent_ipmitool', - } - self.agent_pxe_options.update(common_pxe_options) - self.ipxe_options = self.pxe_options.copy() self.ipxe_options.update({ 'deployment_aki_path': 'http://1.2.3.4:1234/deploy_kernel', @@ -86,27 +63,17 @@ class TestPXEUtils(db_base.DbTestCase): 'ari_path': 'http://1.2.3.4:1234/ramdisk', }) - self.ipxe_options_bios = { - 'boot_mode': 'bios', - } - self.ipxe_options_bios.update(self.ipxe_options) - - self.ipxe_options_timeout = self.ipxe_options_bios.copy() + self.ipxe_options_timeout = self.ipxe_options.copy() self.ipxe_options_timeout.update({ 'ipxe_timeout': 120 }) - self.ipxe_options_uefi = { - 'boot_mode': 'uefi', - } - self.ipxe_options_uefi.update(self.ipxe_options) - self.node = object_utils.create_test_node(self.context) def test__build_pxe_config(self): rendered_template = pxe_utils._build_pxe_config( - self.pxe_options_bios, CONF.pxe.pxe_config_template, + self.pxe_options, CONF.pxe.pxe_config_template, '{{ ROOT }}', '{{ DISK_IDENTIFIER }}') expected_template = open( @@ -114,7 +81,7 @@ class TestPXEUtils(db_base.DbTestCase): self.assertEqual(six.text_type(expected_template), rendered_template) - def test__build_ipxe_bios_config(self): + def test__build_ipxe_config(self): # NOTE(lucasagomes): iPXE is just an extension of the PXE driver, # it doesn't have it's own configuration option for template. # More info: @@ -125,7 +92,7 @@ class TestPXEUtils(db_base.DbTestCase): ) self.config(http_url='http://1.2.3.4:1234', group='deploy') rendered_template = pxe_utils._build_pxe_config( - self.ipxe_options_bios, CONF.pxe.pxe_config_template, + self.ipxe_options, CONF.pxe.pxe_config_template, '{{ ROOT }}', '{{ DISK_IDENTIFIER }}') expected_template = open( @@ -152,26 +119,6 @@ class TestPXEUtils(db_base.DbTestCase): self.assertEqual(six.text_type(expected_template), rendered_template) - def test__build_ipxe_uefi_config(self): - # NOTE(lucasagomes): iPXE is just an extension of the PXE driver, - # it doesn't have it's own configuration option for template. - # More info: - # http://docs.openstack.org/developer/ironic/deploy/install-guide.html - self.config( - pxe_config_template='ironic/drivers/modules/ipxe_config.template', - group='pxe' - ) - self.config(http_url='http://1.2.3.4:1234', group='deploy') - rendered_template = pxe_utils._build_pxe_config( - self.ipxe_options_uefi, CONF.pxe.pxe_config_template, - '{{ ROOT }}', '{{ DISK_IDENTIFIER }}') - - expected_template = open( - 'ironic/tests/unit/drivers/' - 'ipxe_uefi_config.template').read().rstrip() - - self.assertEqual(six.text_type(expected_template), rendered_template) - def test__build_elilo_config(self): pxe_opts = self.pxe_options pxe_opts['boot_mode'] = 'uefi' @@ -316,11 +263,11 @@ class TestPXEUtils(db_base.DbTestCase): @mock.patch('oslo_utils.fileutils.ensure_tree', autospec=True) def test_create_pxe_config(self, ensure_tree_mock, build_mock, write_mock): - build_mock.return_value = self.pxe_options_bios + build_mock.return_value = self.pxe_options with task_manager.acquire(self.context, self.node.uuid) as task: - pxe_utils.create_pxe_config(task, self.pxe_options_bios, + pxe_utils.create_pxe_config(task, self.pxe_options, CONF.pxe.pxe_config_template) - build_mock.assert_called_with(self.pxe_options_bios, + build_mock.assert_called_with(self.pxe_options, CONF.pxe.pxe_config_template, '{{ ROOT }}', '{{ DISK_IDENTIFIER }}') @@ -331,7 +278,7 @@ class TestPXEUtils(db_base.DbTestCase): ensure_tree_mock.assert_has_calls(ensure_calls) pxe_cfg_file_path = pxe_utils.get_pxe_config_file_path(self.node.uuid) - write_mock.assert_called_with(pxe_cfg_file_path, self.pxe_options_bios) + write_mock.assert_called_with(pxe_cfg_file_path, self.pxe_options) @mock.patch('ironic.common.pxe_utils._link_ip_address_pxe_configs', autospec=True) @@ -345,10 +292,10 @@ class TestPXEUtils(db_base.DbTestCase): 'elilo_efi_pxe_config.template'), group='pxe' ) - build_mock.return_value = self.pxe_options_uefi + build_mock.return_value = self.pxe_options with task_manager.acquire(self.context, self.node.uuid) as task: task.node.properties['capabilities'] = 'boot_mode:uefi' - pxe_utils.create_pxe_config(task, self.pxe_options_uefi, + pxe_utils.create_pxe_config(task, self.pxe_options, CONF.pxe.uefi_pxe_config_template) ensure_calls = [ @@ -356,14 +303,14 @@ class TestPXEUtils(db_base.DbTestCase): mock.call(os.path.join(CONF.pxe.tftp_root, 'pxelinux.cfg')) ] ensure_tree_mock.assert_has_calls(ensure_calls) - build_mock.assert_called_with(self.pxe_options_uefi, + build_mock.assert_called_with(self.pxe_options, CONF.pxe.uefi_pxe_config_template, '{{ ROOT }}', '{{ DISK_IDENTIFIER }}') link_ip_configs_mock.assert_called_once_with(task, True) pxe_cfg_file_path = pxe_utils.get_pxe_config_file_path(self.node.uuid) - write_mock.assert_called_with(pxe_cfg_file_path, self.pxe_options_uefi) + write_mock.assert_called_with(pxe_cfg_file_path, self.pxe_options) @mock.patch('ironic.common.pxe_utils._link_ip_address_pxe_configs', autospec=True) @@ -372,11 +319,11 @@ class TestPXEUtils(db_base.DbTestCase): @mock.patch('oslo_utils.fileutils.ensure_tree', autospec=True) def test_create_pxe_config_uefi_grub(self, ensure_tree_mock, build_mock, write_mock, link_ip_configs_mock): - build_mock.return_value = self.pxe_options_uefi + build_mock.return_value = self.pxe_options grub_tmplte = "ironic/drivers/modules/pxe_grub_config.template" with task_manager.acquire(self.context, self.node.uuid) as task: task.node.properties['capabilities'] = 'boot_mode:uefi' - pxe_utils.create_pxe_config(task, self.pxe_options_uefi, + pxe_utils.create_pxe_config(task, self.pxe_options, grub_tmplte) ensure_calls = [ @@ -384,14 +331,14 @@ class TestPXEUtils(db_base.DbTestCase): mock.call(os.path.join(CONF.pxe.tftp_root, 'pxelinux.cfg')) ] ensure_tree_mock.assert_has_calls(ensure_calls) - build_mock.assert_called_with(self.pxe_options_uefi, + build_mock.assert_called_with(self.pxe_options, grub_tmplte, '(( ROOT ))', '(( DISK_IDENTIFIER ))') link_ip_configs_mock.assert_called_once_with(task, False) pxe_cfg_file_path = pxe_utils.get_pxe_config_file_path(self.node.uuid) - write_mock.assert_called_with(pxe_cfg_file_path, self.pxe_options_uefi) + write_mock.assert_called_with(pxe_cfg_file_path, self.pxe_options) @mock.patch('ironic.common.pxe_utils._link_mac_pxe_configs', autospec=True) @@ -401,11 +348,11 @@ class TestPXEUtils(db_base.DbTestCase): def test_create_pxe_config_uefi_ipxe(self, ensure_tree_mock, build_mock, write_mock, link_mac_pxe_mock): self.config(ipxe_enabled=True, group='pxe') - build_mock.return_value = self.ipxe_options_uefi + build_mock.return_value = self.ipxe_options ipxe_template = "ironic/drivers/modules/ipxe_config.template" with task_manager.acquire(self.context, self.node.uuid) as task: task.node.properties['capabilities'] = 'boot_mode:uefi' - pxe_utils.create_pxe_config(task, self.ipxe_options_uefi, + pxe_utils.create_pxe_config(task, self.ipxe_options, ipxe_template) ensure_calls = [ @@ -413,7 +360,7 @@ class TestPXEUtils(db_base.DbTestCase): mock.call(os.path.join(CONF.deploy.http_root, 'pxelinux.cfg')) ] ensure_tree_mock.assert_has_calls(ensure_calls) - build_mock.assert_called_with(self.ipxe_options_uefi, + build_mock.assert_called_with(self.ipxe_options, ipxe_template, '{{ ROOT }}', '{{ DISK_IDENTIFIER }}') @@ -421,7 +368,7 @@ class TestPXEUtils(db_base.DbTestCase): pxe_cfg_file_path = pxe_utils.get_pxe_config_file_path(self.node.uuid) write_mock.assert_called_with(pxe_cfg_file_path, - self.ipxe_options_uefi) + self.ipxe_options) @mock.patch('ironic.common.utils.rmtree_without_raise', autospec=True) @mock.patch('ironic_lib.utils.unlink_without_raise', autospec=True) diff --git a/ironic/tests/unit/drivers/agent_pxe_config.template b/ironic/tests/unit/drivers/agent_pxe_config.template deleted file mode 100644 index 347d05c1b9..0000000000 --- a/ironic/tests/unit/drivers/agent_pxe_config.template +++ /dev/null @@ -1,14 +0,0 @@ -default deploy - -label deploy -kernel /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_kernel -append initrd=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_ramdisk text test_param ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=agent_ipmitool root_device=vendor=fake,size=123 coreos.configdrive=0 - -label boot_partition -kernel /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/kernel -append initrd=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/ramdisk root={{ ROOT }} ro text test_param - -label boot_whole_disk -COM32 chain.c32 -append mbr:{{ DISK_IDENTIFIER }} - diff --git a/ironic/tests/unit/drivers/elilo_efi_pxe_config.template b/ironic/tests/unit/drivers/elilo_efi_pxe_config.template index 0dca09d8c1..22fc1a66e6 100644 --- a/ironic/tests/unit/drivers/elilo_efi_pxe_config.template +++ b/ironic/tests/unit/drivers/elilo_efi_pxe_config.template @@ -3,7 +3,7 @@ default=deploy image=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_kernel label=deploy initrd=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_ramdisk - append="selinux=0 disk=cciss/c0d0,sda,hda,vda iscsi_target_iqn=iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_id=1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_key=0123456789ABCDEFGHIJKLMNOPQRSTUV ironic_api_url=http://192.168.122.184:6385 troubleshoot=0 text test_param ip=%I::%G:%M:%H::on root_device=vendor=fake,size=123 ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh boot_option=netboot boot_mode=uefi coreos.configdrive=0" + append="selinux=0 troubleshoot=0 text test_param ip=%I::%G:%M:%H::on ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh coreos.configdrive=0" image=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/kernel diff --git a/ironic/tests/unit/drivers/ipxe_config.template b/ironic/tests/unit/drivers/ipxe_config.template index 13489537ae..b48c557305 100644 --- a/ironic/tests/unit/drivers/ipxe_config.template +++ b/ironic/tests/unit/drivers/ipxe_config.template @@ -6,7 +6,7 @@ goto deploy :deploy imgfree -kernel http://1.2.3.4:1234/deploy_kernel selinux=0 disk=cciss/c0d0,sda,hda,vda iscsi_target_iqn=iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_id=1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_key=0123456789ABCDEFGHIJKLMNOPQRSTUV ironic_api_url=http://192.168.122.184:6385 troubleshoot=0 text test_param boot_option=netboot ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} root_device=vendor=fake,size=123 ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh boot_mode=bios initrd=deploy_ramdisk coreos.configdrive=0 || goto deploy +kernel http://1.2.3.4:1234/deploy_kernel selinux=0 troubleshoot=0 text test_param ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh initrd=deploy_ramdisk coreos.configdrive=0 || goto deploy initrd http://1.2.3.4:1234/deploy_ramdisk || goto deploy boot diff --git a/ironic/tests/unit/drivers/ipxe_config_timeout.template b/ironic/tests/unit/drivers/ipxe_config_timeout.template index 7a64f22842..70e573c5a4 100644 --- a/ironic/tests/unit/drivers/ipxe_config_timeout.template +++ b/ironic/tests/unit/drivers/ipxe_config_timeout.template @@ -6,7 +6,7 @@ goto deploy :deploy imgfree -kernel --timeout 120 http://1.2.3.4:1234/deploy_kernel selinux=0 disk=cciss/c0d0,sda,hda,vda iscsi_target_iqn=iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_id=1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_key=0123456789ABCDEFGHIJKLMNOPQRSTUV ironic_api_url=http://192.168.122.184:6385 troubleshoot=0 text test_param boot_option=netboot ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} root_device=vendor=fake,size=123 ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh boot_mode=bios initrd=deploy_ramdisk coreos.configdrive=0 || goto deploy +kernel --timeout 120 http://1.2.3.4:1234/deploy_kernel selinux=0 troubleshoot=0 text test_param ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh initrd=deploy_ramdisk coreos.configdrive=0 || goto deploy initrd --timeout 120 http://1.2.3.4:1234/deploy_ramdisk || goto deploy boot diff --git a/ironic/tests/unit/drivers/ipxe_uefi_config.template b/ironic/tests/unit/drivers/ipxe_uefi_config.template deleted file mode 100644 index 6061a3c294..0000000000 --- a/ironic/tests/unit/drivers/ipxe_uefi_config.template +++ /dev/null @@ -1,21 +0,0 @@ -#!ipxe - -dhcp - -goto deploy - -:deploy -imgfree -kernel http://1.2.3.4:1234/deploy_kernel selinux=0 disk=cciss/c0d0,sda,hda,vda iscsi_target_iqn=iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_id=1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_key=0123456789ABCDEFGHIJKLMNOPQRSTUV ironic_api_url=http://192.168.122.184:6385 troubleshoot=0 text test_param boot_option=netboot ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} root_device=vendor=fake,size=123 ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh boot_mode=uefi initrd=deploy_ramdisk coreos.configdrive=0 || goto deploy - -initrd http://1.2.3.4:1234/deploy_ramdisk || goto deploy -boot - -:boot_partition -imgfree -kernel http://1.2.3.4:1234/kernel root={{ ROOT }} ro text test_param initrd=ramdisk || goto boot_partition -initrd http://1.2.3.4:1234/ramdisk || goto boot_partition -boot - -:boot_whole_disk -sanboot --no-describe diff --git a/ironic/tests/unit/drivers/modules/test_deploy_utils.py b/ironic/tests/unit/drivers/modules/test_deploy_utils.py index 683d60b465..d1bff3203d 100644 --- a/ironic/tests/unit/drivers/modules/test_deploy_utils.py +++ b/ironic/tests/unit/drivers/modules/test_deploy_utils.py @@ -2044,14 +2044,6 @@ class AgentMethodsTestCase(db_base.DbTestCase): self.assertEqual('fake_agent', options['ipa-driver-name']) self.assertEqual(0, options['coreos.configdrive']) - def test_build_agent_options_root_device_hints(self): - self.config(api_url='api-url', group='conductor') - self.node.properties['root_device'] = {'model': 'fake_model'} - options = utils.build_agent_options(self.node) - self.assertEqual('api-url', options['ipa-api-url']) - self.assertEqual('fake_agent', options['ipa-driver-name']) - self.assertEqual('model=fake_model', options['root_device']) - @mock.patch.object(disk_utils, 'is_block_device', autospec=True) @mock.patch.object(utils, 'login_iscsi', lambda *_: None) diff --git a/ironic/tests/unit/drivers/pxe_config.template b/ironic/tests/unit/drivers/pxe_config.template index 6bbc9afc53..baa9c9f7de 100644 --- a/ironic/tests/unit/drivers/pxe_config.template +++ b/ironic/tests/unit/drivers/pxe_config.template @@ -2,7 +2,7 @@ default deploy label deploy kernel /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_kernel -append initrd=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_ramdisk selinux=0 disk=cciss/c0d0,sda,hda,vda iscsi_target_iqn=iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_id=1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_key=0123456789ABCDEFGHIJKLMNOPQRSTUV ironic_api_url=http://192.168.122.184:6385 troubleshoot=0 text test_param boot_option=netboot root_device=vendor=fake,size=123 ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh boot_mode=bios coreos.configdrive=0 +append initrd=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_ramdisk selinux=0 troubleshoot=0 text test_param ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh coreos.configdrive=0 ipappend 3 diff --git a/ironic/tests/unit/drivers/pxe_grub_config.template b/ironic/tests/unit/drivers/pxe_grub_config.template index 96444c1253..8d30e326c3 100644 --- a/ironic/tests/unit/drivers/pxe_grub_config.template +++ b/ironic/tests/unit/drivers/pxe_grub_config.template @@ -3,7 +3,7 @@ set timeout=5 set hidden_timeout_quiet=false menuentry "deploy" { - linuxefi /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_kernel selinux=0 troubleshoot=0 text disk=cciss/c0d0,sda,hda,vda iscsi_target_iqn=iqn-1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_id=1be26c0b-03f2-4d2e-ae87-c02d7f33c123 deployment_key=0123456789ABCDEFGHIJKLMNOPQRSTUV ironic_api_url=http://192.168.122.184:6385 test_param boot_server=192.0.2.1 root_device=vendor=fake,size=123 ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh boot_option=netboot boot_mode=uefi coreos.configdrive=0 + linuxefi /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_kernel selinux=0 troubleshoot=0 text test_param boot_server=192.0.2.1 ipa-api-url=http://192.168.122.184:6385 ipa-driver-name=pxe_ssh coreos.configdrive=0 initrdefi /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_ramdisk } diff --git a/releasenotes/notes/no-root-device-as-kernel-param-5e5326acae7b77a4.yaml b/releasenotes/notes/no-root-device-as-kernel-param-5e5326acae7b77a4.yaml new file mode 100644 index 0000000000..c902d9fe08 --- /dev/null +++ b/releasenotes/notes/no-root-device-as-kernel-param-5e5326acae7b77a4.yaml @@ -0,0 +1,11 @@ +--- +upgrade: + - Ironic no longer passes ``root_device`` as kernel parameter via boot + config files. + Passing root device hints to Ironic Python Agent (IPA) as kernel + parameters was deprecated in Newton release. + As a consequence, using root device hints with Ironic as of Ocata release + will not be possible when deploying nodes with the help of ramdisks based + on IPA as of Mitaka release. + Operators relying on root device hints functionality are advised + to update their IPA-based Ironic deploy images.