← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1890528] [NEW] cloud-init status --wait returns before cloud-final has finished executing

 

Public bug reported:

I'm instrumenting our EC2 instances to report whether cloud-init
succeeded or failed during the  boot process. I've implemented this as a
systemd unit that is triggered early in the boot process that runs a
script that resembles the following:

cloud_init_status=0
cloud-init status --wait || cloud_init_status=$?

if [ "$cloud_init_status" = "0" ]; then
  report_launch_success
else
  report_launch_failure
fi

I was expecting `cloud-init status --wait` to only return after cloud-
final has completed, but I discovered today that it can return early if
there is an error encountered during the cloud-config stage.

I reported this in IRC and @blackboxsw thought the issue might be
somewhere in this code ( https://github.com/canonical/cloud-
init/blob/a13febd286d21f1754e32f4a05e722039eb452b8/cloudinit/cmd/status.py#L133-L144)
and suggested I file a bug here.

I am using cloud-init 20.2-45 on Xenial.

** Affects: cloud-init
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1890528

Title:
  cloud-init status --wait returns before cloud-final has finished
  executing

Status in cloud-init:
  New

Bug description:
  I'm instrumenting our EC2 instances to report whether cloud-init
  succeeded or failed during the  boot process. I've implemented this as
  a systemd unit that is triggered early in the boot process that runs a
  script that resembles the following:

  cloud_init_status=0
  cloud-init status --wait || cloud_init_status=$?

  if [ "$cloud_init_status" = "0" ]; then
    report_launch_success
  else
    report_launch_failure
  fi

  I was expecting `cloud-init status --wait` to only return after cloud-
  final has completed, but I discovered today that it can return early
  if there is an error encountered during the cloud-config stage.

  I reported this in IRC and @blackboxsw thought the issue might be
  somewhere in this code ( https://github.com/canonical/cloud-
  init/blob/a13febd286d21f1754e32f4a05e722039eb452b8/cloudinit/cmd/status.py#L133-L144)
  and suggested I file a bug here.

  I am using cloud-init 20.2-45 on Xenial.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1890528/+subscriptions


Follow ups