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

Bug: iosxr_interface resource do not support changing ip address on subinterface #244

Open
edudppaz opened this issue Apr 5, 2024 · 2 comments

Comments

@edudppaz
Copy link

edudppaz commented Apr 5, 2024

After the iosxr_interface has configured a subinterface, changing the ip address on the same interface throws an error:

Plan result:

Terraform will perform the following actions:

  # iosxr_interface.sda_link_subif_fw["OSL-fw-fn02"] will be updated in-place
  ~ resource "iosxr_interface" "sda_link_subif_fw" {
        id                          = "Cisco-IOS-XR-um-interface-cfg:/interfaces/interface[interface-name=GigabitEthernet0/0/0/6.3130]"
      ~ ipv4_address                = "192.0.3.19" -> "192.0.3.35"
        # (8 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Apply:

iosxr_interface.sda_link_subif_fw["OSL-fw-fn02"]: Still modifying... [id=Cisco-IOS-XR-um-interface-cfg:/interfac...face-name=GigabitEthernet0/0/0/6.3130], 10s elapsed]
╷
│ Error: Client Error
│ 
│   with iosxr_interface.sda_link_subif_fw["OSL-fw-fn02"],
│   on main.tf line 292, in resource "iosxr_interface" "sda_link_subif_fw":
│  292: resource "iosxr_interface" "sda_link_subif_fw" {
│ 
│ Set request failed, got error: rpc error: code = Internal desc = gNMI
│ commit-request: operation-failed: Subinterface or Layer 2 configuration
│ conflicts with existing configuration, or configuration in this commit:
│ Please refer to configuration documentation for further assistance:
│ Cisco-IOS-XR-um-interface-cfg:interfaces/interface[interface-name =
│ 'GigabitEthernet0/0/0/6.3130']/interface-name

Manually using "taint" to destroy the resource before re-creating, or running a terraform destroy on that specific resource before a new plan/apply, correctly configures the new ip address (after removing the interface and re-applying).

This is a basic change that should be supported in the resource.

@edudppaz edudppaz changed the title Bug: iosxr_interface resource do not support changing ip address on the interface Bug: iosxr_interface resource do not support changing ip address on subinterface Apr 5, 2024
@danischm
Copy link
Member

danischm commented Apr 8, 2024

I quickly tested it with this config and changing the IP of the subinterface, which worked for me..

resource "iosxr_interface" "main" {
  interface_name = "GigabitEthernet0/0/0/3"
  ipv4_address   = "1.1.1.3"
  ipv4_netmask   = "255.255.255.0"
}

resource "iosxr_interface" "sub" {
  interface_name              = "GigabitEthernet0/0/0/3.200"
  encapsulation_dot1q_vlan_id = 200
  ipv4_address                = "2.1.1.4"
  ipv4_netmask                = "255.255.255.0"
}

Could you maybe try the same and see if that works for you?

@edudppaz
Copy link
Author

Hi @danischm im currently not configuring anything on the main interface, only touching the subinterface configuration. But i will try doing "something" on the main interface (a description, for example) and try again.

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

No branches or pull requests

2 participants