util.islxc() method is broken without is-lxc-container

Bug #941955 reported by Scott Moser
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Unassigned
cloud-init (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

as reported in comment 5 of bug 800856, 'islxc()' is not working correctly. Copied report is below:

I'm not sure if it's my setup or because of a recent change in libvirt or lxc but I'm still having the resize error on a lxc container:

2012-02-25 21:46:53,755 - __init__.py[DEBUG]: handling resizefs with freq=None and args=[]
2012-02-25 21:46:53,764 - cc_resizefs.py[WARNING]: Failed to make device node to resize /
2012-02-25 21:46:53,772 - __init__.py[WARNING]: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 108, in run_cc_modules
    cc.handle(name, run_args, freq=freq)
  File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/__init__.py", line 72, in handle
    [ name, self.cfg, self.cloud, cloudinit.log, args ])
  File "/usr/lib/python2.7/dist-packages/cloudinit/__init__.py", line 313, in sem_and_run
    func(*args)
  File "/usr/lib/python2.7/dist-packages/cloudinit/CloudConfig/cc_resizefs.py", line 46, in handle
    os.mknod(devpth, 0400 | stat.S_IFBLK, dev)
OSError: [Errno 1] Operation not permitted

This is what I got from /proc/1/cgroup instead of /

root@server-50:~# cat /proc/1/cgroup
1:blkio,freezer,devices,memory,cpuacct,cpu:/libvirt/lxc/instance-00000032

In the virtual server:

ii cloud-init 0.6.3~bzr502-0ubuntu1

In the openstack compute server:

ii libvirt-bin 0.9.8-2ubuntu10
ii lxc 0.7.5-3ubuntu30

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: cloud-init 0.6.3~bzr527-0ubuntu1
ProcVersionSignature: User Name 3.2.0-17.27-virtual 3.2.6
Uname: Linux 3.2.0-17-virtual x86_64
ApportVersion: 1.93-0ubuntu2
Architecture: amd64
Date: Mon Feb 27 14:36:36 2012
Ec2AMI: ami-00000000
Ec2AMIManifest: FIXME
Ec2AvailabilityZone: nova
Ec2InstanceType: m1.small
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
PackageArchitecture: all
ProcEnviron:
 TERM=screen
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

(I suspect you know this, but it's kind of hard to find because it's been renamed and switched packages: you should now use /bin/running-in-container which ships with upstart)

Revision history for this message
Scott Moser (smoser) wrote : Re: [Bug 941955] Re: util.islxc() method is broken without is-lxc-container

On Mon, 27 Feb 2012, Serge Hallyn wrote:

> (I suspect you know this, but it's kind of hard to find because it's
> been renamed and switched packages: you should now use /bin/running-in-
> container which ships with upstart)

I did not know this. you probably should lay down a symlink or some other
way handle backward compatibility.

However, the actually "i don't have lxc-is-container" code is busted also.

It was expecting to find only a "/" in the cgroup file that it opened.

Scott Moser (smoser)
Changed in cloud-init (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in cloud-init:
status: New → Triaged
Changed in cloud-init (Ubuntu):
importance: High → Medium
Changed in cloud-init:
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote :

Per stgraber, I should mimic the code in /etc/init/container-detect.conf [1] in the case where there is no 'running-in-container' (which is the new replacement for lxc-is-container).
--
[1] http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/upstart/precise/view/head:/debian/conf/container-detect.conf

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

This bug was fixed in the package cloud-init - 0.6.3~bzr530-0ubuntu1

---------------
cloud-init (0.6.3~bzr530-0ubuntu1) precise; urgency=low

  * New upstream snapshot.
    - fix DataSourceNoCloud seeded from local or cmdline (LP: #942695)
    - change 'islxc' to 'iscontainer' and use 'running-in-container' utility
      from upstart rather than 'lxc-is-container' (LP: #941955)
    - Do not fail on bad part handlers, instead catch error and log
 -- Scott Moser <email address hidden> Tue, 28 Feb 2012 19:15:19 -0500

Changed in cloud-init (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

This was fixed in revno 529.

Changed in cloud-init:
status: Triaged → Fix Committed
Scott Moser (smoser)
Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
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.