]> git.proxmox.com Git - qemu-server.git/commitdiff
fix #2670: cloudinit enable SLAAC
authorMira Limbeck <m.limbeck@proxmox.com>
Mon, 29 Mar 2021 12:07:15 +0000 (14:07 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Mar 2021 16:25:06 +0000 (18:25 +0200)
cloud-init's SLAAC option was disabled in 2018 because there was no
support for it. Now that cloud-init 19.4 or newer versions are more
widespread, we can finally reenable it.

Also include minimum required cloud-init version for SLAAC support in
format description.

Tested on Ubuntu 20.04 (ci 20.4), CentOS 8 (ci 19.4), Debian 10 (ci
20.2).

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
PVE/QemuServer.pm
PVE/QemuServer/Cloudinit.pm

index f9379f64d286ee0bbe86de7bec3d93278f8102ed..8c483e63b95e7c3f18a9e8359fc09f4595460f87 100644 (file)
@@ -964,7 +964,8 @@ IP addresses use CIDR notation, gateways are optional but need an IP of the same
 
 The special string 'dhcp' can be used for IP addresses to use DHCP, in which case no explicit
 gateway should be provided.
-For IPv6 the special string 'auto' can be used to use stateless autoconfiguration.
+For IPv6 the special string 'auto' can be used to use stateless autoconfiguration. This requires
+cloud-init 19.4 or newer.
 
 If cloud-init is enabled and neither an IPv4 nor an IPv6 address is specified, it defaults to using
 dhcp on IPv4.
index 3224dd084e7b324990792eebd9a15f3c0116a88b..a5474d3ecc5c8e48675dac4df71c7f0d4e2bcdd8 100644 (file)
@@ -449,8 +449,8 @@ sub nocloud_network {
            if ($ip eq 'dhcp') {
                $content .= "${i}- type: dhcp6\n";
            } elsif ($ip eq 'auto') {
-               # SLAAC is not supported by cloud-init, this fallback should work with an up-to-date netplan at least
-               $content .= "${i}- type: dhcp6\n";
+               # SLAAC is only supported by cloud-init since 19.4
+               $content .= "${i}- type: ipv6_slaac\n";
            } else {
                $content .= "${i}- type: static6\n"
                       . "${i}  address: '$ip'\n";