Forum Discussion
Crossplane - failure to delete port resource in Claim
I created a separate issue https://github.com/crossplane-contrib/provider-jet-equinix/issues/54 to track what sounds like a conflicting LateInitialization definition of vlanIds and vxlanIds field in Port. I'm not sure how this would prevent deletion, it would prevent the resource from reaching `Ready` from what we've seen in other resources with a similar conflict.
I'm definitely hitting this issue. I cannot tell if that is the reason for the following issue:
I can use a "Port" resource to "attach" a first vlan to the Device, but subsequent vlans added to the spec.forProvider.vlanIds array are not added to the Device. The message that shows in the condition is:
Message: observe failed: cannot run refresh: refresh failed: Conflicting configuration arguments: "vlan_ids": conflicts with vxlan_ids
Conflicting configuration arguments: "vxlan_ids": conflicts with vlan_ids
Looking at the spec after this, the Port resource looks like this (not two UUIDs but only one Vxlan ID tag:
For Provider:
Bonded: false
Port Id: d07bd18c-641a-4f87-9d5b-b7ab1f9d2ec2
Reset On Delete: true
Vlan Ids:
0d0f0d89-a54c-42eb-b16a-0630fe9b4159
22597c24-ac4e-4e0e-8802-16defe95deaa
Vxlan Ids:
1000
The UI (Networking > VLANS) shows only the first Vlan attached to a device, the other shows as 0.
To be clear, here I am NOT using a portVlanAttachment - only Port as you've suggested. It looks as though I cannot add multiple vlans using this approach. I will try with portVlanAttachment and see if behavior is different.
- mmellin5 months agoLevel 3
Using only a portVlanAttachment (and not a port) also does not work. I think this might be a bug? The condition event says this:
Last Transition Time: 2024-07-17T00:47:06Z Message: apply failed: POST https://api.equinix.com/metal/v1/ports/c6b1b719-5ea7-4509-8ede-ee46b05ce4d5/assign: 422 still bonded : Reason: ApplyFailure Status: False Type: LastAsyncOperation
My resource definition looks like this:
--- apiVersion: metal.equinix.jet.crossplane.io/v1alpha1 kind: PortVlanAttachment metadata: name: mmellinproj-equinix-sv-v1000 spec: forProvider: deviceIdSelector: matchLabels: jci.jnpr.net/equinix: device forceBond: False portName: eth1 vlanVnid: 1000
It seems that the unbonding only occurs when a "Port" resource is created, although it is clearly specified here in the API. Then to attach vlans I must use a PortVlanAttachment. No other combination has been successful for me.
- Marques5 months agoEquinix Employee
From your configuration, it looks like you want eth0 in broken bond0 with layer3 mode and eth1 out of bond in layer2 mode. This is referred to as a Hybrid Unbonded configuration: https://deploy.equinix.com/developers/docs/metal/layer2-networking/hybrid-unbonded-mode/.
Using PortVlanAttachment for Hybrid Unbonded configuration will also require use of DeviceNetworkType with `type: "hybrid"`.
In the Device's default `hybrid-bonded` port mode, it makes sense that attaching a VLAN to eth1 reports "still bonded". If you don't actually need `hybrid` (unbonded) mode, you could change the target portName in your PortVlanAttachment to bond0.
The following Hybrid Unbonded section of the Metal Device Types guide shows how this can be done with Terraform, the Crossplane configuration would apply similarly: https://registry.terraform.io/providers/equinix/equinix/1.20.1/docs/guides/network_types#hybrid-unbonded-device-with-a-vlan
Related Content
- 3 months ago