Extend root device hints to support device name

This patch is extending the root device hints to support the device name
as input.

It's important to note that for SATA, SCSI and IDE disk controllers
the name is not recommended to be used because the order in which the
device nodes are added in Linux is arbitrary, resulting in devices like
/dev/sda and /dev/sdb switching around at boot time. The documentation
was updated to inform operators about this problem.

Depends-On: I48d6456c75bbe6ddf16ac6561e5461ca51eb9c37
Change-Id: I564d68ab1c66505195745c34e16e829b45a00a75
Closes-Bug: #1526732
This commit is contained in:
Lucas Alvares Gomes 2016-01-19 13:45:47 +00:00
parent eeda92c36d
commit 0edba8a86c
4 changed files with 21 additions and 16 deletions

View File

@ -1802,16 +1802,9 @@ The node should be in MANAGEABLE state before inspection is initiated.
Specifying the disk for deployment Specifying the disk for deployment
================================== ==================================
Starting with the Kilo release, Bare Metal service supports passing hints to the Starting with the Kilo release, Bare Metal service supports passing
deploy ramdisk about which disk it should pick for the deployment. In hints to the deploy ramdisk about which disk it should pick for the
Linux when a server has more than one SATA, SCSI or IDE disk controller, deployment. The list of support hints is:
the order in which their corresponding device nodes are added is arbitrary
[`link`_], resulting in devices like ``/dev/sda`` and ``/dev/sdb`` to
switch around between reboots. Therefore, to guarantee that a specific
disk is always chosen for the deployment, Bare Metal service introduced
root device hints.
The list of support hints is:
* model (STRING): device identifier * model (STRING): device identifier
* vendor (STRING): device vendor * vendor (STRING): device vendor
@ -1828,6 +1821,17 @@ The list of support hints is:
* wwn (STRING): unique storage identifier * wwn (STRING): unique storage identifier
* wwn_with_extension (STRING): unique storage identifier with the vendor extension appended * wwn_with_extension (STRING): unique storage identifier with the vendor extension appended
* wwn_vendor_extension (STRING): unique vendor storage identifier * wwn_vendor_extension (STRING): unique vendor storage identifier
* name (STRING): the device name, e.g /dev/md0
.. warning::
The root device hint name should only be used for devices with
constant names (e.g RAID volumes). For SATA, SCSI and IDE disk
controllers this hint is not recommended because the order in which
the device nodes are added in Linux is arbitrary, resulting in
devices like /dev/sda and /dev/sdb `switching around at boot time
<https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/persistent_naming.html>`_.
To associate one or more hints with a node, update the node's properties To associate one or more hints with a node, update the node's properties
with a ``root_device`` key, for example:: with a ``root_device`` key, for example::
@ -1843,9 +1847,6 @@ can not be found.
If multiple hints are specified, a device must satisfy all the hints. If multiple hints are specified, a device must satisfy all the hints.
.. _`link`: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/persistent_naming.html
.. _EnableHTTPSinSwift: .. _EnableHTTPSinSwift:
Enabling HTTPS in Swift Enabling HTTPS in Swift

View File

@ -85,7 +85,8 @@ if CONF.rootwrap_config != '/etc/ironic/rootwrap.conf':
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
VALID_ROOT_DEVICE_HINTS = set(('size', 'model', 'wwn', 'serial', 'vendor', VALID_ROOT_DEVICE_HINTS = set(('size', 'model', 'wwn', 'serial', 'vendor',
'wwn_with_extension', 'wwn_vendor_extension')) 'wwn_with_extension', 'wwn_vendor_extension',
'name'))
SUPPORTED_CAPABILITIES = { SUPPORTED_CAPABILITIES = {
'boot_option': ('local', 'netboot'), 'boot_option': ('local', 'netboot'),

View File

@ -1203,10 +1203,10 @@ class OtherFunctionTestCase(db_base.DbTestCase):
def test_parse_root_device_hints(self): def test_parse_root_device_hints(self):
self.node.properties['root_device'] = { self.node.properties['root_device'] = {
'wwn': 123456, 'model': 'foo-model', 'size': 123, 'wwn': 123456, 'model': 'foo-model', 'size': 123,
'serial': 'foo-serial', 'vendor': 'foo-vendor', 'serial': 'foo-serial', 'vendor': 'foo-vendor', 'name': '/dev/sda',
'wwn_with_extension': 123456111, 'wwn_vendor_extension': 111, 'wwn_with_extension': 123456111, 'wwn_vendor_extension': 111,
} }
expected = ('model=foo-model,serial=foo-serial,size=123,' expected = ('model=foo-model,name=/dev/sda,serial=foo-serial,size=123,'
'vendor=foo-vendor,wwn=123456,wwn_vendor_extension=111,' 'vendor=foo-vendor,wwn=123456,wwn_vendor_extension=111,'
'wwn_with_extension=123456111') 'wwn_with_extension=123456111')
result = utils.parse_root_device_hints(self.node) result = utils.parse_root_device_hints(self.node)

View File

@ -0,0 +1,3 @@
---
features:
- Root device hints extended to support the device name.