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

Follow DMTF redfish deprecation on StorageControllers #7081

Merged
merged 4 commits into from
Aug 11, 2023
Merged

Follow DMTF redfish deprecation on StorageControllers #7081

merged 4 commits into from
Aug 11, 2023

Conversation

pyfontan
Copy link
Contributor

@pyfontan pyfontan commented Aug 9, 2023

Get controller information from "Controllers" field instead of "StorageControllers" which is deprecated

cf. page 9 of https://www.dmtf.org/sites/default/files/Redfish_Release_2022.1_Overview.pdf

SUMMARY

get_storage_controller_inventory now use Controllers field as main key to obtain storage controllers properties. And if Controllers is not available , get_storage_controller_inventory will use the deprecated key StorageControllers

Fixes #7080

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

redfish_utils

ADDITIONAL INFORMATION

On the same HPe server, i had empty array:

TASK [ansible.builtin.debug] ***********************************************************************************************************************************
ok: [localhost] => {                                                            
    "controllers_inventory": {                                                  
        "ansible_facts": {           
            "discovered_interpreter_python": "/usr/bin/python3"
        },                                                                      
        "changed": false,                                                       
        "failed": false,                                                        
        "redfish_facts": {                                                      
            "storage_controller": {                                             
                "entries": [                                                    
                    [                                                           
                        {                                                       
                            "system_uri": "/redfish/v1/Systems/1/"
                        },       
                        [     
                            {
                                "CacheSummary": {
                                    "PersistentCacheSizeMiB": 3856,
                                    "Status": {
                                        "Health": "OK",
                                        "State": "Disabled"
                                    },
                                    "TotalCacheSizeMiB": 4096
                                },
                                "FirmwareVersion": "5.32",                                                                                                      
                                "Id": "0",                                                                                                                      
                                "Identifiers": [
                                    {                                           
                                        "DurableName": "51402EC019A26FC0",
                                        "DurableNameFormat": "NAA"
                                    }
                                ],
                                "Location": {
                                    "PartLocation": {
                                        "LocationOrdinalValue": 0,
                                        "LocationType": "Slot",
                                        "ServiceLabel": "Slot=0"
                                    }
                                },
                                "Manufacturer": "HPE",
                                "Model": "HPE Smart Array P816i-a SR Gen10",
                                "Name": "HPE Smart Array P816i-a SR Gen10",
                                "PartNumber": "869085-004",
                                "SerialNumber": "PZXNU0BRHH501M ",
                                "SpeedGbps": 12.0,
                                "Status": {
                                    "Health": "OK",
                                    "State": "Enabled"
                                }
                            },
                            {
                                "CacheSummary": {
                                    "PersistentCacheSizeMiB": 0,
                                    "Status": {
                                        "Health": "OK",
                                        "State": "Disabled"
                                    },
                                    "TotalCacheSizeMiB": 128
                                },
                                "FirmwareVersion": "5.32",
                                "Id": "0",
                                "Identifiers": [
                                    {
                                        "DurableName": "51402EC015A28DC0",
                                        "DurableNameFormat": "NAA"
                                    }
                                ],
                                "Location": {
                                    "PartLocation": {
                                        "LocationOrdinalValue": 4,
                                        "LocationType": "Slot",
                                        "ServiceLabel": "Slot=4"
                                    }
                                },
                                "Manufacturer": "HPE",
                                "Model": "HPE Smart Array E208i-p SR Gen10",
                                "Name": "HPE Smart Array E208i-p SR Gen10",
                                "PartNumber": "804397-001",
                                "SerialNumber": "PEYHL0B52GX0QG ",
                                "SpeedGbps": 12.0,
                                "Status": {
                                    "Health": "OK",
                                    "State": "Enabled"
                                }
                            }
                        ]
                    ]
                ],
                "ret": true
            }
        }
    }
}

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module_utils module_utils plugins plugin (any type) labels Aug 9, 2023
@mraineri
Copy link
Contributor

mraineri commented Aug 9, 2023

shipit

@pyfontan
Copy link
Contributor Author

pyfontan commented Aug 10, 2023

@mraineri In fact, I'm going to add more commits because Controllers should also be used in get_disk_inventory and get_volume_inventory functions

@mraineri
Copy link
Contributor

mraineri commented Aug 10, 2023

Perfect; I like consistency! 😄

I think we did have a change to get_disk_inventory to look at either location, but I wouldn't be surprised if we have other cases too.

…rollers key instead of StorageControllers to obtain controller name
@pyfontan
Copy link
Contributor Author

af448b3

get_disk_inventory now returns the controller real name and not the static name Controller 1
I just change priority for get_volume_inventory. It uses data from Controllers and not from StorageControllers if both are available.

@pyfontan
Copy link
Contributor Author

And I think a little bit of refactoring would be needed. But I can't do it right now.

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-6 labels Aug 10, 2023
@mraineri
Copy link
Contributor

Looks good to me, thanks!

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Aug 11, 2023
@felixfontein felixfontein merged commit fe3eec0 into ansible-collections:main Aug 11, 2023
@patchback
Copy link

patchback bot commented Aug 11, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/fe3eec01225eee30ebc3f5dddde1e4e34547aa31/pr-7081

Backported as #7092

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Aug 11, 2023
* Get controller information from "Controllers" field instead of "StorageControllers" which is deprecated

* Add changelog fragment

* Changelog fragment writing guide formatting

* For consistency, get_disk_inventory and get_volume_inventory use Controllers key instead of StorageControllers to obtain controller name

---------

Co-authored-by: Pierre-yves FONTANIERE <pyf@cc.in2p3.fr>
(cherry picked from commit fe3eec0)
@patchback
Copy link

patchback bot commented Aug 11, 2023

Backport to stable-7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-7/fe3eec01225eee30ebc3f5dddde1e4e34547aa31/pr-7081

Backported as #7093

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator

@pyfontan thanks for your contribution!
@mraineri thanks for reviewing!

patchback bot pushed a commit that referenced this pull request Aug 11, 2023
* Get controller information from "Controllers" field instead of "StorageControllers" which is deprecated

* Add changelog fragment

* Changelog fragment writing guide formatting

* For consistency, get_disk_inventory and get_volume_inventory use Controllers key instead of StorageControllers to obtain controller name

---------

Co-authored-by: Pierre-yves FONTANIERE <pyf@cc.in2p3.fr>
(cherry picked from commit fe3eec0)
felixfontein pushed a commit that referenced this pull request Aug 11, 2023
…n on StorageControllers (#7093)

Follow DMTF redfish deprecation on StorageControllers (#7081)

* Get controller information from "Controllers" field instead of "StorageControllers" which is deprecated

* Add changelog fragment

* Changelog fragment writing guide formatting

* For consistency, get_disk_inventory and get_volume_inventory use Controllers key instead of StorageControllers to obtain controller name

---------

Co-authored-by: Pierre-yves FONTANIERE <pyf@cc.in2p3.fr>
(cherry picked from commit fe3eec0)

Co-authored-by: Pierre-yves Fontaniere <pyfontan@cc.in2p3.fr>
felixfontein pushed a commit that referenced this pull request Aug 11, 2023
…n on StorageControllers (#7092)

Follow DMTF redfish deprecation on StorageControllers (#7081)

* Get controller information from "Controllers" field instead of "StorageControllers" which is deprecated

* Add changelog fragment

* Changelog fragment writing guide formatting

* For consistency, get_disk_inventory and get_volume_inventory use Controllers key instead of StorageControllers to obtain controller name

---------

Co-authored-by: Pierre-yves FONTANIERE <pyf@cc.in2p3.fr>
(cherry picked from commit fe3eec0)

Co-authored-by: Pierre-yves Fontaniere <pyfontan@cc.in2p3.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module_utils module_utils plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Obtain redfish information on storage controllers for HPe servers
4 participants