Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions pkg/config/cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,14 +588,28 @@ func UpdateManagementInterfaceConfig(mgmtInterface Network, dnsNameServers []str
logrus.Error(err, string(output))
return err
}
// This next command waits up to 30 seconds to ensure there's
// a connection. Without this, it's possible that a slow DHCP
// server won't return in time, and the installer will subsequently
// fail the check for a default route.
output, err = exec.Command("nm-online", "-x").CombinedOutput()
// Wait (up to the timeout) for NetworkManager to finish (re)starting the
// management network before continuing.
//
// Use "-s" (wait for startup to complete) instead of "-x": "-x" exits
// immediately and defeats the intended wait, and startup (interfaces
// finished activating) is the right signal rather than *global*
// connectivity, which an isolated management network may never reach.
//
// The 45s timeout gives a slow-rate LACP bond headroom to converge:
// lacp_rate=slow emits an LACPDU only every 30s, so a single missed
// interval can cost ~30s before the bond syncs. Because "-s" returns as
// soon as startup completes, this budget only costs time on a genuinely
// slow or degraded link.
//
// The check is best-effort and must NOT be fatal. On the
// already-installed first-boot path it runs before the RancherD config is
// written, so aborting the install here on a briefly-degraded link (e.g. a
// bond still re-converging) leaves the node with no role until manual
// repair. See harvester/harvester#10885.
output, err = exec.Command("nm-online", "-s", "-t", "45").CombinedOutput()
if err != nil {
logrus.Error(err, string(output))
return err
logrus.Warnf("nm-online did not confirm the management network within the timeout; continuing anyway: %v: %s", err, string(output))
}
}

Expand Down