cloud-init should offer an option to reboot following updates if the kernel was changed

Bug #1038108 reported by Andy Whitcroft
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Fix Released
Wishlist
Scott Moser

Bug Description

When an image requests 'apt-get update/apt-get upgrade' the kernel may get updated, it makes sense to then reboot into this new kernel before completing cloud-init. It would be good to have an option post update which reboots us if the kernel has been changed.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: cloud-init (not installed)
ProcVersionSignature: Ubuntu 3.2.0-29.46-generic 3.2.24
Uname: Linux 3.2.0-29-generic x86_64
ApportVersion: 2.0.1-0ubuntu12
Architecture: amd64
Date: Fri Aug 17 14:17:47 2012
EcryptfsInUse: Yes
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Andy Whitcroft (apw)
Changed in cloud-init (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Scott Moser (smoser) wrote :

Proof of concept has this diff:
  http://paste.ubuntu.com/1161567/

resulting in this console output:
 http://paste.ubuntu.com/1161564/

and this cloud-init.log:
 http://paste.ubuntu.com/1161571/

Specifically:
Aug 22 20:40:36 server-14956 [CLOUDINIT] util.py[DEBUG]: Writing to /var/run/reboot-required - wb: [420] 3 bytes
Aug 22 20:40:36 server-14956 [CLOUDINIT] cc_apt_update_upgrade.py[WARNING]: rebooting per /var/run/reboot-required
Aug 22 20:40:36 server-14956 [CLOUDINIT] util.py[DEBUG]: Running command ['/sbin/reboot'] with allowed return codes [0] (shell=False, capture=True)
2012-08-22 20:40:45,149 - util.py[DEBUG]: Cloud-init v. 0.7 running 'init-local' at Wed, 22 Aug 2012 20:40:45 +0000. Up 5.53 seconds.

The patch there is hacked to turn this on by default and also to force the writing of that file (and avoid a reboot loop by having me touch /etc/foo first).

Revision history for this message
Scott Moser (smoser) wrote :

fix-committed in trunk revno 631.

Changed in cloud-init (Ubuntu):
assignee: nobody → Scott Moser (smoser)
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.0~bzr633-0ubuntu1

---------------
cloud-init (0.7.0~bzr633-0ubuntu1) quantal; urgency=low

  * New upstream snapshot.
    * support creating users on boot. remove requirement for a 'ubuntu'
      user to be previously present in image. (LP: #1028503)
    * add experimental apt_reboot_if_required flag to reboot if necessary
      after upgrade or package install (LP: #1038108)
    * improve mirror selection for a distro:
      * support arm mirrors (LP: #1028501)
      * support seeding security mirror (LP: #1006963)
      * support dns mirrors including availability-zone reference
        (LP: #1037727)
    * include a "None" datasource so items like ssh host key generation
      occur if there is no other metadata service. (LP: #906669)
    * print authorized_keys for users to the console (LP: #1010582)
    * Add RHEVm and vSphere support as datasource AltCloud [Joseph VLcek]
 -- Scott Moser <email address hidden> Thu, 23 Aug 2012 01:06:34 -0400

Changed in cloud-init (Ubuntu):
status: Fix Committed → Fix Released
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.