Repository navigation
fix: conditionally set explicit hostname in Nova server create to prevent .novalocal suffix - #426
Conversation
|
The PR needs to be labeled with ok-to-test by a maintainer to trigger the automated validation of the change |
|
/lgtm, thanks. Can you sign the commit as required by the DCO-check? |
…vent .novalocal suffix Signed-off-by: Benedikt Haug <benedikt.haug@gmx.de>
099800a to
754c77d
Compare
|
The PR needs to be labeled with ok-to-test by a maintainer to trigger the automated validation of the change |
done |
|
Thanks for the PR @benedikt-haug! |
|
LGTM label has been added. DetailsGit tree hash: cb2cb294397a42c9beb01495a51399e236cea40e |
|
/kind enhancement |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aaronfern, AndreasBurger The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Motivation
When Nova derives the OS hostname from the server display name, it appends the
[api] dhcp_domain(commonly.novalocal). For Gardener shoot workers, the full machine name can exceed the 63-byte RFC 1123 label limit that Kubernetes enforces for thekubernetes.io/hostnamenode label, causing pod scheduling failures:Additionally, the
.novalocalsuffix causes hostname instability across reboots (see gardener/gardener-extension-provider-openstack#569): cloud-init re-applies the FQDN on reboot, racing with theExecStartPreworkaround that strips the domain, leading to inconsistent hostnames and kubelet startup failures.Background
Since Nova Wallaby (API microversion 2.90), the
hostnamefield inPOST /serversallows decoupling the OS hostname from the display name. When set, Nova uses this value directly in the metadata service — without appendingdhcp_domain. The display name (Name) remains unaffected.This was confirmed via a manual PoC against an OpenStack deployment (Nova max microversion 2.100):
hostnamefield accepted with MV 2.90OS-EXT-SRV-ATTR:hostnamestored the explicit value without.novalocalhostnamefield) remained unaffectedReferences:
CreateOpts.Hostnamefield (available since v2.x, confirmed in v2.12.0)Changes
pkg/client/nova.go: Conditionally pin the Nova compute client to microversion 2.90 usingutils.GetSupportedMicroversions(), enabling thehostnamefield in server create requests. Falls back gracefully on older Nova deployments.pkg/driver/executor/executor.go: PassmachineNameas the explicithostnameinservers.CreateOptsonly whenSupportsHostnameOverride()returns true, decoupling the OS hostname from the display name.pkg/client/types.go: AddedSupportsHostnameOverride() boolto theComputeinterface.Supersedes #414 (closed due to accidental force-push). Incorporates all review feedback from @aaronfern and @AndreasBurger.
Fixes gardener/gardener-extension-provider-openstack#569
🤖 Generated with AI assistance — the code changes, analysis, and PoC verification were performed by an AI agent. The approach was validated manually against a live OpenStack deployment.