Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disk description now contains a StorageId and a RedfishURI #8937

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- redfish_info - adds ``RedfishURI`` and ``StorageId`` to Disk inventory (https://github.com/ansible-collections/community.general/pull/8937).
3 changes: 3 additions & 0 deletions plugins/module_utils/redfish_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ def get_disk_inventory(self, systems_uri):
return response
data = response['data']
controller_name = 'Controller 1'
storage_id = data['Id']
if 'Controllers' in data:
controllers_uri = data['Controllers'][u'@odata.id']

Expand Down Expand Up @@ -900,6 +901,7 @@ def get_disk_inventory(self, systems_uri):
data = response['data']

drive_result = {}
drive_result['RedfishURI'] = data['@odata.id']
for property in properties:
if property in data:
if data[property] is not None:
Expand All @@ -911,6 +913,7 @@ def get_disk_inventory(self, systems_uri):
drive_result[property] = data[property]
drive_results.append(drive_result)
drives = {'Controller': controller_name,
'StorageId': storage_id,
Copy link
Contributor

@mraineri mraineri Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth adding "RedfishURI" for the Storage resource in addition to "StorageId" since there can be different storage subsystems across multiple systems with the same "Id" property. For example, these URIs are all unique Storage resources, but they all have "1" for the Id property...

/redfish/v1/Systems/RackMount1/Storage/1
/redfish/v1/Systems/RackMount2/Storage/1
/redfish/v1/Systems/RackMount3/Storage/1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mraineri , Thank you for your review, I understand, but i have a question:
My will here is to have a storage_subsystem_id to give to the CreateVolume command of community.general.redfish_config.
In your case what storage_subsystem_id would you provide to the command ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, specifically with CreateVolume, "resource_id" is already used to point to a specific system if needed. So, at least for your usage, it's not needed today; the combination of "resource_id" and "storage_subsystem_id" will guarantee uniqueness.

Okay, so this isn't necessary at this time based on the current interfaces.

'Drives': drive_results}
result["entries"].append(drives)

Expand Down