Skip to content

proxmoxve: explicit static IP configuration#1282

Open
tormath1 wants to merge 1 commit into
coreos:mainfrom
tormath1:tormath1/proxmox
Open

proxmoxve: explicit static IP configuration#1282
tormath1 wants to merge 1 commit into
coreos:mainfrom
tormath1:tormath1/proxmox

Conversation

@tormath1

@tormath1 tormath1 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

  1. https://github.com/dracutdevs/dracut/blob/5d2bda46f4e75e85445ee4d3bd3f68bf966287b9/modules.d/40network/net-lib.sh#L541

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 217 to 225
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()));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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()
                                ));
                            }

Comment on lines 201 to 209
kargs.push(format!(
"ip={}::{}:{}",
"ip={}::{}:{}:::off",
network.ip(),
gateway.gateway,
network.mask()
));
} else {
kargs.push(format!("ip={}:::{}", network.ip(), network.mask()));
kargs.push(format!("ip={}:::{}:::off", network.ip(), network.mask()));
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The changes to the kernel arguments format (appending :::off) will cause the existing unit tests in src/providers/proxmoxve/tests.rs to fail, as they still assert the old format without the :::off suffix. Please update test_network_kargs and test_network_kargs_no_gateway in src/providers/proxmoxve/tests.rs to match the new format.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant