Skip to content

Commit 02cfe5a

Browse files
committed
kubevirt: proxmoxve: Use ip=any rather than ip=dhcp,dhcp6 for dual stack
systemd-network-generator does not support multiple autoconf values, and fixing this appears difficult. Even then, Dracut does not treat `dhcp,dhcp6` in quite the same way that systemd and NetworkManager do. It only tries IPv6 if IPv4 fails. As of Dracut 112, `any` is treated as IPv4-only, despite the name. However, I have submitted dracut-ng/dracut#2628 to change this behaviour so that it is dual stack in the same manner as systemd and NetworkManager. This would break Afterburn consumers relying on Dracut's network-legacy in the meantime. However, FCOS has already migrated to NetworkManager, and Flatcar is now migrating to systemd-network-manager. I'm not aware of any other consumers. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
1 parent 94cf8e8 commit 02cfe5a

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

docs/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Minor changes:
2727
- ProxmoxVE: Emit one `nameserver=` karg per address so multiple DNS servers work
2828
- ProxmoxVE: Prevent rd-network-kargs from failing without a config drive
2929
- KubeVirt: Use `off` rather than `static` to disable IP autoconf for Dracut and systemd compatibility
30+
- KubeVirt and ProxmoxVE: Use `ip=any` rather than `ip=dhcp,dhcp6` for Dracut and systemd compatibility
3031

3132
Packaging changes:
3233

src/providers/kubevirt/cloudconfig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl MetadataProvider for KubeVirtCloudConfig {
211211
match dhcp {
212212
DhcpSetting::V4 => kargs.push(format!("ip={}:dhcp", id)),
213213
DhcpSetting::V6 => kargs.push(format!("ip={}:dhcp6", id)),
214-
DhcpSetting::Both => kargs.push(format!("ip={}:dhcp,dhcp6", id)),
214+
DhcpSetting::Both => kargs.push(format!("ip={}:any", id)),
215215
}
216216
}
217217

src/providers/kubevirt/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ fn test_network_data() {
207207
let expected = [
208208
"ip=192.168.1.10:::255.255.255.0::eth0:off",
209209
"ip=[2001:db8::10]:::64::eth0:off",
210-
"ip=eth1:dhcp,dhcp6",
210+
"ip=eth1:any",
211211
"rd.route=0.0.0.0/0:192.168.1.1",
212212
"rd.route=[::/0]:[2001:db8::1]",
213213
"nameserver=8.8.8.8",
@@ -292,7 +292,7 @@ fn assert_dhcp_with_static_gw_and_dns(config: &KubeVirtCloudConfig) {
292292
);
293293

294294
let expected = [
295-
"ip=eth0:dhcp,dhcp6",
295+
"ip=eth0:any",
296296
"rd.route=0.0.0.0/0:192.168.1.1",
297297
"rd.route=[::/0]:[2001:db8::1]",
298298
"nameserver=8.8.8.8",
@@ -361,7 +361,7 @@ fn assert_no_duplicate_routes(config: &KubeVirtCloudConfig) {
361361

362362
let kargs = config.rd_network_kargs().unwrap().unwrap();
363363
let expected = [
364-
"ip=eth0:dhcp,dhcp6",
364+
"ip=eth0:any",
365365
"rd.route=0.0.0.0/0:192.168.1.1",
366366
"rd.route=[::/0]:[2001:db8::1]",
367367
];

src/providers/proxmoxve/cloudconfig.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl MetadataProvider for ProxmoxVECloudConfig {
241241
match dhcp {
242242
DhcpSetting::V4 => kargs.push("ip=dhcp".to_string()),
243243
DhcpSetting::V6 => kargs.push("ip=dhcp6".to_string()),
244-
DhcpSetting::Both => kargs.push("ip=dhcp,dhcp6".to_string()),
244+
DhcpSetting::Both => kargs.push("ip=any".to_string()),
245245
}
246246
}
247247

0 commit comments

Comments
 (0)