lxc-create -t ubuntu-cloud --userdata ignores userdata

Bug #1043582 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Medium
Serge Hallyn
Precise
Fix Released
Medium
Unassigned
Quantal
Fix Released
Medium
Serge Hallyn

Bug Description

====================================
SRU Justification
1. Impact: --userdata argument is ignored
2. Development fix: get full path to userdata script before switching cwd
3. Stable fix: same as development fix
4. Test case: See the recipe below in bug description
5. Regression potential: none
====================================

$ sudo lxc-destroy -n maas
$ cat my-userdata
#!/bin/sh
ifconfig eth0 > /ifconfig-eth0

$ sudo lxc-create -t ubuntu-cloud -n maas -- \
   --release precise --arch amd64 --auth-key $HOME/.ssh/id_rsa.pub \
   --userdata my-userdata

$ sudo cat /var/lib/lxc/maas/rootfs/var/lib/cloud/seed/nocloud-net/user-data
#cloud-config
output: {all: '| tee -a /var/log/cloud-init-output.log'}
apt-mirror: http://archive.ubuntu.com/ubuntu
manage_etc_hosts: localhost
locale: en_US.UTF-8

Basically, --userdata was ignored entirely.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: lxc 0.7.5-3ubuntu62
ProcVersionSignature: User Name 3.2.0-29.46-virtual 3.2.24
Uname: Linux 3.2.0-29-virtual x86_64
ApportVersion: 2.0.1-0ubuntu12
Architecture: amd64
Date: Thu Aug 30 00:31:00 2012
Ec2AMI: ami-0000013e
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
ProcEnviron:
 TERM=screen
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)

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

The bug here is that it silently ignores the argument to --userdata if its not a full path.

Changed in lxc (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Ah, because the templates cd's into another directory before doing 'cp $userdata wherever'. We need to stash the full pathname when accepting the argument.

Changed in lxc (Ubuntu):
assignee: nobody → Serge Hallyn (serge-hallyn)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.8.0~rc1-4ubuntu32

---------------
lxc (0.8.0~rc1-4ubuntu32) quantal; urgency=low

  * 0204-ubuntu-cloud-userdata-path: Fix broken behavior when a relative
    path is passed into '--userdata' argument. (LP: #1043582)
  * 0205-lxc-ls-manpage-document-two-lines: Document the default two-line
    output format of lxc-ls. (LP: #1043018)
  * lxc-start-ephemeral: support fedora and centos (LP: #1042431)
 -- Serge Hallyn <email address hidden> Thu, 30 Aug 2012 10:05:06 -0500

Changed in lxc (Ubuntu Quantal):
status: Triaged → Fix Released
tags: added: needsru
Changed in lxc (Ubuntu Precise):
assignee: nobody → Serge Hallyn (serge-hallyn)
importance: Undecided → Medium
status: New → In Progress
description: updated
Changed in lxc (Ubuntu Precise):
assignee: Serge Hallyn (serge-hallyn) → nobody
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Hello Scott, or anyone else affected,

Accepted lxc into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/lxc/0.7.5-3ubuntu64 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in lxc (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Verified in precise-proposed.

description: updated
tags: added: verification-done
removed: verification-needed
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.7.5-3ubuntu65

---------------
lxc (0.7.5-3ubuntu65) precise-proposed; urgency=low

  * Add proper fix (X001-lxc-ls-onelisting) for lxc-ls showing running
    containers multiple times. (LP: #1043018)

lxc (0.7.5-3ubuntu64) precise-proposed; urgency=low

  [ Serge Hallyn ]
  * lxc.lxc-net.upstart: tell iptables not to masquerate packets between
    containers. (LP: #1045947)
  * 0204-ubuntu-cloud-userdata-path: Fix broken behavior when a relative
    path is passed into '--userdata' argument. (LP: #1043582)
  * 0205-lxc-ls-manpage-document-two-lines: Document the default two-line
    output format of lxc-ls. (LP: #1043018)
  * lxc-start-ephemeral: support fedora and centos (LP: #1042431)
  * 0222-debian-dhcp3-package: fix install of debian testing containers.
    (LP: #1052972)
  * 0100-template-cleanup-cache: clean up template cache if interrupted
    during build. (LP: #1037331)

  [ Scott Moser ]
  * 0225-ubuntu-cloud-numeric-owner: use --numeric-owner when extracting root
    filesystems with tar (LP: #1066084)
 -- Serge Hallyn <email address hidden> Wed, 07 Nov 2012 11:03:36 -0600

Changed in lxc (Ubuntu Precise):
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.