Add UEFI based deployment support in Ironic

Most of the new hardware comes with UEFI boot mode, which has several
technical advantages over the traditional BIOS system.

Operator inform the boot mode to ironic using the "capabilities" property
of the node.  The operator may add a new capability "boot_mode=uefi" or
"boot_mode=bios" in "capabilities" within "properties" of the node.

Add new pxe config options:
  - "uefi_pxe_bootfile_name": specify the efi bootloader to be used.
  - "uefi_pxe_config_template": specify the respective efi bootloader config
    template.

As of now only elilo.efi bootloader is supported.

elilo.efi bootloader requires the configuration file to be named after the
ip-address assigned by the DHCP server.

Implements: blueprint uefi-boot-for-ironic
Co-Authored-By: Jim Rollenhagen <jim@jimrollenhagen.com>
Change-Id: I0ad399b2207d7c66f6887e56470ba553b3c87b53
This commit is contained in:
Faizan Barmawer 2014-08-14 16:55:44 -04:00 committed by Jim Rollenhagen
parent 3ba794507b
commit ec5b827908
1 changed files with 10 additions and 4 deletions

View File

@ -160,15 +160,21 @@ def block_uuid(dev):
return out.strip()
def switch_pxe_config(path, root_uuid):
def switch_pxe_config(path, root_uuid, boot_mode):
"""Switch a pxe config from deployment mode to service mode."""
with open(path) as f:
lines = f.readlines()
root = 'UUID=%s' % root_uuid
pxe_cmd = 'goto' if CONF.pxe.ipxe_enabled else 'default'
rre = re.compile(r'\{\{ ROOT \}\}')
dre = re.compile('^%s .*$' % pxe_cmd)
boot_line = '%s boot' % pxe_cmd
if boot_mode == 'uefi':
dre = re.compile('^default=.*$')
boot_line = 'default=boot'
else:
pxe_cmd = 'goto' if CONF.pxe.ipxe_enabled else 'default'
dre = re.compile('^%s .*$' % pxe_cmd)
boot_line = '%s boot' % pxe_cmd
with open(path, 'w') as f:
for line in lines:
line = rre.sub(root, line)