From e186fad2e653395ec716a6b4fda31f18aef35e4f Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Mon, 16 Nov 2015 16:31:26 +0000 Subject: [PATCH] Add and document two new root device hints: wwn_{with, vendor}_extension This patch documents two new root device hints recently added to Ironic-Python-Agent: wwn_with_extension and wwn_vendor_extension. Since some SCSI devices use the same WWN those other two WWN can be used to guarantee uniqueness when searching for the root device to deploy the image onto. Depends-On: Ic3e9a1111dfcc99702190c173562a0dccf5f94c4 Related-Bug: #1516641 Change-Id: I1d07441999327a75e5178fc9d365c81b87a60437 --- doc/source/deploy/install-guide.rst | 4 +++- ironic/drivers/modules/deploy_utils.py | 3 ++- ironic/tests/unit/drivers/modules/test_deploy_utils.py | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/source/deploy/install-guide.rst b/doc/source/deploy/install-guide.rst index 3413217011..31a13a2d92 100644 --- a/doc/source/deploy/install-guide.rst +++ b/doc/source/deploy/install-guide.rst @@ -1830,8 +1830,10 @@ The list of support hints is: * model (STRING): device identifier * vendor (STRING): device vendor * serial (STRING): disk serial number -* wwn (STRING): unique storage identifier * size (INT): size of the device in GiB +* wwn (STRING): unique storage identifier +* wwn_with_extension (STRING): unique storage identifier with the vendor extension appended +* wwn_vendor_extension (STRING): unique vendor storage identifier To associate one or more hints with a node, update the node's properties with a ``root_device`` key, for example:: diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py index a4fe421622..4320959799 100644 --- a/ironic/drivers/modules/deploy_utils.py +++ b/ironic/drivers/modules/deploy_utils.py @@ -97,7 +97,8 @@ CONF.register_opts(deploy_opts, group='deploy') 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')) SUPPORTED_CAPABILITIES = { 'boot_option': ('local', 'netboot'), diff --git a/ironic/tests/unit/drivers/modules/test_deploy_utils.py b/ironic/tests/unit/drivers/modules/test_deploy_utils.py index de4105187b..41ffd0dbae 100644 --- a/ironic/tests/unit/drivers/modules/test_deploy_utils.py +++ b/ironic/tests/unit/drivers/modules/test_deploy_utils.py @@ -1156,10 +1156,12 @@ class OtherFunctionTestCase(db_base.DbTestCase): def test_parse_root_device_hints(self): self.node.properties['root_device'] = { 'wwn': 123456, 'model': 'foo-model', 'size': 123, - 'serial': 'foo-serial', 'vendor': 'foo-vendor' + 'serial': 'foo-serial', 'vendor': 'foo-vendor', + 'wwn_with_extension': 123456111, 'wwn_vendor_extension': 111, } expected = ('model=foo-model,serial=foo-serial,size=123,' - 'vendor=foo-vendor,wwn=123456') + 'vendor=foo-vendor,wwn=123456,wwn_vendor_extension=111,' + 'wwn_with_extension=123456111') result = utils.parse_root_device_hints(self.node) self.assertEqual(expected, result)