HewlettPackard / oneview-ansible-collection

Ansible Collection and Sample Playbooks for HPE OneView

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logical interconnect group with uplink sets

tubatodd opened this issue · comments

I've run into an inconsistency in the HPE Oneview API definitions.

When creating an uplink set by itself you can make reference to the Q1-Q8 ports by that name.

Example:

    "portConfigInfos" : [
        {
            "desiredSpeed" : "Auto",
            "location" : {
                "locationEntries" : [
                    {
                        "type" : "Port",
                        "value" : "Q1"
                    },
                    {
                        "type" : "Bay",
                        "value" : 3
                    },
                    {
                        "type" : "Enclosure",
                        "value" : "/rest/enclosures/0000000000A66101"
                    }
                ]
            }
        }
    ],

However, when if I create a logical interconnect group and add uplink sets at the same time using the rest API or ansible collection, the Q naming is replaced with a seemingly arbitrary "relativeValue" reference.

Example:

                    "logicalPortConfigInfos": [
                        {
                            "logicalLocation": {
                                "locationEntries": [
                                    {
                                        "type": "Enclosure",
                                        "relativeValue": 1
                                    },
                                    {
                                        "type": "Port",
                                        "relativeValue": 66
                                    },
                                    {
                                        "type": "Bay",
                                        "relativeValue": 3
                                    }
                                ]
                            },
                            "desiredSpeed": "Auto",
                            "desiredFecMode": "Auto"
                        },
                        {
                            "logicalLocation": {
                                "locationEntries": [
                                    {
                                        "type": "Enclosure",
                                        "relativeValue": 1
                                    },
                                    {
                                        "type": "Bay",
                                        "relativeValue": 6
                                    },
                                    {
                                        "type": "Port",
                                        "relativeValue": 66
                                    }
                                ]
                            },
                            "desiredSpeed": "Auto",
                            "desiredFecMode": "Auto"
                        }
                    ],

From trial and error of creating LIG and uplink sets we've figured out 61=Q1, 66=Q2 and 71=Q3.

Without us having to create a mapping of these values in our ansible automation is there a means of being able to use these Q-based names with the logical interconnect group creation API? They are labeled as Q1-8 in the web GUI and are labeled Q1-8 on the physical chassis. These relative values are quite inconvenient to creating ansible automation or API calls from the logical-interconnect-groups end point.

Thank you.

The LIG API is asking for relative value(while creating uplink set) in terms of integers as per the API doc. The ansible collection SDK is following the same structure as defined in the REST API doc.
We agree, there are possibility to enhance this to match it with GUI input i.e. asking the user for Q1..Qn and internally SDK will map it to relative value value. This is an enhancement request and we have added it in our backlog.

Another approach we could think of is :

  1. Create LIG without uplink set
  2. Then create uplink set providing the logical interconnect details (taken from step1)

Hi Todd,

We have added this enhancement and the changes are now available in master branch. The same will be available in OV 7.2 release. Below is an example:

                "logicalPortConfigInfos": [
                    {
                        "logicalLocation": {
                            "locationEntries": [
                                {
                                    "type": "Enclosure",
                                    "relativeValue": 1
                                },
                                {
                                    "type": "Port",
                                    "relativeValue": 'Q2:6' # This value can be Port Name or Port Number
                                },
                                {
                                    "type": "Bay",
                                    "relativeValue": 3
                                }
                            ]
                        },
                        "desiredSpeed": "Auto",
                        "desiredFecMode": "Auto"
                    },
                    {
                        "logicalLocation": {
                            "locationEntries": [
                                {
                                    "type": "Enclosure",
                                    "relativeValue": 1
                                },
                                {
                                    "type": "Bay",
                                    "relativeValue": 6
                                },
                                {
                                    "type": "Port",
                                    "relativeValue": 'Q1:1'
                                }
                            ]
                        },
                        "desiredSpeed": "Auto",
                        "desiredFecMode": "Auto"
                    }
                ],