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

Keeping odata IDs in redfish resources ? #7316

Open
1 task done
pyfontan opened this issue Sep 27, 2023 · 5 comments
Open
1 task done

Keeping odata IDs in redfish resources ? #7316

pyfontan opened this issue Sep 27, 2023 · 5 comments
Labels
feature This issue/PR relates to a feature request module module plugins plugin (any type)

Comments

@pyfontan
Copy link
Contributor

Summary

I have a problem to identify network devices on HPe servers.
I would like to have a specific ID for each redfish resource.

Perhaps one should keep @odata.id in final resources.

Issue Type

Feature Idea

Component Name

redfish_info

Additional Information

With the following playbook:

    - name: Get Network card information
      community.general.redfish_info:
        category: Systems
        command: GetNicInventory
        baseuri: "{{ asset.manager.ip }}"
        username: "{{ asset.manager.user }}"
        password: "{{ asset.manager.password }}"
        timeout: "{{ redfish_timeout | default(omit) }}"
      register: rfnicinfo
      delegate_to: "{{manager_proxy_server}}"

We can have description of each Ethernet interface.

    "redfish_facts": {                                                                                                                                          
        "nic": {                                                                                                                                                
            "entries": [                                                                                                                                        
                [                                                                                                                                               
                    {                                                                                                                                           
                        "resource_uri": "/redfish/v1/Systems/1/"                                                                                                
                    },                                                                                                                                          
                    [                                                                                                                                           
                        {                                                                                                                                       
                            "IPv4Addresses": [],                                                                                                                
                            "IPv6Addresses": [],                                                                                                                
                            "Id": "1",                                                                                                                          
                            "MACAddress": "ff:ff:ff:ff:ff:ff",                                                                                                  
                            "Name": "",                                                                                                                         
                            "NameServers": [],                                                                                                                  
                            "SpeedMbps": null,                                                                                                                  
                            "Status": {                                                                                                                         
                                "Health": "OK",                                                                                                                 
                                "State": "Enabled"                                                                                                              
                            }                                                                                                                                   
                        },                                                                                                                                      
                        {         
                            "IPv4Addresses": [],                                                                                                                
                            "IPv6Addresses": [],                                                                                                                
                            "Id": "2",
                            "MACAddress": "ff:ff:ff:ff:ff:ff",
                            "Name": "",
                            "NameServers": [],
                            "SpeedMbps": null,
                            "Status": {
                                "Health": null,
                                "State": null
                            }
                        },
                        {
                            "AutoNeg": true,
                            "Id": "1",
                            "Name": "Ethernet Interface 1",
                            "PermanentMACAddress": "ff:ff:ff:ff:ff:ff",
                            "SpeedMbps": 10000,
                            "Status": {
                                "Health": "OK",
                                "State": "Enabled"
                            }
                        },
                        {
                           "AutoNeg": true,
                            "Id": "2",
                            "Name": "Ethernet Interface 2",
                            "PermanentMACAddress": "ff:ff:ff:ff:ff:ff",
                            "SpeedMbps": 0,
                            "Status": {
                                "Health": "OK",
                                "State": "Enabled"
                            }
                        }
                    ]
                ]
           ],
            "ret": true
        }
    }

But as you can see, IDs are not unique... I've never seen that on DELL servers, but HPe did. :(

I would like to be able to specify an ID as a variable to my playbook. And in my use case, ID must be unique on a single server but can be the same on multiple servers of the same type. So MACAddress can't be used.

I thought that keeping the @odata.id in the resource would be a good idea ?

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request module module plugins plugin (any type) labels Sep 27, 2023
@mraineri
Copy link
Contributor

Yeah, I can see that coming up in other implementations too. Id is only guaranteed to be unique for a given resource collection (and not across the entire service). Having the full URI would be useful. I'd like to avoid calling it @odata.id in the output payload if possible.

@pyfontan
Copy link
Contributor Author

@mraineri I started to write something for disks resources which is named RedfishURI (see #8937).
I'm thinking of implementing the same thing for network interfaces. Is it OK for you ?

@mraineri
Copy link
Contributor

It's definitely in the right direction; I have one suggested addition in the PR to review, but I'm liking the changes so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

3 participants