Add uefi capabilities to nodes.json

Add support and details on how to boot baremetal instances
with UEFI firmware.
This commit is contained in:
Derek Higgins 2016-10-14 17:21:31 +01:00
parent 5deb87eb2d
commit fe0d3b9eb9
2 changed files with 11 additions and 0 deletions

View File

@ -105,6 +105,10 @@ Preparing the Host Cloud Environment
.. note:: os_shutdown_timeout=5 is to avoid server shutdown delays since
since these servers won't respond to graceful shutdown requests.
.. note:: On a UEFI enabled openstack cloud, to boot the baremetal instances
with uefi (instead of the default bios firmware) the image should
be created with the parameters --property="hw_firmware_type=uefi".
#. Upload a CentOS 7 image for use as the base image::
wget http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2

View File

@ -140,6 +140,13 @@ def _build_nodes(nova, bmc_ports, bm_ports, provision_net):
# NOTE(bnemec): Older versions of Ironic won't allow _ characters in
# node names, so translate to the allowed character -
node['name'] = baremetal.name.replace('_', '-')
# If a node has uefi firmware ironic needs to be aware of this, in nova
# this is set using a image property called "hw_firmware_type"
image = nova.images.get(baremetal.image['id'])
if image.metadata.get('hw_firmware_type') == 'uefi':
node['capabilities'] = node['capabilities'] + ",boot_mode:uefi"
nodes.append(node)
return nodes, bmc_bm_pairs