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

No management-only switch for physical interface #160

Open
rchrabas opened this issue Nov 24, 2023 · 7 comments
Open

No management-only switch for physical interface #160

rchrabas opened this issue Nov 24, 2023 · 7 comments

Comments

@rchrabas
Copy link

I'm trying to manage the Diagnostic0/0 interface, however it seems there is hardcoded value for 'management-only', which does not seem to be manageable and that makes deployment fail.

╷
│ Error: unable to update physical interface
│ 
│   with fmc_device_physical_interfaces.DeviceVar1PhysicalInterfaceVar9,
│   on 0051-interfaces.tf line 118, in resource "fmc_device_physical_interfaces" "DeviceVar1PhysicalInterfaceVar9":
│  118: resource "fmc_device_physical_interfaces" "DeviceVar1PhysicalInterfaceVar9" {
│ 
│ getting physical interfaces:
│ https://[redacted]/api/fmc_config/v1/domain/e276abec-e0f2-11e3-8169-6d9ed49b625f/devices/devicerecords/05edadf4-628b-11ee-89e6-9e7c8bc2f790/physicalinterfaces/005056B0-B67D-0ed3-0000-008589939889
│ - wrong status code: 400, error category: FRAMEWORK, error severity: ERROR,
│ error messages: [{Diagnostic0/0: Management-Only field cannot be modified
│ on Management interface.}]
@205101-retr0
Copy link
Contributor

This might happen sometimes when the mapping between the interfaces during the deployment isn't clear. Could you please share the configuration code for this?

@rchrabas
Copy link
Author

Sure, this is my code

data "fmc_device_physical_interfaces" "DeviceVar1PhysicalInterfaceVar9" {
  name = "Diagnostic0/0"
  device_id = data.fmc_devices.DeviceVar1.id
}

resource "fmc_device_physical_interfaces" "DeviceVar1PhysicalInterfaceVar9" {
  device_id = data.fmc_devices.DeviceVar1.id
  enabled = true
  ipv6_enforce_eui = false
  mode = "NONE"
  mtu = "1500"
  name = "Diagnostic0/0"
  physical_interface_id = data.fmc_device_physical_interfaces.DeviceVar1PhysicalInterfaceVar9.id
}

@205101-retr0
Copy link
Contributor

Hello again,
Sorry for taking so long to repsond. I have been testing this feature on a private branch for the past few days. Could you share specific scenarios where you envision using the enhanced feature? Understanding your use case will guide our development efforts effectively. Feel free to provide any details or examples that come to mind. Appreciate your input!

@rchrabas
Copy link
Author

rchrabas commented Dec 8, 2023

Hey,
I'm working on small project of my own. It's not super urgent, but at that same time this shouldn't be much complicated as this is directly supported by API?

@205101-retr0
Copy link
Contributor

Hey,
This is a bit weird to explain. For every feature, there is four APIs generally dedicated to CRUD. Physical interfaces has only 2 update and delete, probably because they are physical elements. Diagnostic, which you are trying to control, is a default interface is which cannot be deleted.
Now, this is where terraform starts to make it hard. So when you create a resource, the create func is called. when you update the update is called and so on. But in case of phy int, only update func is called everytime and it tends to mess the terraform's internal state. This "update" essentially deletes the existing one and creates a new one in its place.
So we did code in the management-only feature; And it did let us control the diagnostic interface. But everytime I made a change to it or to any other resource used by it, terraform tried to delete it which is threw error.

Best way is to just change through the UI. If that's not an option for you then you, then you can try using ansible to do the same. FMCAnsible - Follow this link and check it out once. Ansible is not stateful so it's not gonna try to destroy anything, it does what you'll tell it to do.

Hope this helps.

@rchrabas
Copy link
Author

Okey, so you basically cannot fix that on Terraform level. Is this what you are trying to tell me ?

@205101-retr0
Copy link
Contributor

No, unless you prefer encountering challenges when making changes, as Terraform can be less optimal compared to ansible in handling such situations.

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