Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Iosxe faille to configure object ethernet #57

Open
patricer98 opened this issue Sep 16, 2022 · 9 comments
Open

Iosxe faille to configure object ethernet #57

patricer98 opened this issue Sep 16, 2022 · 9 comments

Comments

@patricer98
Copy link

Hi
i m very interested in your iosxe provider
I use terraform v 0.1.12 with c9500-48y4c v 17.8.1

some functions are well working.
Ethernet config, port Channel don’t work at all
Acl are created with misconfig

how can i help you
Regards
7810E565-FCF2-4FDC-9AD8-12DBCDC63BF9

@danischm
Copy link
Member

Hi @patricer98 , can you maybe provide a minimal config that fails and the provided error message?

@patricer98
Copy link
Author

hi daniel,
Are you the daniel who write the nxos et aci provider? great job, thank you!!!

resource "iosxe_service" "les_services" {
pad = true
password_encryption = true
password_recovery = true
timestamps = true
timestamps_debug = true
timestamps_debug_datetime = true
timestamps_debug_datetime_msec = true
timestamps_debug_datetime_localtime = true
timestamps_debug_datetime_show_timezone = true
timestamps_debug_datetime_year = true
timestamps_debug_uptime = true
timestamps_log = true
timestamps_log_datetime = true
timestamps_log_datetime_msec = true
timestamps_log_datetime_localtime = true
timestamps_log_datetime_show_timezone = true
timestamps_log_datetime_year = true
timestamps_log_uptime = true
dhcp = false
tcp_keepalives_in = true
tcp_keepalives_out = true
}

Terraform will perform the following actions:

iosxe_service.les_services will be created

  • resource "iosxe_service" "les_services" {
    • dhcp = false
    • id = (known after apply)
    • pad = true
    • password_encryption = true
    • password_recovery = true
    • tcp_keepalives_in = true
    • tcp_keepalives_out = true
    • timestamps = true
    • timestamps_debug = true
    • timestamps_debug_datetime = true
    • timestamps_debug_datetime_localtime = true
    • timestamps_debug_datetime_msec = true
    • timestamps_debug_datetime_show_timezone = true
    • timestamps_debug_datetime_year = true
    • timestamps_debug_uptime = true
    • timestamps_log = true
    • timestamps_log_datetime = true
    • timestamps_log_datetime_localtime = true
    • timestamps_log_datetime_msec = true
    • timestamps_log_datetime_show_timezone = true
    • timestamps_log_datetime_year = true
    • timestamps_log_uptime = true
      }

Plan: 1 to add, 0 to change, 0 to destroy.
iosxe_service.les_services: Creating...
iosxe_service.les_services: Still creating... [10s elapsed]
iosxe_service.les_services: Still creating... [20s elapsed]

│ Error: Client Error

│ with iosxe_service.les_services,
│ on iosxe_general.tf line 14, in resource "iosxe_service" "les_services":
│ 14: resource "iosxe_service" "les_services" {

│ Failed to configure object (PATCH), got error: HTTP Request failed: StatusCode 409, RESTCONF errors
│ {Error:[{ErrorType:application ErrorTag:lock-denied ErrorAppTag:
│ ErrorPath:/Cisco-IOS-XE-native:native/service ErrorMessage:the configuration database is locked by session
│ 18 yang_mgmt_infra tcp (system from 127.0.0.1) on since 2022-09-16 09:37:38
│ IOS-XE YANG Infrastructure ErrorInfo:}]} {PatchId: GlobalStatus:{Ok:false Errors:{Error:[]}} EditStatus:{Edit:[]}}

@patricer98
Copy link
Author

resource "iosxe_access_list_standard" "allowed_all" {
name = "allow_all"
entries = [
{ sequence = 10
remark = "autorise admin"
permit_prefix = "10.128.0.0"
permit_prefix_mask = "255.255.0.0"
}
]
}

produce in the running

ip access-list standard allow_all
10 remark autorise admin
10 permit 0.0.0.0 255.255.0.0

@patricer98
Copy link
Author

resource "iosxe_interface_port_channel" "po10" {
name = 1 # 1 a 512
#description = "Aggregat vers xxxxxxxxx"
#shutdown = false
}

iosxe_interface_port_channel.po10 will be created

  • resource "iosxe_interface_port_channel" "po10" {
    • description = (known after apply)
    • id = (known after apply)
    • ip_access_group_in = (known after apply)
    • ip_access_group_in_enable = true
    • ip_access_group_out = (known after apply)
    • ip_access_group_out_enable = true
    • ip_dhcp_relay_source_interface = (known after apply)
    • ipv4_address = (known after apply)
    • ipv4_address_mask = (known after apply)
    • name = 1
    • shutdown = (known after apply)
    • switchport = (known after apply)
    • vrf_forwarding = (known after apply)
      }

iosxe_username.userbase will be updated in-place

~ resource "iosxe_username" "userbase" {
id = "Cisco-IOS-XE-native:native/username=userbase"
name = "userbase"
+ privilege = 1
+ secret = (known after apply)
+ secret_encryption = (known after apply)
# (3 unchanged attributes hidden)
}

iosxe_vlan.vlan_100 must be replaced

-/+ resource "iosxe_vlan" "vlan_100" {
~ id = "Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=100" -> (known after apply)
+ name = "vlan_100"
+ private_vlan_association = (known after apply)
~ private_vlan_community = false -> (known after apply)
~ private_vlan_isolated = false -> (known after apply)
~ private_vlan_primary = false -> (known after apply)
~ remote_span = false -> (known after apply)
~ vlan_id = 0 -> 100 # forces replacement
# (1 unchanged attribute hidden)
}

iosxe_vlan.vlan_101 must be replaced

-/+ resource "iosxe_vlan" "vlan_101" {
~ id = "Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=101" -> (known after apply)
+ name = "vlan_101"
+ private_vlan_association = (known after apply)
~ private_vlan_community = false -> (known after apply)
~ private_vlan_isolated = false -> (known after apply)
~ private_vlan_primary = false -> (known after apply)
~ remote_span = false -> (known after apply)
~ vlan_id = 0 -> 101 # forces replacement
# (1 unchanged attribute hidden)
}

Plan: 3 to add, 3 to change, 2 to destroy.
iosxe_vlan.vlan_101: Destroying... [id=Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=101]
iosxe_vlan.vlan_100: Destroying... [id=Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=100]
iosxe_vlan.vlan_101: Destruction complete after 0s
iosxe_banner.banner: Modifying... [id=Cisco-IOS-XE-native:native/banner]
iosxe_interface_port_channel.po10: Creating...
iosxe_access_list_standard.allowed_all: Modifying... [id=Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:standard=allow_all]
iosxe_vlan.vlan_100: Destruction complete after 0s
iosxe_vlan.vlan_101: Creating...
iosxe_username.userbase: Modifying... [id=Cisco-IOS-XE-native:native/username=userbase]
iosxe_vlan.vlan_100: Creating...
iosxe_banner.banner: Modifications complete after 0s [id=Cisco-IOS-XE-native:native/banner]
iosxe_interface_port_channel.po10: Still creating... [10s elapsed]
iosxe_access_list_standard.allowed_all: Still modifying... [id=Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:standard=allow_all, 10s elapsed]
iosxe_vlan.vlan_101: Still creating... [10s elapsed]
iosxe_username.userbase: Still modifying... [id=Cisco-IOS-XE-native:native/username=userbase, 10s elapsed]
iosxe_vlan.vlan_100: Still creating... [10s elapsed]
iosxe_interface_port_channel.po10: Still creating... [20s elapsed]
iosxe_access_list_standard.allowed_all: Still modifying... [id=Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:standard=allow_all, 20s elapsed]
iosxe_vlan.vlan_101: Still creating... [20s elapsed]
iosxe_username.userbase: Still modifying... [id=Cisco-IOS-XE-native:native/username=userbase, 20s elapsed]
iosxe_vlan.vlan_100: Still creating... [20s elapsed]
iosxe_username.userbase: Modifications complete after 29s [id=Cisco-IOS-XE-native:native/username=userbase]
iosxe_access_list_standard.allowed_all: Modifications complete after 29s [id=Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:standard=allow_all]
iosxe_vlan.vlan_100: Creation complete after 29s [id=Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=100]
iosxe_vlan.vlan_101: Creation complete after 29s [id=Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=101]

│ Error: Client Error

│ with iosxe_interface_port_channel.po10,
│ on iosxe_int_portchannel.tf line 8, in resource "iosxe_interface_port_channel" "po10":
│ 8: resource "iosxe_interface_port_channel" "po10" {

│ 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/Port-channel ErrorMessage:inconsistent value: Device refused one or
│ more commands ErrorInfo:}]} {PatchId: GlobalStatus:{Ok:false Errors:{Error:[]}} EditStatus:{Edit:[]}}

@patricer98
Copy link
Author

resource "iosxe_interface_ethernet" "tw1_0_2" {
type = "TwentyFiveGigE"
name = "1/0/2"
shutdown = false
description = "test desc"
}

iosxe_system.general: Refreshing state... [id=Cisco-IOS-XE-native:native]
iosxe_vlan.vlan_100: Refreshing state... [id=Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=100]
iosxe_interface_switchport.tw1_0_1: Refreshing state... [id=Cisco-IOS-XE-native:native/interface/TwentyFiveGigE=1%2F0%2F1/switchport-config/switchport]
iosxe_vlan.vlan_101: Refreshing state... [id=Cisco-IOS-XE-native:native/vlan/Cisco-IOS-XE-vlan:vlan-list=101]
iosxe_access_list_standard.allowed_all: Refreshing state... [id=Cisco-IOS-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:standard=allow_all]
iosxe_template.en_trunk: Refreshing state... [id=Cisco-IOS-XE-native:native/template/Cisco-IOS-XE-template:template_details=Port_802.1x]
iosxe_banner.banner: Refreshing state... [id=Cisco-IOS-XE-native:native/banner]
iosxe_username.userbase: Refreshing state... [id=Cisco-IOS-XE-native:native/username=userbase]
iosxe_username.usertest: Refreshing state... [id=Cisco-IOS-XE-native:native/username=testuser]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:

  • create

Terraform will perform the following actions:

iosxe_interface_ethernet.tw1_0_2 will be created

  • resource "iosxe_interface_ethernet" "tw1_0_2" {
    • channel_group_mode = (known after apply)
    • channel_group_number = (known after apply)
    • description = "test desc"
    • encapsulation_dot1q_vlan_id = (known after apply)
    • id = (known after apply)
    • ip_access_group_in = (known after apply)
    • ip_access_group_in_enable = true
    • ip_access_group_out = (known after apply)
    • ip_access_group_out_enable = true
    • ip_dhcp_relay_source_interface = (known after apply)
    • ipv4_address = (known after apply)
    • ipv4_address_mask = (known after apply)
    • media_type = (known after apply)
    • name = "1/0/2"
    • shutdown = false
    • switchport = (known after apply)
    • type = "TwentyFiveGigE"
    • unnumbered = (known after apply)
    • vrf_forwarding = (known after apply)
      }

Plan: 1 to add, 0 to change, 0 to destroy.
iosxe_interface_ethernet.tw1_0_2: Creating...
iosxe_interface_ethernet.tw1_0_2: Still creating... [10s elapsed]
iosxe_interface_ethernet.tw1_0_2: Still creating... [20s elapsed]

│ Error: Client Error

│ with iosxe_interface_ethernet.tw1_0_2,
│ on iosxe_int_ethernet.tf line 5, in resource "iosxe_interface_ethernet" "tw1_0_2":
│ 5: resource "iosxe_interface_ethernet" "tw1_0_2" {

│ 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/TwentyFiveGigE ErrorMessage:inconsistent value: Device refused one or
│ more commands ErrorInfo:}]} {PatchId: GlobalStatus:{Ok:false Errors:{Error:[]}} EditStatus:{Edit:[]}}

@patricer98
Copy link
Author

for the cisco part, it a stackwise with two members

i Hope not disturbing you with my case
Regards

@patricer98
Copy link
Author

patricer98 commented Sep 16, 2022 via email

@patricer98
Copy link
Author

Hi,
do you have any news .
Regards.

@danischm
Copy link
Member

Sorry, looks like I missed your responses. Have you tried this with the latest version. If it still does not work, just to be sure, the same configuration works on the CLI?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants