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

How can you un-breakout ports? #652

Open
michaelbhughes opened this issue Apr 22, 2024 · 3 comments
Open

How can you un-breakout ports? #652

michaelbhughes opened this issue Apr 22, 2024 · 3 comments

Comments

@michaelbhughes
Copy link

michaelbhughes commented Apr 22, 2024

Summary

We have triggered a new error when trying to move an interface from 4x25G breakout back to a 1x100G layout. It seems that a new version of an interface map is generated when we breakout a port, but un-breaking out a port does not work the same way.

Previous State
et-0/0/25:0
et-0/0/25:1
et-0/0/25:2
et-0/0/25:3

New State
et-0/0/25

Error

│ Error: failed adding links to generic system "KeBZ6t5knKAOcJc4mjU"
│ 
│   with apstra_datacenter_generic_system.external_generic_system["HV-077"],
│   on resource.tf line 2, in resource "apstra_datacenter_generic_system" "external_generic_system":
│    2: resource apstra_datacenter_generic_system external_generic_system {
│ 
│ {"api_response":null,"config_blueprint_version":0,"errors":{"_schema":"Device
│ profile \"Juniper_QFX5120-32C\" either does not have transformation with id
\"4\" or that transformation does not have active interface
\"et-0/0/25\""},"error_code":422} - http response '' at
│ '[http://100.113.72.133/api/blueprints/b82084f3-9f96-4229-a178-5ab1523ca960/switch-system-links?async=full&async=full'](http://100.113.72.133/api/blueprints/b82084f3-9f96-4229-a178-5ab1523ca960/switch-system-links?async=full&async=full%27)

Current Workaround

We currently delete the rack with the problem generic systems and recreate the rack and all its configs with another terraform plan/apply. This resets the interface map to a state where all ports are un-broken.

Request

Is there some kind of workaround for this behvaiour so we can un-breakout ports using terraform instead of relying on deleting the rack?

@bwJuniper
Copy link
Collaborator

Need to discuss and possibly create a RFE in apstra.

@chrismarget-j
Copy link
Collaborator

Hi @michaelbhughes,

I'm not able to reproduce this problem.

My starting terraform configuration:

resource "apstra_datacenter_generic_system" "b" {
  blueprint_id = "69ff8e58-fd0d-4bdc-974d-44d3a8aace37"
  links = [
    {
      target_switch_id              = "GK2yBZteUSTLEeTdjPo"
      target_switch_if_name         = "et-0/0/1"
      target_switch_if_transform_id = 1
    },
  ]
}

The modified terraform configuration:

resource "apstra_datacenter_generic_system" "b" {
  blueprint_id = "69ff8e58-fd0d-4bdc-974d-44d3a8aace37"
  links = [
    {
      lag_mode                      = "lacp_active"
      target_switch_id              = "GK2yBZteUSTLEeTdjPo"
      target_switch_if_name         = "et-0/0/1:0"
      target_switch_if_transform_id = 4
      group_label                   = "bond0"
    },
    {
      lag_mode                      = "lacp_active"
      target_switch_id              = "GK2yBZteUSTLEeTdjPo"
      target_switch_if_name         = "et-0/0/1:1"
      target_switch_if_transform_id = 4
      group_label                   = "bond0"
    },
    {
      lag_mode                      = "lacp_active"
      target_switch_id              = "GK2yBZteUSTLEeTdjPo"
      target_switch_if_name         = "et-0/0/1:2"
      target_switch_if_transform_id = 4
      group_label                   = "bond0"
    },
    {
      lag_mode                      = "lacp_active"
      target_switch_id              = "GK2yBZteUSTLEeTdjPo"
      target_switch_if_name         = "et-0/0/1:3"
      target_switch_if_transform_id = 4
      group_label                   = "bond0"
    },
  ]
}

Using plugin v0.58.0 (I don't think there's any relevant changes to the behavior of this version), terraform decides that the link change "forces replacement", and the generic system is removed/replaced without incident.

The error you're seeing comes from Apstra (not in our provider nor SDK code), so I'm not sure exactly where it's happening, but I wonder if the error is correct...

Device profile "Juniper_QFX5120-32C" either does not have transformation with id "4"
or that transformation does not have active interface "et-0/0/25"

Could it be that transform id 4 might expect an interface named something like et-0/0/25:N, rather than just et-0/0/25?

@michaelbhughes
Copy link
Author

Thanks for the notes, I will dig into the details and get back to you. I will double check on your note Could it be that transform id 4 might expect an interface named something like et-0/0/25:N, rather than just et-0/0/25?, I understand what you mean here.

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

3 participants