From b523d1b1c936cd6f7bacbd5ee6a78c5944cc6296 Mon Sep 17 00:00:00 2001 From: Pierre-yves Fontaniere Date: Mon, 7 Oct 2024 23:00:01 +0200 Subject: [PATCH] Remove 'CapacityBytes' from list of required parameters (#8956) * Remove 'CapacityBytes' from list of required parameters * Add CHANGELOG fragment * Fix sanity test failure whitespace before ']' * Update changelogs/fragments/8956-remove-capacitybytes-from-the-required-parameters_list.yml Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * Add description for the volume_details key CapacityBytes * Update plugins/modules/redfish_config.py Co-authored-by: Mike Raineri * Adjust description. --------- Co-authored-by: Pierre-yves FONTANIERE Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> Co-authored-by: Mike Raineri Co-authored-by: Felix Fontein --- ...remove-capacitybytes-from-the-required-parameters_list.yml | 2 ++ plugins/module_utils/redfish_utils.py | 4 ++-- plugins/modules/redfish_config.py | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/8956-remove-capacitybytes-from-the-required-parameters_list.yml diff --git a/changelogs/fragments/8956-remove-capacitybytes-from-the-required-parameters_list.yml b/changelogs/fragments/8956-remove-capacitybytes-from-the-required-parameters_list.yml new file mode 100644 index 0000000000..d6879ccb06 --- /dev/null +++ b/changelogs/fragments/8956-remove-capacitybytes-from-the-required-parameters_list.yml @@ -0,0 +1,2 @@ +minor_changes: + - redfish_confg - remove ``CapacityBytes`` from required paramaters of the ``CreateVolume`` command (https://github.com/ansible-collections/community.general/pull/8956). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index 102d826e6d..30309ac0a9 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -3777,8 +3777,8 @@ class RedfishUtils(object): 'msg': "Provided Storage Subsystem ID %s does not exist on the server" % storage_subsystem_id} # Validate input parameters - required_parameters = ['RAIDType', 'Drives', 'CapacityBytes'] - allowed_parameters = ['DisplayName', 'InitializeMethod', 'MediaSpanCount', + required_parameters = ['RAIDType', 'Drives'] + allowed_parameters = ['CapacityBytes', 'DisplayName', 'InitializeMethod', 'MediaSpanCount', 'Name', 'ReadCachePolicy', 'StripSizeBytes', 'VolumeUsage', 'WriteCachePolicy'] for parameter in required_parameters: diff --git a/plugins/modules/redfish_config.py b/plugins/modules/redfish_config.py index 25f3cffdb4..03146558f3 100644 --- a/plugins/modules/redfish_config.py +++ b/plugins/modules/redfish_config.py @@ -164,6 +164,9 @@ options: required: false description: - Setting dict of volume to be created. + - If C(CapacityBytes) key is not specified in this dictionary, the size of + the volume will be determined by the Redfish service. It is possible the + size will not be the maximum available size. type: dict default: {} version_added: '7.5.0'