Grub2 by default for PXE + UEFI

This patch is changing the default bootloader for PXE + UEFI to Grub2.
Prior to this patch Elilo was the default but, Elilo is no longer
maintained with the last release dating 2014.

Ironic should have sane defaults therefore we should not rely on an
unmaintained project.

Change-Id: Ib34fcbd37e4698bf272582c96b1540b511b5a892
This commit is contained in:
Lucas Alvares Gomes 2016-09-08 12:39:31 +01:00
parent 53f8b173ae
commit 5110a65581
5 changed files with 55 additions and 30 deletions

View File

@ -968,17 +968,7 @@ PXE UEFI setup
If you want to deploy on a UEFI supported bare metal, perform these additional If you want to deploy on a UEFI supported bare metal, perform these additional
steps on the ironic conductor node to configure the PXE UEFI environment. steps on the ironic conductor node to configure the PXE UEFI environment.
#. Download and untar the elilo bootloader version >= 3.16 from #. Install Grub2 and shim packages::
http://sourceforge.net/projects/elilo/::
sudo tar zxvf elilo-3.16-all.tar.gz
#. Copy the elilo boot loader image to ``/tftpboot`` directory::
sudo cp ./elilo-3.16-x86_64.efi /tftpboot/elilo.efi
#. Grub2 is an alternate UEFI bootloader supported in Bare Metal service.
Install grub2 and shim packages::
Ubuntu: (14.04LTS and later) Ubuntu: (14.04LTS and later)
sudo apt-get install grub-efi-amd64-signed shim-signed sudo apt-get install grub-efi-amd64-signed shim-signed
@ -1028,18 +1018,6 @@ steps on the ironic conductor node to configure the PXE UEFI environment.
sudo chmod 644 $GRUB_DIR/grub.cfg sudo chmod 644 $GRUB_DIR/grub.cfg
#. Update bootfile and template file configuration parameters for UEFI PXE boot
in the Bare Metal Service's configuration file (/etc/ironic/ironic.conf)::
[pxe]
# Bootfile DHCP parameter for UEFI boot mode. (string value)
uefi_pxe_bootfile_name=bootx64.efi
# Template file for PXE configuration for UEFI boot loader.
# (string value)
uefi_pxe_config_template=$pybasedir/drivers/modules/pxe_grub_config.template
#. Update the bare metal node with ``boot_mode`` capability in node's properties #. Update the bare metal node with ``boot_mode`` capability in node's properties
field:: field::
@ -1052,7 +1030,37 @@ steps on the ironic conductor node to configure the PXE UEFI environment.
boot device on the bare metal node. So this step is not required for boot device on the bare metal node. So this step is not required for
``pxe_ilo`` driver. ``pxe_ilo`` driver.
For more information on configuring boot modes, refer boot_mode_support_. .. note::
For more information on configuring boot modes, see boot_mode_support_.
Elilo: an alternative to Grub2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Elilo is a UEFI bootloader. It is an alternative to Grub2, although it
isn't recommended since it is not being supported.
#. Download and untar the elilo bootloader version >= 3.16 from
http://sourceforge.net/projects/elilo/::
sudo tar zxvf elilo-3.16-all.tar.gz
#. Copy the elilo boot loader image to ``/tftpboot`` directory::
sudo cp ./elilo-3.16-x86_64.efi /tftpboot/elilo.efi
#. Update bootfile and template file configuration parameters for UEFI
PXE boot in the Bare Metal Service's configuration file
(/etc/ironic/ironic.conf)::
[pxe]
# Bootfile DHCP parameter for UEFI boot mode. (string value)
uefi_pxe_bootfile_name=elilo.efi
# Template file for PXE configuration for UEFI boot loader.
# (string value)
uefi_pxe_config_template=$pybasedir/drivers/modules/elilo_efi_pxe_config.template
iPXE setup iPXE setup

View File

@ -2721,7 +2721,7 @@
# On ironic-conductor node, template file for PXE # On ironic-conductor node, template file for PXE
# configuration for UEFI boot loader. (string value) # configuration for UEFI boot loader. (string value)
#uefi_pxe_config_template = $pybasedir/drivers/modules/elilo_efi_pxe_config.template #uefi_pxe_config_template = $pybasedir/drivers/modules/pxe_grub_config.template
# IP address of ironic-conductor node's TFTP server. (string # IP address of ironic-conductor node's TFTP server. (string
# value) # value)
@ -2740,7 +2740,7 @@
#pxe_bootfile_name = pxelinux.0 #pxe_bootfile_name = pxelinux.0
# Bootfile DHCP parameter for UEFI boot mode. (string value) # Bootfile DHCP parameter for UEFI boot mode. (string value)
#uefi_pxe_bootfile_name = elilo.efi #uefi_pxe_bootfile_name = bootx64.efi
# Enable iPXE boot. (boolean value) # Enable iPXE boot. (boolean value)
#ipxe_enabled = false #ipxe_enabled = false

View File

@ -55,7 +55,7 @@ opts = [
cfg.StrOpt('uefi_pxe_config_template', cfg.StrOpt('uefi_pxe_config_template',
default=os.path.join( default=os.path.join(
'$pybasedir', '$pybasedir',
'drivers/modules/elilo_efi_pxe_config.template'), 'drivers/modules/pxe_grub_config.template'),
help=_('On ironic-conductor node, template file for PXE ' help=_('On ironic-conductor node, template file for PXE '
'configuration for UEFI boot loader.')), 'configuration for UEFI boot loader.')),
cfg.StrOpt('tftp_server', cfg.StrOpt('tftp_server',
@ -77,7 +77,7 @@ opts = [
default='pxelinux.0', default='pxelinux.0',
help=_('Bootfile DHCP parameter.')), help=_('Bootfile DHCP parameter.')),
cfg.StrOpt('uefi_pxe_bootfile_name', cfg.StrOpt('uefi_pxe_bootfile_name',
default='elilo.efi', default='bootx64.efi',
help=_('Bootfile DHCP parameter for UEFI boot mode.')), help=_('Bootfile DHCP parameter for UEFI boot mode.')),
cfg.BoolOpt('ipxe_enabled', cfg.BoolOpt('ipxe_enabled',
default=False, default=False,

View File

@ -175,6 +175,11 @@ class TestPXEUtils(db_base.DbTestCase):
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'
self.config(
uefi_pxe_config_template=('ironic/drivers/modules/'
'elilo_efi_pxe_config.template'),
group='pxe'
)
rendered_template = pxe_utils._build_pxe_config( rendered_template = pxe_utils._build_pxe_config(
pxe_opts, CONF.pxe.uefi_pxe_config_template, pxe_opts, CONF.pxe.uefi_pxe_config_template,
'{{ ROOT }}', '{{ DISK_IDENTIFIER }}') '{{ ROOT }}', '{{ DISK_IDENTIFIER }}')
@ -189,9 +194,9 @@ class TestPXEUtils(db_base.DbTestCase):
pxe_opts = self.pxe_options pxe_opts = self.pxe_options
pxe_opts['boot_mode'] = 'uefi' pxe_opts['boot_mode'] = 'uefi'
pxe_opts['tftp_server'] = '192.0.2.1' pxe_opts['tftp_server'] = '192.0.2.1'
grub_tmplte = "ironic/drivers/modules/pxe_grub_config.template"
rendered_template = pxe_utils._build_pxe_config( rendered_template = pxe_utils._build_pxe_config(
pxe_opts, grub_tmplte, '(( ROOT ))', '(( DISK_IDENTIFIER ))') pxe_opts, CONF.pxe.uefi_pxe_config_template,
'(( ROOT ))', '(( DISK_IDENTIFIER ))')
template_file = 'ironic/tests/unit/drivers/pxe_grub_config.template' template_file = 'ironic/tests/unit/drivers/pxe_grub_config.template'
expected_template = open(template_file).read().rstrip() expected_template = open(template_file).read().rstrip()
@ -335,6 +340,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_elilo(self, ensure_tree_mock, build_mock, def test_create_pxe_config_uefi_elilo(self, ensure_tree_mock, build_mock,
write_mock, link_ip_configs_mock): write_mock, link_ip_configs_mock):
self.config(
uefi_pxe_config_template=('ironic/drivers/modules/'
'elilo_efi_pxe_config.template'),
group='pxe'
)
build_mock.return_value = self.pxe_options_uefi build_mock.return_value = self.pxe_options_uefi
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'

View File

@ -0,0 +1,7 @@
---
upgrade:
- The default bootloader for PXE + UEFI has changed from ELILO to Grub2
because ELILO is not being actively developed anymore. Operators relying
on ELILO should explicitly set the ``[pxe]/uefi_pxe_bootfile_name``
and ``[pxe]/uefi_pxe_config_template`` configuration options to the
ELILO ROM and configuration template.