[pve-devel] [PATCH v11 cloudinit 3/9] cloud-init : force ifdown ifup at boot
Wolfgang Bumiller
w.bumiller at proxmox.com
Wed Aug 19 12:51:08 CEST 2015
From: Alexandre Derumier <aderumier at odiso.com>
when we change ip address, network configuration is correctly writen in guest,
but cloud-init don't apply it and keep previous ip address.
workaround with forcing ifdown ifup
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/QemuServer.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index e471ffb..03bac55 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -6537,6 +6537,9 @@ sub generate_cloudinit_userdata {
my $hostname = $conf->{searchdomain} ? $conf->{name}.".".$conf->{searchdomain} : $conf->{name};
$content .= "fqdn: $hostname\n";
$content .= "manage_etc_hosts: true\n";
+ $content .= "bootcmd: \n";
+ $content .= " - ifdown -a\n";
+ $content .= " - ifup -a\n";
if ($conf->{sshkey}) {
$content .= "users:\n";
--
2.1.4
More information about the pve-devel
mailing list