[pve-devel] [PATCH qemu-server] Fix #2390: Sort @ifaces array to avoid regeneration of instance-id

Beat Jörg beat.joerg at gmail.com
Fri Sep 27 21:55:12 CEST 2019


Signed-off-by: Beat Jörg <beat.joerg at gmail.com>
---
 PVE/QemuServer/Cloudinit.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm
index ab001f9..c368dd9 100644
--- a/PVE/QemuServer/Cloudinit.pm
+++ b/PVE/QemuServer/Cloudinit.pm
@@ -173,7 +173,7 @@ sub configdrive2_network {
     }
 
     my @ifaces = grep(/^net(\d+)$/, keys %$conf);
-    foreach my $iface (@ifaces) {
+    foreach my $iface (sort @ifaces) {
 	(my $id = $iface) =~ s/^net//;
 	next if !$conf->{"ipconfig$id"};
 	my $net = PVE::QemuServer::parse_ipconfig($conf->{"ipconfig$id"});
@@ -253,7 +253,7 @@ sub nocloud_network_v2 {
     my $dns_done;
 
     my @ifaces = grep(/^net(\d+)$/, keys %$conf);
-    foreach my $iface (@ifaces) {
+    foreach my $iface (sort @ifaces) {
 	(my $id = $iface) =~ s/^net//;
 	next if !$conf->{"ipconfig$id"};
 
@@ -324,7 +324,7 @@ sub nocloud_network {
                 . "config:\n";
 
     my @ifaces = grep(/^net(\d+)$/, keys %$conf);
-    foreach my $iface (@ifaces) {
+    foreach my $iface (sort @ifaces) {
 	(my $id = $iface) =~ s/^net//;
 	next if !$conf->{"ipconfig$id"};
 
-- 
2.7.4




More information about the pve-devel mailing list