** Description changed:

- I spawned a lucid AWS instance and used some cloud-init config to
- perform some tasks for me.
+ === Begin SRU Information ===
+ [Impact]
+  * If a user launches a 10.04 cloud-image with a user-data script, and then
+    does a upgrade to 12.04 and 'reboot's to complete the upgrade, the
+    user-data script will incorrectly execute again on boot.
+ 
+    This is because the cloud config module that executed user-data changed
+    names between 10.04 and 12.04 from 'user-scripts' to 'config-scripts-user',
+    but nothing was in place to adjust the "already ran" marker file
+ 
+ [Test Case]
+  * launch an instance with some user-data:
+    $ cat lp-1049146-user-data.txt
+    #!/bin/sh
+    echo "====== $(date -R) [$0] =====" | tee -a /root/user-data.log
+ 
+    $ ubuntu-ec2-run --key=your-keyname --instance-type=m1.medium \
+       --user-data-file lp-1049146-user-data.txt lucid daily
+    # us-east-1/instance-store/ubuntu-lucid-daily-amd64-server-20121108
+ 
+  * upgrade the image and then do-release-upgrade it, then reboot
+    $ IP=THE_IP_ADDRESS
+    $ ssh ubuntu@$IP
+    % sudo apt-get update -q && sudo apt-get upgrade -y
+    % do-release-upgrade --frontend=DistUpgradeViewNonInteractive
+ 
+    # you could install the patched new version of cloud-init by hand here.
+    % sudo reboot
+ 
+  * see that the user-data has run more than once
+    # upon reboot, you'll see that the user-data script ran again (twice)
+    $ sudo cat /root/user-data.log
+    ====== Thu, 08 Nov 2012 17:07:52 +0000
+    [/var/lib/cloud/data/scripts/part-000] =====
+    ====== Thu, 08 Nov 2012 17:26:50 +0000
+    [/var/lib/cloud/instance/scripts/part-000] =====
+    ====== Thu, 08 Nov 2012 17:26:50 +0000
+    [/var/lib/cloud/instance/scripts/part-001] =====
+ 
+ [Regression Potential]
+  * There is little potential to make anything worse here.  The relevant
+    change is really only to touch a file in the post install that will
+    serve as a marker for the newer version of cloud-init, so it realize
+    that the user-data has already been executed once.
+ 
+ === End SRU Information ===
+ 
+ 
+ 
+ I spawned a lucid AWS instance and used some cloud-init config to perform 
some tasks for me.
  
  All is good.
  
  Then, as part of the task I was performing, I upgraded that lucid
  instance to precise using do-release-upgrade. It failed, but unrelated
  to cloud-init (a postinst from a package failed).
  
  I then rebooted the instance. When it came back up, the cloud-init
  config I supplied the first time was run again, as if this was the first
  time the instance booted.
  
  smoser had access to before and after reboot, and asked to add this to the 
bug:
  # for x in /var/lib/cloud/instance/sem/*; do [ -f 
var-lib-cloud/instance/sem/${x##*/} ] || echo ${x##*/}; done
  config-byobu
  config-ca-certs
  config-chef
  config-grub-dpkg
  config-keys-to-console
  config-landscape
  config-mcollective
  config-phone-home
  config-rightscale_userdata
  config-rsyslog
  config-salt-minion
  config-scripts-per-instance
  config-scripts-user
  config-set-passwords
  config-ssh-import-id
  config-timezone
  
  $ ls var-lib-cloud/instance/sem/
  config-apt-pipelining      config-puppet        config-updates-check
  config-apt-update-upgrade  config-runcmd        consume_userdata
  config-locale              config-set_hostname  user-scripts
  config-mounts              config-ssh

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to cloud-init in Ubuntu.
https://bugs.launchpad.net/bugs/1049146

Title:
  cloud-init runs again after reboot in release upgraded instance

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

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to