CiscoDevNet/terraform-provider-iosxe

speed_nonegotiate not working

Closed this issue · 5 comments

Hi,

We get the following error when trying to configure no negotiation auto in TF.
We are using provider 0.5.5.

It looks like nonegotiate in the patch may need to be Cisco-IOS-XE-ethernet:negotiation one level higher.

Can you please look at this?

 Failed to configure object (PATCH), got error: HTTP Request failed: StatusCode 400, RESTCONF errors
│ {Error:[{ErrorType:application ErrorTag:invalid-value ErrorAppTag:
│ ErrorPath:/Cisco-IOS-XE-native:native/interface/GigabitEthernet ErrorMessage:inconsistent value: Device refused
│ one or more commands ErrorInfo:}]} {PatchId: GlobalStatus:{Ok:false Errors:{Error:[]}} EditStatus:{Edit:[]}
│ Errors:{Error:[]}}

Terraform code

resource "iosxe_interface_ethernet" "router01_interface_ethernet_10" {
  provider          = iosxe.router01_provider
  type              = "GigabitEthernet"
  name              = "10"
  description       = "HELLO_ERROR"
  shutdown          = true
  speed_nonegotiate = true
  speed_10000 = true
}

Running config before plan:

show running-config interface gigabitEthernet 10 | format restconf-json

{
  "data": {
    "Cisco-IOS-XE-native:native": {
      "interface": {
        "GigabitEthernet": [
          {
            "name": "10",
            "description": "HELLO_ERROR",
            "shutdown": [null],
            "mop": {
              "enabled": false,
              "sysid": false
            },
            "Cisco-IOS-XE-ethernet:speed": {
              "value-10000": [null]
            },
            "Cisco-IOS-XE-ethernet:negotiation": {
              "auto": false
            }
          }
        ]
      }
    }
  }
}

restconf in the trace (before)

2024/01/16 14:10:52 [DEBUG] HTTP Response: {
  "Cisco-IOS-XE-native:GigabitEthernet": [
    {
      "name": "10",
      "description": "HELLO_ERROR",
      "shutdown": [null],
      "logging": {
        "event": {
          "link-status": [null]
        }
      },
      "mop": {
        "enabled": false,
        "sysid": false
      },
      "access-session": {
        "host-mode": "multi-auth"
      },
      "Cisco-IOS-XE-ethernet:speed": {
        "value-10000": [null]
      },
      "Cisco-IOS-XE-ethernet:negotiation": {
        "auto": false
      }
    }
  ]
}

PATCH that fails

provider.terraform-provider-iosxe_v0.5.5: 2024/01/16 14:10:59 [DEBUG] HTTP Request: PATCH, https://cisco.some_nice_url.com/restconf/data/Cisco-IOS-XE-native:native/interface/GigabitEthernet, 
{
    {
        "Cisco-IOS-XE-native:GigabitEthernet": {
            "name": "10",
            "description": "HELLO_ERROR",
            "shutdown": {},
            "Cisco-IOS-XE-ethernet:speed": {
                "value-10000": {},
                "nonegotiate": {}
            }
        }
    }
}
provider.terraform-provider-iosxe_v0.5.5: 2024/01/16 14:10:59 [DEBUG] HTTP Response: {
provider.terraform-provider-iosxe_v0.5.5:   "ietf-restconf:errors": {
provider.terraform-provider-iosxe_v0.5.5:     "error": [
provider.terraform-provider-iosxe_v0.5.5:       {
provider.terraform-provider-iosxe_v0.5.5:         "error-type": "application",
provider.terraform-provider-iosxe_v0.5.5:         "error-tag": "invalid-value",
provider.terraform-provider-iosxe_v0.5.5:         "error-path": "/Cisco-IOS-XE-native:native/interface/GigabitEthernet",
provider.terraform-provider-iosxe_v0.5.5:         "error-message": "inconsistent value: Device refused one or more commands"
provider.terraform-provider-iosxe_v0.5.5:       }
provider.terraform-provider-iosxe_v0.5.5:     ]
provider.terraform-provider-iosxe_v0.5.5:   }
provider.terraform-provider-iosxe_v0.5.5: }
provider.terraform-provider-iosxe_v0.5.5: 2024/01/16 14:10:59 [DEBUG] Transient error detected
provider.terraform-provider-iosxe_v0.5.5: 2024/01/16 14:10:59 [DEBUG] Begining backoff method: attempts 0 on 10

Note that speed_nonegotiate is something different then no negotiation auto.

As mentioned, I think there is a misunderstanding. I believe you are trying to configure the equivalent of the no negotiation auto CLI command using the speed_nonegotiate attribute of the resource, which is not the same. If that is not the case, please share the desired cli configuration and the corresponding YANG configuration using the show running-config interface xxx | format restconf-json command.

Hi,

I agree. Yes there probably was a misunderstanding. The end goal here is to set an interface to 10G speed.

10G interface configuration ("speed 10000") demands "no negotiation auto". Since the current release of the provider has "speed_nonegotiate" only (with no documentation), the assumption was made that this was the required/related setting. This does not seem to be the case.

However, in the unreleased 0.5.6 there is a new "negotiation_auto". This seems to work for us.

When is 0.5.6 due to be formally released?

Thank you,

Jan

v0.5.6 release has just been published.