proxmoxve: explicit static IP configuration - #1282
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Proxmox VE cloud-config provider to append :::off to the generated ip= kernel arguments for both IPv4 and IPv6 network configurations. Feedback suggests using network::dracut_addr to properly format IPv6 addresses to avoid parsing issues with dracut, and reminds the author to update the corresponding unit tests to match the new kernel argument format.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| kargs.push(format!( | ||
| "ip={}::{}:{}", | ||
| "ip={}::{}:{}:::off", | ||
| network.ip(), | ||
| gateway.gateway, | ||
| network.prefix() | ||
| )); | ||
| } else { | ||
| kargs.push(format!("ip={}:::{}", network.ip(), network.prefix())); | ||
| kargs.push(format!("ip={}:::{}:::off", network.ip(), network.prefix())); | ||
| } |
There was a problem hiding this comment.
For IPv6 addresses, dracut's colon-separated parser requires them to be enclosed in square brackets (e.g., [2001:db8::1]) so that the colons in the IPv6 address are not mistaken for field separators. Since you are modifying these lines, please use the helper network::dracut_addr to correctly format the IPv6 addresses.
kargs.push(format!(
"ip={}::{}:{}:::off",
network::dracut_addr(&IpAddr::V6(network.ip())),
network::dracut_addr(&gateway.gateway),
network.prefix()
));
} else {
kargs.push(format!(
"ip={}:::{}:::off",
network::dracut_addr(&IpAddr::V6(network.ip())),
network.prefix()
));
}There was a problem hiding this comment.
@tormath1 I think this is a valid bug, it looks like the KubeVirt provider already does this correctly (src/providers/kubevirt/cloudconfig.rs:204).
There was a problem hiding this comment.
Good idea, this is now done and tests are updated as well.
b3b0531 to
c181f17
Compare
This costs nothing to append - dracut explodes this 'ip=' into variables[^1], and downstream libraries might default to 'dhcp' if the 'autoconf' variable is empty. [^1]: https://github.com/dracutdevs/dracut/blob/5d2bda46f4e75e85445ee4d3bd3f68bf966287b9/modules.d/40network/net-lib.sh#L541 Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
With 'dracut_addr' we properly escape the IPv6 (with brackets) Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
c181f17 to
eb4d1d5
Compare
Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
Thanks! Changelog entry has been added. |
This costs nothing to append - dracut explodes this 'ip=' into variables1, and downstream libraries might default to 'dhcp' if the 'autoconf' variable is empty.
Related to: flatcar/Flatcar#2002, flatcar/scripts#3677
(cc @theoraim)
Footnotes
https://github.com/dracutdevs/dracut/blob/5d2bda46f4e75e85445ee4d3bd3f68bf966287b9/modules.d/40network/net-lib.sh#L541 ↩