ironic/ironic
Richard Pioso a00a0bf357 Fix iDRAC hardware type does not work with UEFI
This fixes an issue that caused the integrated Dell Remote Access
Controller (iDRAC) management hardware interface implementation,
'idrac', to fail to boot nodes in Unified Extensible Firmware Interface
(UEFI) boot mode. That interface is supported by the 'idrac' hardware
type. The following errors appear in the ironic conductor log:

ERROR ironic.drivers.modules.agent_base_vendor   File
"/opt/stack/new/ironic/ironic/drivers/modules/drac/management.py", line
106, in set_boot_device
ERROR ironic.drivers.modules.agent_base_vendor     in
drac_boot_devices[PERSISTENT_BOOT_MODE]
ERROR ironic.drivers.modules.agent_base_vendor KeyError: 'IPL'
ERROR ironic.drivers.modules.agent_base_vendor
ERROR ironic.conductor.utils [None
req-80b5a61c-4ae1-41ea-875f-5a722142be01 None None] Error rebooting node
cddff129-7353-4de1-b436-810b1ae0dd92 after deploy. KeyError: 'IPL'
DEBUG ironic.common.states [None
req-80b5a61c-4ae1-41ea-875f-5a722142be01 None None] Exiting old state
'deploying' in response to event 'fail' {{(pid=23850) on_exit
/opt/stack/new/ironic/ironic/common/states.py:263}}
DEBUG ironic.common.states [None
req-80b5a61c-4ae1-41ea-875f-5a722142be01 None None] Entering new state
'deploy failed' in response to event 'fail' {{(pid=23850) on_enter
/opt/stack/new/ironic/ironic/common/states.py:269}}

The issue is resolved for Dell EMC PowerEdge 13th and 14th generation
servers. It is not resolved for PowerEdge 12th generation and earlier
servers.

Prior to this change, the set_boot_device() function in
ironic.drivers.modules.drac.management could successfully set a boot
device that would persist during future boots only when the server's
boot mode was configured to be BIOS. The root cause was that function
understood only a single persistent boot mode, BIOS, and it was hard
coded.

PERSISTENT_BOOT_MODE = 'IPL'

Initial Program Load (IPL) is a synonym for legacy BIOS boot mode.

The iDRAC does not report nor make visible the boot source lists for
persistent boot modes that are not configured as the server's current
boot mode. Only the list associated with the configured boot mode is
reported and can be modified. So, when the boot mode is configured to be
UEFI, the iDRAC permits only its boot source list to be modified.
However, set_boot_device() had been capable of only modifying the boot
source list for BIOS (IPL), which was not reported. Its attempt to
access the wrong, unreported boot source list failed.

This change fixes the issue by determining the configured persistent
boot mode at run-time and modifying its boot source list. The hard
coding of a persistent boot mode has been eliminated. Now, nodes managed
by the iDRAC hardware type successfully boot in either persistent boot
mode, BIOS or UEFI. More information about using the iDRAC for boot
management is available in the "Dell EMC BIOS and Boot Management
Profile", Version 4.0.0, section 7.2 Boot Management, pp. 44-47 [1].

The way the iDRAC hardware type deploys the operating system, by copying
it to a disk, posed an additional challenge to this fix. UEFI discovers
new boot sources during the next boot. How could the server be
configured to directly boot into the newly deployed operating system
when its boot source is unknown? It was overcome by using new iDRAC BIOS
attributes named 'SetBootOrderFqddNN' [2]. Those make it possible to
specify the boot source for the next boot without requiring it to be
present in the current boot's boot source list. The server is configured
to directly boot from the disk on which the operating system was just
deployed. An additional reboot is not required. Note that those new
attributes are presently available on only 13th and 14th generation
servers. Also, this approach is only possible for configuring a
persistent boot source.

[1] http://en.community.dell.com/techcenter/extras/m/white_papers/20444495
[2] "Configuring server boot options on 14th generation Dell EMC
PowerEdge servers", section 3.5.2 SetBootOrderFqddNN, pp. 13-14
(http://en.community.dell.com/techcenter/extras/m/white_papers/20487489)

Conflicts:
	ironic/tests/unit/drivers/modules/drac/test_management.py

Story: 1656841
Task: 9711
Change-Id: Idad1db1807420eab62c44318afafe10ea8c52ee5
(cherry picked from commit eb14f5750f)
2018-08-04 19:53:30 -04:00
..
api Fix missed '_' import 2017-02-10 11:14:21 +02:00
cmd Separate WSGIService from RPCService 2016-09-15 11:14:20 -04:00
common Fix error when deleting a non-existent port 2018-06-26 08:36:55 +00:00
conductor Tear down console during unprovisioning 2018-05-18 12:14:54 +00:00
conf Remove most unsupported drivers 2017-02-09 08:09:03 +00:00
db Allow sqalchemy filtering by id and uuid 2018-02-19 15:32:53 +00:00
dhcp Fix mis-formatted log messages 2017-10-10 10:04:06 -07:00
drivers Fix iDRAC hardware type does not work with UEFI 2018-08-04 19:53:30 -04:00
locale Imported Translations from Zanata 2016-10-25 06:34:48 +00:00
objects Do not pass credentials to the ramdisk on cleaning 2018-02-07 13:48:10 +01:00
releasenotes/notes Remove 'fork' option from socat command 2016-12-29 19:13:31 +00:00
tests Fix iDRAC hardware type does not work with UEFI 2018-08-04 19:53:30 -04:00
__init__.py Move eventlent monkeypatch out of cmd/ 2014-02-08 00:11:56 -08:00
version.py Correct version.py and update current version string 2014-03-21 13:50:05 -07:00