packngo icon indicating copy to clipboard operation
packngo copied to clipboard

With client.DevicePorts deprecated, how does one set a network type to hybrid-bonded?

Open 5731la opened this issue 3 years ago • 1 comments

With the old (apparently deprecated) syntax, creating a bonded network can be done like so: metalClient.DevicePorts.DeviceToNetworkType(dev.ID, "hybrid-bonded")

Now, with the new metalClient.Ports object, you can ConvertToLayerTwo() and ConvertToLayerThree() but not ConvertToHybrid() (unless the docs are just very unclear?)

5731la avatar Jul 04 '22 17:07 5731la

I should clarify, metalClient is the variable name used for a *Client object.

5731la avatar Jul 05 '22 17:07 5731la

@gidoBOSSftw5731 sorry for the ridiculous delay.

ConvertToHybrid, which sets Hybrid Unbonded mode, is achieved by breaking the bond and setting the first device to Layer3 and the second device to Layer2. For example, DevicePortServiceOp.ConvertDevice does the following: https://github.com/packethost/packngo/blob/9693ea74e17ce69b8b5c969a9873566a18ba9804/device_ports.go#L232-L257

Hybrid Bonded mode is another mode to consider which does not require breaking the bond. VLANs can be assigned to a bond device in Layer3 mode, which will automatically convert that device to Hybrid Bonded mode.

displague avatar Feb 22 '23 02:02 displague

There's more to learn about these modes, including the raw API calls needed to achieve them in the docs:

  • https://deploy.equinix.com/developers/docs/metal/layer2-networking/hybrid-bonded-mode/
  • https://deploy.equinix.com/developers/docs/metal/layer2-networking/hybrid-unbonded-mode/

displague avatar Feb 22 '23 02:02 displague

Ah, thanks for the clarification. The documentation did not make it clear that the hybrid bonding would be done automatically when required, especially when it doesn't look like it was done automatically before (or else why have an option to force it?)

5731la avatar Feb 22 '23 16:02 5731la