fix: improve OpenStack bare metal network configuration reliability#12696
fix: improve OpenStack bare metal network configuration reliability#12696maxpain wants to merge 1 commit intosiderolabs:mainfrom
Conversation
15b3f5d to
55e01b8
Compare
| // NetworkConfiguration implements the runtime.Platform interface. | ||
| func (o *OpenStack) NetworkConfiguration(ctx context.Context, st state.State, ch chan<- *runtime.PlatformNetworkConfig) error { | ||
| // wait for devices to be ready before proceeding, otherwise we might not find network interfaces by MAC | ||
| if err := netutils.WaitForDevicesReady(ctx, st); err != nil { |
There was a problem hiding this comment.
I would put it to ParseMetadata call (close to where it matters).
There was a problem hiding this comment.
In NoCloud it's placed in the same spot — at the top of NetworkConfiguration (nocloud.go:131). I kept it consistent with that pattern. Happy to move it closer to ParseMetadata if you prefer, either here or in a follow-up PR.
55e01b8 to
f3304b0
Compare
f3304b0 to
1517a11
Compare
b01e7d7 to
adfdcb9
Compare
346b2ee to
77701fc
Compare
b93564c to
244ee7c
Compare
|
@smira this PR is ready to merge |
There was a problem hiding this comment.
Pull request overview
Improves OpenStack (Ironic/bare metal) platform network configuration reliability by delaying config parsing until devices are ready, making MAC/interface matching more resilient, and adding a reconciliation retry loop.
Changes:
- Update
ParseMetadatato return aneedsReconcileflag and add MAC matching fallbacks (PermanentAddr → HardwareAddr) plus bond MAC override from metadata. - Add
WaitForDevicesReadybefore network configuration and introduce an exponential-backoff retry loop when link/MAC matching can’t be completed yet. - Remove hardcoded bond parameters to rely on defaults.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/openstack.go | Adds device-readiness wait, bond MAC override, MAC matching fallback, and backoff-based reconciliation retries; adjusts ParseMetadata signature and bond defaults. |
| internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/openstack_test.go | Updates test to handle the new needsReconcile return value. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/openstack.go
Show resolved
Hide resolved
internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/openstack.go
Show resolved
Hide resolved
internal/app/machined/pkg/runtime/v1alpha1/platform/openstack/openstack.go
Outdated
Show resolved
Hide resolved
This commit improves network configuration on OpenStack bare metal (Ironic) by: 1. Adding WaitForDevicesReady call before parsing network configuration to ensure network interfaces are available. 2. Adding fallback to HardwareAddr when PermanentAddr is empty, similar to the NoCloud platform implementation. 3. Adding a retry loop with exponential backoff to handle cases where network interfaces are not immediately available after device init. 4. Removing hardcoded bond parameters (UpDelay: 200, DownDelay: 200, LACPRate: fast) to use kernel defaults matching Ubuntu behavior. 5. Explicitly setting the bond interface MAC address from OpenStack metadata to ensure the switch sees the correct MAC on the bond. These changes address network configuration failures on bare metal OpenStack deployments where interfaces may not be immediately discoverable by MAC address, and fix bond MAC address mismatch issues where the switch expects a specific MAC on the bond interface. Signed-off-by: Max Makarov <maxpain@linux.com>
244ee7c to
b539219
Compare
Summary
Fixes network configuration issues on OpenStack bare metal (Ironic) servers with bonded interfaces.
Changes:
WaitForDevicesReadycall before parsing network configuration to ensure network interfaces are availableHardwareAddrwhenPermanentAddris empty (ethtool may not have populated it yet)UpDelay: 200,DownDelay: 200,LACPRate: fast) to use kernel defaults matching Ubuntu behaviorThe bond MAC fix addresses a critical issue where Linux assigns the bond the MAC of the first enslaved interface, which may not match the MAC expected by the switch. OpenStack metadata provides the correct MAC via
ethernet_mac_addressfield, and we now apply it explicitly.The retry loop, HardwareAddr fallback and
WaitForDevicesReadymatch the pattern used in the NoCloud platform.Testing
These changes have been verified in production on our bare metal servers (GCore Bare Metal Cloud) and everything works correctly after the fix.