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
This commit is contained in:
parent
6587a48dd0
commit
fb70e05ae9
@ -440,7 +440,7 @@ class BootInterface(object):
|
|||||||
different ways by passing parameters to them. For example,
|
different ways by passing parameters to them. For example,
|
||||||
|
|
||||||
When Agent ramdisk is booted to deploy a node, it takes the
|
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
|
Other implementations can make use of ramdisk_params to pass such
|
||||||
information. Different implementations of boot interface will
|
information. Different implementations of boot interface will
|
||||||
|
@ -2,7 +2,7 @@ default deploy
|
|||||||
|
|
||||||
label deploy
|
label deploy
|
||||||
kernel {{ pxe_options.deployment_aki_path }}
|
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
|
label boot_partition
|
||||||
kernel {{ pxe_options.aki_path }}
|
kernel {{ pxe_options.aki_path }}
|
||||||
|
@ -1049,12 +1049,6 @@ def build_agent_options(node):
|
|||||||
# NOTE: The below entry is a temporary workaround for bug/1433812
|
# NOTE: The below entry is a temporary workaround for bug/1433812
|
||||||
'coreos.configdrive': 0,
|
'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
|
return agent_config_opts
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ default=deploy
|
|||||||
image={{pxe_options.deployment_aki_path}}
|
image={{pxe_options.deployment_aki_path}}
|
||||||
label=deploy
|
label=deploy
|
||||||
initrd={{pxe_options.deployment_ari_path}}
|
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}}
|
image={{pxe_options.aki_path}}
|
||||||
|
@ -6,7 +6,7 @@ goto deploy
|
|||||||
|
|
||||||
:deploy
|
:deploy
|
||||||
imgfree
|
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
|
initrd {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.deployment_ari_path }} || goto deploy
|
||||||
boot
|
boot
|
||||||
|
@ -2,7 +2,7 @@ default deploy
|
|||||||
|
|
||||||
label deploy
|
label deploy
|
||||||
kernel {{ pxe_options.deployment_aki_path }}
|
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
|
ipappend 3
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ set timeout=5
|
|||||||
set hidden_timeout_quiet=false
|
set hidden_timeout_quiet=false
|
||||||
|
|
||||||
menuentry "deploy" {
|
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 }}
|
initrdefi {{ pxe_options.deployment_ari_path }}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,38 +46,15 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
'pxe_append_params': 'test_param',
|
'pxe_append_params': 'test_param',
|
||||||
'deployment_ari_path': u'/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7'
|
'deployment_ari_path': u'/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7'
|
||||||
u'f33c123/deploy_ramdisk',
|
u'f33c123/deploy_ramdisk',
|
||||||
'root_device': 'vendor=fake,size=123',
|
|
||||||
'ipa-api-url': 'http://192.168.122.184:6385',
|
'ipa-api-url': 'http://192.168.122.184:6385',
|
||||||
'ipxe_timeout': 0,
|
'ipxe_timeout': 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
self.pxe_options = {
|
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',
|
'ipa-driver-name': 'pxe_ssh',
|
||||||
}
|
}
|
||||||
self.pxe_options.update(common_pxe_options)
|
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 = self.pxe_options.copy()
|
||||||
self.ipxe_options.update({
|
self.ipxe_options.update({
|
||||||
'deployment_aki_path': 'http://1.2.3.4:1234/deploy_kernel',
|
'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',
|
'ari_path': 'http://1.2.3.4:1234/ramdisk',
|
||||||
})
|
})
|
||||||
|
|
||||||
self.ipxe_options_bios = {
|
self.ipxe_options_timeout = self.ipxe_options.copy()
|
||||||
'boot_mode': 'bios',
|
|
||||||
}
|
|
||||||
self.ipxe_options_bios.update(self.ipxe_options)
|
|
||||||
|
|
||||||
self.ipxe_options_timeout = self.ipxe_options_bios.copy()
|
|
||||||
self.ipxe_options_timeout.update({
|
self.ipxe_options_timeout.update({
|
||||||
'ipxe_timeout': 120
|
'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)
|
self.node = object_utils.create_test_node(self.context)
|
||||||
|
|
||||||
def test__build_pxe_config(self):
|
def test__build_pxe_config(self):
|
||||||
|
|
||||||
rendered_template = pxe_utils._build_pxe_config(
|
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 }}')
|
'{{ ROOT }}', '{{ DISK_IDENTIFIER }}')
|
||||||
|
|
||||||
expected_template = open(
|
expected_template = open(
|
||||||
@ -114,7 +81,7 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
|
|
||||||
self.assertEqual(six.text_type(expected_template), rendered_template)
|
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,
|
# NOTE(lucasagomes): iPXE is just an extension of the PXE driver,
|
||||||
# it doesn't have it's own configuration option for template.
|
# it doesn't have it's own configuration option for template.
|
||||||
# More info:
|
# More info:
|
||||||
@ -125,7 +92,7 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
)
|
)
|
||||||
self.config(http_url='http://1.2.3.4:1234', group='deploy')
|
self.config(http_url='http://1.2.3.4:1234', group='deploy')
|
||||||
rendered_template = pxe_utils._build_pxe_config(
|
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 }}')
|
'{{ ROOT }}', '{{ DISK_IDENTIFIER }}')
|
||||||
|
|
||||||
expected_template = open(
|
expected_template = open(
|
||||||
@ -152,26 +119,6 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
|
|
||||||
self.assertEqual(six.text_type(expected_template), rendered_template)
|
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):
|
def test__build_elilo_config(self):
|
||||||
pxe_opts = self.pxe_options
|
pxe_opts = self.pxe_options
|
||||||
pxe_opts['boot_mode'] = 'uefi'
|
pxe_opts['boot_mode'] = 'uefi'
|
||||||
@ -316,11 +263,11 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
@mock.patch('oslo_utils.fileutils.ensure_tree', autospec=True)
|
@mock.patch('oslo_utils.fileutils.ensure_tree', autospec=True)
|
||||||
def test_create_pxe_config(self, ensure_tree_mock, build_mock,
|
def test_create_pxe_config(self, ensure_tree_mock, build_mock,
|
||||||
write_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:
|
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)
|
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,
|
CONF.pxe.pxe_config_template,
|
||||||
'{{ ROOT }}',
|
'{{ ROOT }}',
|
||||||
'{{ DISK_IDENTIFIER }}')
|
'{{ DISK_IDENTIFIER }}')
|
||||||
@ -331,7 +278,7 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
ensure_tree_mock.assert_has_calls(ensure_calls)
|
ensure_tree_mock.assert_has_calls(ensure_calls)
|
||||||
|
|
||||||
pxe_cfg_file_path = pxe_utils.get_pxe_config_file_path(self.node.uuid)
|
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',
|
@mock.patch('ironic.common.pxe_utils._link_ip_address_pxe_configs',
|
||||||
autospec=True)
|
autospec=True)
|
||||||
@ -345,10 +292,10 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
'elilo_efi_pxe_config.template'),
|
'elilo_efi_pxe_config.template'),
|
||||||
group='pxe'
|
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:
|
with task_manager.acquire(self.context, self.node.uuid) as task:
|
||||||
task.node.properties['capabilities'] = 'boot_mode:uefi'
|
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)
|
CONF.pxe.uefi_pxe_config_template)
|
||||||
|
|
||||||
ensure_calls = [
|
ensure_calls = [
|
||||||
@ -356,14 +303,14 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
mock.call(os.path.join(CONF.pxe.tftp_root, 'pxelinux.cfg'))
|
mock.call(os.path.join(CONF.pxe.tftp_root, 'pxelinux.cfg'))
|
||||||
]
|
]
|
||||||
ensure_tree_mock.assert_has_calls(ensure_calls)
|
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,
|
CONF.pxe.uefi_pxe_config_template,
|
||||||
'{{ ROOT }}',
|
'{{ ROOT }}',
|
||||||
'{{ DISK_IDENTIFIER }}')
|
'{{ DISK_IDENTIFIER }}')
|
||||||
link_ip_configs_mock.assert_called_once_with(task, True)
|
link_ip_configs_mock.assert_called_once_with(task, True)
|
||||||
|
|
||||||
pxe_cfg_file_path = pxe_utils.get_pxe_config_file_path(self.node.uuid)
|
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',
|
@mock.patch('ironic.common.pxe_utils._link_ip_address_pxe_configs',
|
||||||
autospec=True)
|
autospec=True)
|
||||||
@ -372,11 +319,11 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
@mock.patch('oslo_utils.fileutils.ensure_tree', autospec=True)
|
@mock.patch('oslo_utils.fileutils.ensure_tree', autospec=True)
|
||||||
def test_create_pxe_config_uefi_grub(self, ensure_tree_mock, build_mock,
|
def test_create_pxe_config_uefi_grub(self, ensure_tree_mock, build_mock,
|
||||||
write_mock, link_ip_configs_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"
|
grub_tmplte = "ironic/drivers/modules/pxe_grub_config.template"
|
||||||
with task_manager.acquire(self.context, self.node.uuid) as task:
|
with task_manager.acquire(self.context, self.node.uuid) as task:
|
||||||
task.node.properties['capabilities'] = 'boot_mode:uefi'
|
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)
|
grub_tmplte)
|
||||||
|
|
||||||
ensure_calls = [
|
ensure_calls = [
|
||||||
@ -384,14 +331,14 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
mock.call(os.path.join(CONF.pxe.tftp_root, 'pxelinux.cfg'))
|
mock.call(os.path.join(CONF.pxe.tftp_root, 'pxelinux.cfg'))
|
||||||
]
|
]
|
||||||
ensure_tree_mock.assert_has_calls(ensure_calls)
|
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,
|
grub_tmplte,
|
||||||
'(( ROOT ))',
|
'(( ROOT ))',
|
||||||
'(( DISK_IDENTIFIER ))')
|
'(( DISK_IDENTIFIER ))')
|
||||||
link_ip_configs_mock.assert_called_once_with(task, False)
|
link_ip_configs_mock.assert_called_once_with(task, False)
|
||||||
|
|
||||||
pxe_cfg_file_path = pxe_utils.get_pxe_config_file_path(self.node.uuid)
|
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',
|
@mock.patch('ironic.common.pxe_utils._link_mac_pxe_configs',
|
||||||
autospec=True)
|
autospec=True)
|
||||||
@ -401,11 +348,11 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
def test_create_pxe_config_uefi_ipxe(self, ensure_tree_mock, build_mock,
|
def test_create_pxe_config_uefi_ipxe(self, ensure_tree_mock, build_mock,
|
||||||
write_mock, link_mac_pxe_mock):
|
write_mock, link_mac_pxe_mock):
|
||||||
self.config(ipxe_enabled=True, group='pxe')
|
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"
|
ipxe_template = "ironic/drivers/modules/ipxe_config.template"
|
||||||
with task_manager.acquire(self.context, self.node.uuid) as task:
|
with task_manager.acquire(self.context, self.node.uuid) as task:
|
||||||
task.node.properties['capabilities'] = 'boot_mode:uefi'
|
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)
|
ipxe_template)
|
||||||
|
|
||||||
ensure_calls = [
|
ensure_calls = [
|
||||||
@ -413,7 +360,7 @@ class TestPXEUtils(db_base.DbTestCase):
|
|||||||
mock.call(os.path.join(CONF.deploy.http_root, 'pxelinux.cfg'))
|
mock.call(os.path.join(CONF.deploy.http_root, 'pxelinux.cfg'))
|
||||||
]
|
]
|
||||||
ensure_tree_mock.assert_has_calls(ensure_calls)
|
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,
|
ipxe_template,
|
||||||
'{{ ROOT }}',
|
'{{ ROOT }}',
|
||||||
'{{ DISK_IDENTIFIER }}')
|
'{{ 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)
|
pxe_cfg_file_path = pxe_utils.get_pxe_config_file_path(self.node.uuid)
|
||||||
write_mock.assert_called_with(pxe_cfg_file_path,
|
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.common.utils.rmtree_without_raise', autospec=True)
|
||||||
@mock.patch('ironic_lib.utils.unlink_without_raise', autospec=True)
|
@mock.patch('ironic_lib.utils.unlink_without_raise', autospec=True)
|
||||||
|
@ -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 }}
|
|
||||||
|
|
@ -3,7 +3,7 @@ default=deploy
|
|||||||
image=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_kernel
|
image=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_kernel
|
||||||
label=deploy
|
label=deploy
|
||||||
initrd=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_ramdisk
|
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
|
image=/tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/kernel
|
||||||
|
@ -6,7 +6,7 @@ goto deploy
|
|||||||
|
|
||||||
:deploy
|
:deploy
|
||||||
imgfree
|
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
|
initrd http://1.2.3.4:1234/deploy_ramdisk || goto deploy
|
||||||
boot
|
boot
|
||||||
|
@ -6,7 +6,7 @@ goto deploy
|
|||||||
|
|
||||||
:deploy
|
:deploy
|
||||||
imgfree
|
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
|
initrd --timeout 120 http://1.2.3.4:1234/deploy_ramdisk || goto deploy
|
||||||
boot
|
boot
|
||||||
|
@ -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
|
|
@ -2044,14 +2044,6 @@ class AgentMethodsTestCase(db_base.DbTestCase):
|
|||||||
self.assertEqual('fake_agent', options['ipa-driver-name'])
|
self.assertEqual('fake_agent', options['ipa-driver-name'])
|
||||||
self.assertEqual(0, options['coreos.configdrive'])
|
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(disk_utils, 'is_block_device', autospec=True)
|
||||||
@mock.patch.object(utils, 'login_iscsi', lambda *_: None)
|
@mock.patch.object(utils, 'login_iscsi', lambda *_: None)
|
||||||
|
@ -2,7 +2,7 @@ default deploy
|
|||||||
|
|
||||||
label deploy
|
label deploy
|
||||||
kernel /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_kernel
|
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
|
ipappend 3
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ set timeout=5
|
|||||||
set hidden_timeout_quiet=false
|
set hidden_timeout_quiet=false
|
||||||
|
|
||||||
menuentry "deploy" {
|
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
|
initrdefi /tftpboot/1be26c0b-03f2-4d2e-ae87-c02d7f33c123/deploy_ramdisk
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
Loading…
Reference in New Issue
Block a user