`cloud-init status` reports "disabled" for a boot when it did run

Bug #1883124 reported by Dan Watkins
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Undecided
Unassigned

Bug Description

Steps to reproduce, on a booted instance:

$ cloud-init status
done
$ touch /etc/cloud/cloud-init.disabled
$ cloud-init status
disabled

While this is accurate on one sense (cloud-init _is_ now disabled) it obscures the fact that cloud-init did run for this boot. It is both "done" _and_ "disabled".

Revision history for this message
Dan Watkins (oddbloke) wrote :

This is related to bug 1883122.

Revision history for this message
Chad Smith (chad.smith) wrote :

A note as well that we do have a 'reason' detail if you provide `cloud-init status --long`

But, this also seems to be 'buggy' on a system which had already run cloud-init once and is now disabled:

Here's what I expected to see on a post-boot disabled lxc container

$ cloud-init status --long
status: disabled
Cloud-init disabled by /etc/cloud/cloud-init.disabled

Here's what I get currently on a post-boot disabled lxc container
$ cloud-init status --long
status: disabled
time: Fri, 12 Jun 2020 20:00:51 +0000
detail:
DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]

We definitely have enough information to better represent that current state vs next_boot/is_enabled configuration as separate status values as you discussed in bug 1883122

Revision history for this message
Chad Smith (chad.smith) wrote :

For this case, what do you think about reporting done (disabled). We would know if cloud-init ran already on the system based on /run/cloud/result.json presence and could easily distinguish this.

Changed in cloud-init:
status: New → Triaged
Revision history for this message
Chad Smith (chad.smith) wrote :

I think additionally I'd like to see the following from cloud-init status --long:

status: done (disabled)
time: Fri, 03 Jul 2020 01:54:54 +0000
detail:
DataSourceNoCloud [seed=/var/lib/cloud/seed/nocloud-net][dsmode=net]
Cloud-init disabled by /etc/cloud/cloud-init.disabled

Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Triaged → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.