instance-data.json not persisted across reboot.

Bug #1791781 reported by Chad Smith on 2018-09-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Chad Smith

Bug Description

cloud-init v18.3 /run/cloud-init/instance-data.json does not persist across reboot.

Affects: Xenial series or later

Any attempt by services/consumers to re-use instance data after a machine reboots will fail.

To reproduce:

$ lxc launch ubuntu-daily:xenial test-xenial
Creating test-xenial
Starting test-xenial

$ lxc exec test-xenial cat /ruc/cloud-init/instance-data.json/cloud-init/instance-data.json
 "base64-encoded-keys": [

$ lxc exec test-xenial reboot
$ lxc exec test-xenial cat /ruc/cloud-init/instance-data.json

cat: /run/cloud-init/instance-data.json: No such file or directory

Note: cloud-init only writes instnace-data.json when processing meta-data on the 1st boot via DataSource.get_data call. We either need to persist this data somewhere else, or write it again per boot.

Related branches

Chad Smith (chad.smith) on 2018-09-10
Changed in cloud-init:
importance: Undecided → High
status: New → Confirmed
assignee: nobody → Chad Smith (chad.smith)
Scott Moser (smoser) on 2018-09-11
Changed in cloud-init:
status: Confirmed → In Progress

This bug is fixed with commit c7555762 to cloud-init on branch master.
To view that commit see the following URL:

Changed in cloud-init:
status: In Progress → Fix Committed

This bug is believed to be fixed in cloud-init in version 18.4. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers