F5Networks / f5-appsvcs-extension

F5 BIG-IP Application Services 3 Extension
Apache License 2.0
163 stars 52 forks source link

The PATCH API request does not unassociate the trunk vLANs from interface configuration when modifying or removing the trunk vLANs from an existing System Interface. #811

Open selinaarokiaswamy-GSLAB opened 3 months ago

selinaarokiaswamy-GSLAB commented 3 months ago

Environment

Summary

I have associated vLANs with tag 32, 106 to a system interface 2.0 on a rSeries Host device. Below are the configuration details for the interface and the API details to reproduce this.

GET request on the Interface API URL: https://{{rseries_appliance1_ip}}:8888/restconf/data/openconfig-interfaces:interfaces Type: GET Response:


{
                "name": "2.0",
                "config": {
                    "name": "2.0",
                    "type": "iana-if-type:ethernetCsmacd",
                    "enabled": true
                },
                "state": {
                    "name": "2.0",
                    "type": "iana-if-type:ethernetCsmacd",
                    "mtu": 9600,
                    "enabled": true,
                    "oper-status": "DOWN",
                    "counters": {
                        "in-octets": "0",
                        "in-unicast-pkts": "0",
                        "in-broadcast-pkts": "0",
                        "in-multicast-pkts": "0",
                        "in-discards": "0",
                        "in-errors": "0",
                        "in-fcs-errors": "0",
                        "out-octets": "0",
                        "out-unicast-pkts": "0",
                        "out-broadcast-pkts": "0",
                        "out-multicast-pkts": "0",
                        "out-discards": "0",
                        "out-errors": "0"
                    },
                    "f5-interface:forward-error-correction": "auto",
                    "f5-lacp:lacp_state": "LACP_DEFAULTED"
                },
                "openconfig-if-ethernet:ethernet": {
                    "state": {
                        "port-speed": "openconfig-if-ethernet:SPEED_100GB",
                        "hw-mac-address": "14:a9:d0:1f:fb:08",
                        "counters": {
                            "in-mac-control-frames": "0",
                            "in-mac-pause-frames": "0",
                            "in-oversize-frames": "0",
                            "in-jabber-frames": "0",
                            "in-fragment-frames": "0",
                            "in-8021q-frames": "0",
                            "in-crc-errors": "0",
                            "out-mac-control-frames": "0",
                            "out-mac-pause-frames": "0",
                            "out-8021q-frames": "0"
                        },
                        "f5-if-ethernet:flow-control": {
                            "rx": "on"
                        }
                    },
                    "openconfig-vlan:switched-vlan": {
                        "config": {
                            "trunk-vlans": [
                                32,
                                106
                            ]
                        }
                    }
                }
            },

Here, to unassociate the vLAN with tag 32 from this interface 2.0, I hit the below PATCH request: URL: https://{{rseries_appliance1_ip}}:8888/restconf/data/ Type: PATCH Request Body:

{
    "openconfig-interfaces:interfaces": {
        "interface": [
            {
                "name": "2.0", 
                "openconfig-if-ethernet:ethernet": {
                    "openconfig-vlan:switched-vlan": {
                        "config": {
                            "trunk-vlans": [
                                106
                            ]
                        }
                    }
                }
            }
        ]
    }
}

Received Response code: 204

Here since vLAN 32 is removed from this configuration, this vLAN should be unassociated from the interface 2.0. However, the interface 2.0 configuration still displays vLAN 32 under "trunk-vlans" field. Please refer below response.

GET on the interface displays below response

{
                "name": "2.0",
                "config": {
                    "name": "2.0",
                    "type": "iana-if-type:ethernetCsmacd",
                    "enabled": true
                },
                "state": {
                    "name": "2.0",
                    "type": "iana-if-type:ethernetCsmacd",
                    "mtu": 9600,
                    "enabled": true,
                    "oper-status": "DOWN",
                    "counters": {
                        "in-octets": "0",
                        "in-unicast-pkts": "0",
                        "in-broadcast-pkts": "0",
                        "in-multicast-pkts": "0",
                        "in-discards": "0",
                        "in-errors": "0",
                        "in-fcs-errors": "0",
                        "out-octets": "0",
                        "out-unicast-pkts": "0",
                        "out-broadcast-pkts": "0",
                        "out-multicast-pkts": "0",
                        "out-discards": "0",
                        "out-errors": "0"
                    },
                    "f5-interface:forward-error-correction": "auto",
                    "f5-lacp:lacp_state": "LACP_DEFAULTED"
                },
                "openconfig-if-ethernet:ethernet": {
                    "state": {
                        "port-speed": "openconfig-if-ethernet:SPEED_100GB",
                        "hw-mac-address": "14:a9:d0:1f:fb:08",
                        "counters": {
                            "in-mac-control-frames": "0",
                            "in-mac-pause-frames": "0",
                            "in-oversize-frames": "0",
                            "in-jabber-frames": "0",
                            "in-fragment-frames": "0",
                            "in-8021q-frames": "0",
                            "in-crc-errors": "0",
                            "out-mac-control-frames": "0",
                            "out-mac-pause-frames": "0",
                            "out-8021q-frames": "0"
                        },
                        "f5-if-ethernet:flow-control": {
                            "rx": "on"
                        }
                    },
                    "openconfig-vlan:switched-vlan": {
                        "config": {
                            "trunk-vlans": [
                                32,
                                106
                            ]
                        }
                    }
                }
            },

Steps To Reproduce

Steps to reproduce the behaviour:

  1. Add vLANs to interface list using below request body and API details

URL: https://{{rseries_appliance1_ip}}:8888/restconf/data/ Request Type: PATCH

{
    "openconfig-interfaces:interfaces": {
        "interface": [
            {
                "name": "2.0", 
                "openconfig-if-ethernet:ethernet": {
                    "openconfig-vlan:switched-vlan": {
                        "config": {
                            "trunk-vlans": [
                                106, 32
                            ]
                        }
                    }
                }
            }
        ]
    }
}
  1. Get the interface details using below details and observe the vLANs 106 and 32 added to the interface 2.0:

URL: https://{{rseries_appliance1_ip}}:8888/restconf/data/openconfig-interfaces:interfaces Type: GET

  1. Unassociate the vLAN with tag 32 from this interface 2.0 using below request body and API details: URL: https://{{rseries_appliance1_ip}}:8888/restconf/data/ Type: PATCH Request Body:
    {
    "openconfig-interfaces:interfaces": {
        "interface": [
            {
                "name": "2.0", 
                "openconfig-if-ethernet:ethernet": {
                    "openconfig-vlan:switched-vlan": {
                        "config": {
                            "trunk-vlans": [
                                106
                            ]
                        }
                    }
                }
            }
        ]
    }
    }
  2. Get the interface details using below details and observe the vLAN 32 is still present in the interface 2.0 configuration:

URL: https://{{rseries_appliance1_ip}}:8888/restconf/data/openconfig-interfaces:interfaces Type: GET

Expected Behavior

The PATCH API request should unassociate the trunk vLANs from interface configuration when modifying or removing the trunk vLANs from an existing System Interface.

Actual Behavior

The PATCH API request does not unassociate the trunk vLANs from interface configuration when modifying or removing the trunk vLANs from an existing System Interface.