Merge lp:~fginther/vmbuilder/jenkins_kvm-ci-wa-all into lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm

Proposed by Francis Ginther
Status: Merged
Merged at revision: 824
Proposed branch: lp:~fginther/vmbuilder/jenkins_kvm-ci-wa-all
Merge into: lp:~ubuntu-on-ec2/vmbuilder/jenkins_kvm
Diff against target: 59 lines (+28/-0)
3 files modified
templates/img-azure-16.04-addin.tmpl (+10/-0)
templates/img-azure-18.10-addin.tmpl (+9/-0)
templates/img-azure-19.04-addin.tmpl (+9/-0)
To merge this branch: bzr merge lp:~fginther/vmbuilder/jenkins_kvm-ci-wa-all
Reviewer Review Type Date Requested Status
David Krauser (community) Approve
Tobias Koch (community) Approve
Review via email: mp+366457@code.launchpad.net

Commit message

Add cloud-init multi-nic workaround for SF Case #222480 (add for 16.04, 18.10, 19.04)

When adding network devices after first boot, network configuration
data is not created and the devices are unusable.

This workaround creates a systemd drop-in file to clear out the
cloud-init persistent object forcing cloud-init to perform network
discovery on each boot.

Description of the change

This is the same fix as https://code.launchpad.net/~cloudware/vmbuilder/jenkins_kvm-fginther/+merge/366182 applied to the other active releases except trusty (which uses an older cloud-init).

To post a comment you must log in.
Revision history for this message
Tobias Koch (tobijk) :
review: Approve
Revision history for this message
David Krauser (davidkrauser) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'templates/img-azure-16.04-addin.tmpl'
--- templates/img-azure-16.04-addin.tmpl 2017-10-16 21:01:28 +0000
+++ templates/img-azure-16.04-addin.tmpl 2019-04-24 13:15:34 +0000
@@ -48,6 +48,16 @@
4848
49EOF49EOF
5050
51# Apply a workaround for adding multiple NICs (SF Case #222480)
52# This clears cloud-init's persistent network object, forcing network
53# rediscovery on each boot (which correctly finds NICs added after VM creation)
54mkdir -p "${mp}/lib/systemd/system/cloud-init-local.service.d"
55cat << EOF > "${mp}/lib/systemd/system/cloud-init-local.service.d/50-azure-clear-persistent-obj-pkl.conf"
56[Service]
57ExecStartPre=-/bin/sh -xc 'if [ -e /var/lib/cloud/instance/obj.pkl ]; then echo "cleaning persistent cloud-init object"; rm /var/lib/cloud/instance/obj.pkl; fi; exit 0'
58EOF
59
60
51# Frame buffer fix61# Frame buffer fix
52cat << EOF >> "${mp}/etc/initramfs-tools/modules"62cat << EOF >> "${mp}/etc/initramfs-tools/modules"
5363
5464
=== modified file 'templates/img-azure-18.10-addin.tmpl'
--- templates/img-azure-18.10-addin.tmpl 2019-03-26 17:12:13 +0000
+++ templates/img-azure-18.10-addin.tmpl 2019-04-24 13:15:34 +0000
@@ -47,6 +47,15 @@
47 security: http://ports.ubuntu.com/ubuntu-ports47 security: http://ports.ubuntu.com/ubuntu-ports
48EOF48EOF
4949
50# Apply a workaround for adding multiple NICs (SF Case #222480)
51# This clears cloud-init's persistent network object, forcing network
52# rediscovery on each boot (which correctly finds NICs added after VM creation)
53mkdir -p "${mp}/lib/systemd/system/cloud-init-local.service.d"
54cat << EOF > "${mp}/lib/systemd/system/cloud-init-local.service.d/50-azure-clear-persistent-obj-pkl.conf"
55[Service]
56ExecStartPre=-/bin/sh -xc 'if [ -e /var/lib/cloud/instance/obj.pkl ]; then echo "cleaning persistent cloud-init object"; rm /var/lib/cloud/instance/obj.pkl; fi; exit 0'
57EOF
58
50# Frame buffer fix59# Frame buffer fix
51cat << EOF >> "${mp}/etc/initramfs-tools/modules"60cat << EOF >> "${mp}/etc/initramfs-tools/modules"
5261
5362
=== modified file 'templates/img-azure-19.04-addin.tmpl'
--- templates/img-azure-19.04-addin.tmpl 2018-10-25 10:52:01 +0000
+++ templates/img-azure-19.04-addin.tmpl 2019-04-24 13:15:34 +0000
@@ -48,6 +48,15 @@
4848
49EOF49EOF
5050
51# Apply a workaround for adding multiple NICs (SF Case #222480)
52# This clears cloud-init's persistent network object, forcing network
53# rediscovery on each boot (which correctly finds NICs added after VM creation)
54mkdir -p "${mp}/lib/systemd/system/cloud-init-local.service.d"
55cat << EOF > "${mp}/lib/systemd/system/cloud-init-local.service.d/50-azure-clear-persistent-obj-pkl.conf"
56[Service]
57ExecStartPre=-/bin/sh -xc 'if [ -e /var/lib/cloud/instance/obj.pkl ]; then echo "cleaning persistent cloud-init object"; rm /var/lib/cloud/instance/obj.pkl; fi; exit 0'
58EOF
59
51# Frame buffer fix60# Frame buffer fix
52cat << EOF >> "${mp}/etc/initramfs-tools/modules"61cat << EOF >> "${mp}/etc/initramfs-tools/modules"
5362

Subscribers

People subscribed via source and target branches