** Description changed:

  [Impact]
  
  cloud-init can no longer process cloud-config that specify a 'packages'
  value.  This affects any tools (Juju, MAAS) that rely on cloud-init to
  install various packages as part of its first-boot.  This seems to
  trigger when specifying apt_sources in cloud-init.
  
  [Test Case]
  
  Create a userdata file:
  
  cat >>/tmp/ud.txt
  #cloud-config
  apt_sources:
  - {source: 'ppa:openstack-ubuntu-testing/folsom-trunk-testing'}
  apt_update: true
  apt_upgrade: false
  packages: [python-novaclient]
  <<END
  
- Boot a quantal or precise Ubuntu Cloud image, specifying the ud.txt as
- user-data:
+ Boot a precise daily Ubuntu Cloud image, specifying the ud.txt as user-
+ data:
  
  euca-run-instances -k adam -t m1.tiny -f /tmp/ud.txt ami-04d
  
  Allow instance to boot.  Since MAAS provisiongs nodes on-the-fly, first
  boot will have the affected cloud-init version and the attached
  traceback in /var/log/cloud-init-output.log.
  
  For cloud instances, its most likely running an older version of cloud-
  init and the cloud-config was processed okay on first boot.  To test the
  affected version there, ssh to the machine:
  
  # revert changes to system from initial cloud-init run.
  $ sudo dpkg -P python-novaclient ;\
-   sudo rm -rf 
/etc/apt/sources.list.d/openstack-ubuntu-testing-folsom-trunk-testing-precise.list
 ;\
-   sudo rm -rf /var/lib/cloud/*
+   sudo rm -rf 
/etc/apt/sources.list.d/openstack-ubuntu-testing-folsom-trunk-testing-precise.list
 ;\
+   sudo rm -rf /var/lib/cloud/*
  # Install cloud-init from precise-updates
  $ sudo apt-get install cloud-init=0.6.3-0ubuntu1.3
  
  # re-run cloud-init
  $ sudo cloud-init start-local ; sudo cloud-init start; sudo cloud-init-cfg 
all config ; sudo cloud-init-cfg all final
  
  Observe traceback ending in "TypeError: add_sources() takes at most 2
  arguments (3 given)", the expected package was not reinstalled.
  
  Apply fix to 
/usr/share/pyshared/cloudinit/CloudConfig/cc_apt_update_upgrade.py and re-run 
cloud-init.  Works as
  expected, package is reinstalled.
  
  [Regression Potential]
  
  Minimal, simple one-line.
  
  [Original Report]
  
  Noticed juju deployed services were failing to come up using Juju+MAAS
  and the newly released cloud-init SRU for 12.04.  The node provisioned
  thru MAAS okay, but after first boot did not have the required agents
  installed.  On further investigation, it looks like the required juju
  packages were never installed.   /var/log/cloud-init-output.log shows
  the following traceback:
  
  The key fingerprint is:
  b4:83:ef:99:6e:65:15:a3:a3:a2:83:0b:f1:3c:62:7f root@test-08
  The key's randomart image is:
  +--[ECDSA  256]---+
  |                 |
  |            o    |
  |        .  . o   |
  |       o .o .    |
  |.     . S. o     |
  | +    ....o      |
  |o.+. . ..o       |
  |.oo.oE ..o       |
  |  .o.. o=        |
  +-----------------+
  Generating locales...
    en_US.UTF-8... up-to-date
  Generation complete.
  2013-01-16 16:32:56,919 - __init__.py[WARNING]: Traceback (most recent call 
last):
    File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", 
line 117, in run_cc_modules
      cc.handle(name, run_args, freq=freq)
    File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", 
line 78, in handle
      [name, self.cfg, self.cloud, cloudinit.log, args])
    File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 326, in 
sem_and_run
      func(*args)
    File 
"/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/cc_apt_update_upgrade.py",
 line 75, in handle
      errors = add_sources(cloud, cfg['apt_sources'], params)
  TypeError: add_sources() takes at most 2 arguments (3 given)
  
  2013-01-16 16:32:56,919 - __init__.py[ERROR]: config handling of apt-
  update-upgrade, None, [] failed
  
  2013-01-16 16:32:56,998 - cloud-init-cfg[ERROR]: errors running cloud_config 
[config]: ['apt-update-upgrade']
  errors running cloud_config [config]: ['apt-update-upgrade']
  
  Attached are /var/log/cloud-init.log and the MAAS provided user-data
  from /var/lib/cloud/instance/user-data.txt

-- 
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/1100491

Title:
  [SRU] cloud-init 0.6.3-0ubuntu1.3  failing to process juju-generated
  userdata

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1100491/+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