network is only configured on first boot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-images |
Invalid
|
Undecided
|
Unassigned | ||
cloud-init |
Expired
|
Undecided
|
Unassigned |
Bug Description
When I create a new VM with an Ubuntu Server Cloud image and using cloud-init, the network is only configured on the first boot. After the machine has been shut-down and powered up again, the network is no longer configured static and instead uses DHCP.
I’m using the, at the time newest, xenial server cloud image (30.08.2017) and use a VM manager called oVirt that uses KVM for virtualization.
cloud-init version 0.7.9
Ubuntu 16.04.3 LTS
Steps to reproduce:
• Download Ubuntu cloud image from https:/
• Mount disk to fix bug #1573095 (https:/
• Fix bug with instructions from comment https:/
• Unmount disk image.
• Import Image into oVirt.
• Create new virtual machine in oVirt.
• Assign disk image to virtual machine.
• Add cloud init parameters (including static IP conf.) to virtual machine.
• Boot virtual machine.
• See that networking works and a static IP is configured (ifconfig).
• See that the network is configured in /etc/network/
• Shutdown (NOT reboot) the virtual machine.
• Power On the virtual machine.
• See that DHCP service runs for 5min.
• After boot see that network is not configured.
• See that file /etc/network/
Other possible causes:
• The cloud image might be wrongly configured to run cloud-init at every boot (As reboots
are not affected and the server listens for cloud-init configuration data after first
boot. Also the ssh hostkey is reset every time the machine boots).
My current workaround:
• I added the following line to my cloud-init runcmd parameters to copy the cloud network
file:
- "cp /etc/network/
• I disable cloud-init manually after first boot by adding the following line to my cloud-
init runcmd parameters:
- [ touch, "/etc/cloud/
Changed in cloud-images: | |
status: | New → Invalid |
Hi Marc,
Thanks for filing this bug! Is this still an issue you are seeing in more recent versions of cloud-init? If it is, please do give us steps to reproduce and set this bug back to New.
Thanks!
Dan