]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/QemuServer/Cloudinit.pm
fix #1959: add fallback for 'auto' previously set by SLAAC
[qemu-server.git] / PVE / QemuServer / Cloudinit.pm
index b63d010e60d7a25d166d6812a99c474c706db43a..5be820c22d58b0cc0014e7dab6412f8d2db9132d 100644 (file)
@@ -316,7 +316,7 @@ sub nocloud_network {
        my $net = PVE::QemuServer::parse_net($conf->{$iface});
        my $ipconfig = PVE::QemuServer::parse_ipconfig($conf->{"ipconfig$id"});
 
-       my $mac = $net->{macaddr}
+       my $mac = lc($net->{macaddr})
            or die "network interface '$iface' has no mac address\n";
 
        $content .= "${i}- type: physical\n"
@@ -340,8 +340,11 @@ sub nocloud_network {
        if (defined(my $ip = $ipconfig->{ip6})) {
            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";
            } else {
-               $content .= "${i}- type: static6\n"
+               $content .= "${i}- type: static\n"
                       . "${i}  address: $ip\n";
                if (defined(my $gw = $ipconfig->{gw6})) {
                    $content .= "${i}  gateway: $gw\n";