summaryrefslogtreecommitdiff
path: root/ironic/drivers
diff options
context:
space:
mode:
authorShukun Song <song.shukun@jp.fujitsu.com>2022-09-12 16:47:36 +0900
committerShukun Song <song.shukun@jp.fujitsu.com>2022-09-29 20:12:17 +0900
commit233c6408389be5f3e271b46154943bc744e0290e (patch)
treef7e261bc541508d9e1e8466e62fd30e1b29e2ccc /ironic/drivers
parent11fda0885aceef388899805b488ed2e7f9b35b54 (diff)
downloadironic-233c6408389be5f3e271b46154943bc744e0290e.tar.gz
Add support auth protocols for iRMC
This patch adds new SNMPv3 auth protocols to iRMC which are supported from iRMC S6. Change-Id: Id2fca59bebb0745e6b16caaaa7838d1f1a2717e1 Story: 2010309 Task: 46353
Diffstat (limited to 'ironic/drivers')
-rw-r--r--ironic/drivers/modules/irmc/common.py7
-rw-r--r--ironic/drivers/modules/irmc/inspect.py9
-rw-r--r--ironic/drivers/modules/irmc/power.py7
3 files changed, 17 insertions, 6 deletions
diff --git a/ironic/drivers/modules/irmc/common.py b/ironic/drivers/modules/irmc/common.py
index 7a8fc0f1d..2df85eeb6 100644
--- a/ironic/drivers/modules/irmc/common.py
+++ b/ironic/drivers/modules/irmc/common.py
@@ -83,7 +83,9 @@ SNMP_V3_REQUIRED_PROPERTIES = {
SNMP_V3_OPTIONAL_PROPERTIES = {
'irmc_snmp_auth_proto': _("SNMPv3 message authentication protocol ID. "
"Required for version 'v3'. "
- "'sha' is supported."),
+ "If using iRMC S4/S5, only 'sha' is supported."
+ "If using iRMC S6, the valid options are "
+ "'sha256', 'sha384', 'sha512'."),
'irmc_snmp_priv_proto': _("SNMPv3 message privacy (encryption) protocol "
"ID. Required for version 'v3'. "
"'aes' is supported."),
@@ -243,7 +245,8 @@ def _parse_snmp_driver_info(node, info):
def _parse_snmp_v3_info(node, info):
snmp_info = {}
missing_info = []
- valid_values = {'irmc_snmp_auth_proto': ['sha'],
+ valid_values = {'irmc_snmp_auth_proto': ['sha', 'sha256', 'sha384',
+ 'sha512'],
'irmc_snmp_priv_proto': ['aes']}
valid_protocols = {'irmc_snmp_auth_proto': snmp.snmp_auth_protocols,
'irmc_snmp_priv_proto': snmp.snmp_priv_protocols}
diff --git a/ironic/drivers/modules/irmc/inspect.py b/ironic/drivers/modules/irmc/inspect.py
index 9b6bff5bc..4b250cdfd 100644
--- a/ironic/drivers/modules/irmc/inspect.py
+++ b/ironic/drivers/modules/irmc/inspect.py
@@ -191,9 +191,14 @@ def _inspect_hardware(node, existing_traits=None, **kwargs):
except (scci.SCCIInvalidInputError,
scci.SCCIClientError,
exception.SNMPFailure) as e:
+ advice = ""
+ if ("SNMP operation" in str(e)):
+ advice = ("The SNMP related parameters' value may be different "
+ "with the server, please check if you have set them "
+ "correctly.")
error = (_("Inspection failed for node %(node_id)s "
- "with the following error: %(error)s") %
- {'node_id': node.uuid, 'error': e})
+ "with the following error: %(error)s. (advice)s") %
+ {'node_id': node.uuid, 'error': e, 'advice': advice})
raise exception.HardwareInspectionFailure(error=error)
return props, macs, new_traits
diff --git a/ironic/drivers/modules/irmc/power.py b/ironic/drivers/modules/irmc/power.py
index 28041d835..7cde9cdac 100644
--- a/ironic/drivers/modules/irmc/power.py
+++ b/ironic/drivers/modules/irmc/power.py
@@ -203,9 +203,12 @@ def _set_power_state(task, target_state, timeout=None):
_wait_power_state(task, states.SOFT_REBOOT, timeout=timeout)
except exception.SNMPFailure as snmp_exception:
+ advice = ("The SNMP related parameters' value may be different with "
+ "the server, please check if you have set them correctly.")
LOG.error("iRMC failed to acknowledge the target state "
- "for node %(node_id)s. Error: %(error)s",
- {'node_id': node.uuid, 'error': snmp_exception})
+ "for node %(node_id)s. Error: %(error)s. %(advice)s",
+ {'node_id': node.uuid, 'error': snmp_exception,
+ 'advice': advice})
raise exception.IRMCOperationError(operation=target_state,
error=snmp_exception)