attach_volume fails for LXC ("No such file or directory")

Bug #1046495 reported by David Kang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
In Progress
Undecided
Chuck Short

Bug Description

* nova:

commit fb84ed7b32520b11d4a6273eb002b1f1abd2fbe8
Merge: 4ccc770 5a470f8
Author: Jenkins <email address hidden>
Date: Wed Sep 5 18:13:34 2012 +0000

    Merge "fix issues with Nova security groups and Quantum"

* Symptom:

$ euca-attach-volume vol-0000000d -i i-0000000d -d /dev/vdc

--> It fails to attach.
 The log file of nova-compute shows that it fails at the following command:

 Command: sudo nova-rootwrap /etc/nova/rootwrap.conf touch /usr/local/nova/instances/instance-0000000d/rootfs/dev/c

 It fails because "..../dev/c" does not exist.

* /etc/nova/nova.conf has the following configurations:
  use_cow_images=True
  libvirt_type=lxc

---- log of nova-compute ---
2012-09-05 14:52:45 DEBUG nova.virt.libvirt.config [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] Generated XML <disk type="block" device="disk">
  <driver type="raw" cache="none"/>
  <source dev="/dev/disk/by-path/ip-10.99.50.2:3260-iscsi-iqn.2010-10.org.openstack:volume-7d853f5b-1c46-4bf2-b9fe-f8610aee2f3e-lun-1"/>
  <target bus="virtio" dev="c"/>
  <serial>7d853f5b-1c46-4bf2-b9fe-f8610aee2f3e</serial>
</disk>
  from (pid=25370) to_xml /usr/local/nova/nova/virt/libvirt/config.py:66
2012-09-05 14:52:45 INFO nova.virt.libvirt.driver [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] attaching LXC block device
2012-09-05 14:52:45 DEBUG nova.utils [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] Running cmd (subprocess): sudo nova-rootwrap /etc/nova/rootwrap.conf touch /usr/local/nova/instances/instance-0000000d/rootfs/dev/c from (pid=25370) execute /usr/local/nova/nova/utils.py:176
2012-09-05 14:52:45 DEBUG nova.utils [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] Result was 1 from (pid=25370) execute /usr/local/nova/nova/utils.py:191
2012-09-05 14:52:45 ERROR nova.compute.manager [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] [instance: d2e4af4b-2170-49b5-9430-7393211802f4] Failed to attach volume 7d853f5b-1c46-4bf2-b9fe-f8610aee2f3e at /dev/c
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] Traceback (most recent call last):
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/local/nova/nova/compute/manager.py", line 1930, in _attach_volume
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] mountpoint)
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/local/nova/nova/exception.py", line 117, in wrapped
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] temp_level, payload)
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] self.gen.next()
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/local/nova/nova/exception.py", line 92, in wrapped
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] return f(*args, **kw)
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/local/nova/nova/virt/libvirt/driver.py", line 609, in attach_volume
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] self._attach_lxc_volume(conf.to_xml(), virt_dom, instance_name)
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/local/nova/nova/exception.py", line 117, in wrapped
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] temp_level, payload)
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] self.gen.next()
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/local/nova/nova/exception.py", line 92, in wrapped
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] return f(*args, **kw)
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/local/nova/nova/virt/libvirt/driver.py", line 697, in _attach_lxc_volume
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] disk.bind(lxc_host_volume, lxc_container_target, instance_name)
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/local/nova/nova/virt/disk/api.py", line 156, in bind
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] utils.execute('touch', target, run_as_root=True)
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] File "/usr/local/nova/nova/utils.py", line 198, in execute
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] cmd=' '.join(cmd))
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] ProcessExecutionError: Unexpected error while running command.
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] Command: sudo nova-rootwrap /etc/nova/rootwrap.conf touch /usr/local/nova/instances/instance-0000000d/rootfs/dev/c
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] Exit code: 1
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] Stdout: ''
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4] Stderr: 'Traceback (most recent call last):\n File "/usr/bin/nova-rootwrap", line 5, in <module>\n pkg_resources.run_script(\'nova==2012.2\', \'nova-rootwrap\')\n File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 461, in run_script\n self.require(requires)[0].run_script(script_name, ns)\n File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1194, in run_script\n execfile(script_filename, namespace, namespace)\n File "/usr/lib/python2.6/site-packages/nova-2012.2-py2.6.egg/EGG-INFO/scripts/nova-rootwrap", line 80, in <module>\n env=filtermatch.get_environment(userargs))\n File "/usr/lib64/python2.6/subprocess.py", line 639, in __init__\n errread, errwrite)\n File "/usr/lib64/python2.6/subprocess.py", line 1220, in _execute_child\n raise child_exception\nOSError: [Errno 2] No such file or directory\n'
2012-09-05 14:52:45 TRACE nova.compute.manager [instance: d2e4af4b-2170-49b5-9430-7393211802f4]
2012-09-05 14:52:45 DEBUG nova.openstack.common.rpc.amqp [-] Making asynchronous call on volume.bespin102.east.isi.edu ... from (pid=25370) multicall /usr/local/nova/nova/openstack/common/rpc/amqp.py:351
2012-09-05 14:52:45 DEBUG nova.openstack.common.rpc.amqp [-] MSG_ID is 496e281938b0444fb0a471c2d795a8e5 from (pid=25370) multicall /usr/local/nova/nova/openstack/common/rpc/amqp.py:354
2012-09-05 14:52:45 DEBUG nova.utils [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] Got semaphore "compute_resources" for method "update_load_stats_for_instance"... from (pid=25370) inner /usr/local/nova/nova/utils.py:713
2012-09-05 14:52:45 ERROR nova.openstack.common.rpc.amqp [-] Exception during message handling
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/openstack/common/rpc/amqp.py", line 275, in _process_data
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp rval = self.proxy.dispatch(ctxt, version, method, **args)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/openstack/common/rpc/dispatcher.py", line 145, in dispatch
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/exception.py", line 117, in wrapped
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp temp_level, payload)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/exception.py", line 92, in wrapped
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp return f(*args, **kw)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 181, in decorated_function
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp pass
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 167, in decorated_function
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 202, in decorated_function
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp kwargs['instance']['uuid'], e, sys.exc_info())
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 196, in decorated_function
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 1904, in attach_volume
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp context, instance.get('uuid'), mountpoint)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 1900, in attach_volume
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp mountpoint, instance)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 1939, in _attach_volume
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp connector)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 1930, in _attach_volume
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp mountpoint)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/exception.py", line 117, in wrapped
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp temp_level, payload)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/exception.py", line 92, in wrapped
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp return f(*args, **kw)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/virt/libvirt/driver.py", line 609, in attach_volume
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp self._attach_lxc_volume(conf.to_xml(), virt_dom, instance_name)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/exception.py", line 117, in wrapped
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp temp_level, payload)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/exception.py", line 92, in wrapped
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp return f(*args, **kw)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/virt/libvirt/driver.py", line 697, in _attach_lxc_volume
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp disk.bind(lxc_host_volume, lxc_container_target, instance_name)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/virt/disk/api.py", line 156, in bind
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp utils.execute('touch', target, run_as_root=True)
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/utils.py", line 198, in execute
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp cmd=' '.join(cmd))
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp ProcessExecutionError: Unexpected error while running command.
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp Command: sudo nova-rootwrap /etc/nova/rootwrap.conf touch /usr/local/nova/instances/instance-0000000d/rootfs/dev/c
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp Exit code: 1
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp Stdout: ''
2012-09-05 14:52:45 TRACE nova.openstack.common.rpc.amqp Stderr: 'Traceback (most recent call last):\n File "/usr/bin/nova-rootwrap", line 5, in <module>\n pkg_resources.run_script(\'nova==2012.2\', \'nova-rootwrap\')\n File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 461, in run_script\n self.require(requires)[0].run_script(script_name, ns)\n File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1194, in run_script\n execfile(script_filename, namespace, namespace)\n File "/usr/lib/python2.6/site-packages/nova-2012.2-py2.6.egg/EGG-INFO/scripts/nova-rootwrap", line 80, in <module>\n env=filtermatch.get_environment(userargs))\n File "/usr/lib64/python2.6/subprocess.py", line 639, in __init__\n errread, errwrite)\n File "/usr/lib64/python2.6/subprocess.py", line 1220, in _execute_child\n raise child_exception\nOSError: [Errno 2] No such file or directory\n'

Tags: lxc
Chuck Short (zulcss)
tags: added: lxc
Changed in nova:
assignee: nobody → Chuck Short (zulcss)
Revision history for this message
David Kang (dkang) wrote :

It is not a bug.
The path of 'tee' in rootwrap configuration files was wrong.

Now everything works at the host side.
However, the disk is not still seen inside of the LXC instance.
(Is there something that i missed?)

For example:
// attach command
$ euca-attach-volume vol-00000013 -i i-0000000d -d /dev/vde

// compute node (host): it is properly mounted
$ mount
/dev/sdg on /usr/local/upstream-Sep-5/instances/instance-0000000d/rootfs/dev/e type none (rw,bind)

// inside LXC instance: there is no device 'e' or 'vde' under /dev.
$ ls -l /dev
total 0
lrwxrwxrwx. 1 root root 10 Sep 5 14:49 console -> /dev/pts/0
lrwxrwxrwx. 1 root root 13 Sep 5 14:49 fd -> /proc/self/fd
crw-rw-rw-. 1 root root 1, 7 Sep 5 14:49 full
crw-rw-rw-. 1 root root 1, 3 Sep 5 14:49 null
crw-rw-rw-. 1 root root 5, 2 Sep 6 13:15 ptmx
drwxr-xr-x. 2 root root 0 Sep 5 14:49 pts
crw-rw-rw-. 1 root root 1, 8 Sep 5 14:49 random
lrwxrwxrwx. 1 root root 15 Sep 5 14:49 stderr -> /proc/self/fd/2
lrwxrwxrwx. 1 root root 15 Sep 5 14:49 stdin -> /proc/self/fd/0
lrwxrwxrwx. 1 root root 15 Sep 5 14:49 stdout -> /proc/self/fd/1
lrwxrwxrwx. 1 root root 10 Sep 5 14:49 tty1 -> /dev/pts/0
crw-rw-rw-. 1 root root 1, 9 Sep 5 14:49 urandom
crw-rw-rw-. 1 root root 1, 5 Sep 5 14:49 zero

Revision history for this message
David Kang (dkang) wrote :

I believe volume-attachment to an LXC instance does not work.
(Please correct me if I'm wrong.)

 With a couple of additional commands, I can attach the volume to the LXC instance.
First, I can make the device inside of LXC instance manually. ("inside of LXC instance", I mean ssh into the LXC.)
Second, create the block device inside of the LXC instance using "mknod' command with the major, minor numbers.

However, the VM user cannot know the major, minor numbers of the volume.
So, it must be done by OpenStack nova-compute.
(But, there is no code for that now.)
I know it can be done using 'lxc-attach'.
But, if there is any better solution, please let me know.

Here are the additonal commands that I used to attach a volume to an LXC instance after running "euca-attach-volume..." command.

// host
// get the major, minor number from the host
$ ls -l /usr/local/upstream-Sep-5/instances/instance-0000000d/rootfs/dev/e
brw-rw----. 1 root disk 8, 96 Sep 6 13:06 /usr/local/upstream-Sep-5/instances/instance-0000000d/rootfs/dev/e

// LXC instance
// make the device inside of the LXC (ssh into the LXC instance)
$ /bin/mknod -m 666 /dev/vdc b 8 96
$ ls -l /dev/vdc
brw-rw-rw-. 1 root root 8, 96 Sep 6 15:08 /dev/vdc

$ fdisk -l /dev/vdc

Disk /dev/vdc: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/vdc doesn't contain a valid partition table

Revision history for this message
Thierry Carrez (ttx) wrote :

@David: so is that now just a dupe from bug 1009701 ? or a new bug ? I'd like to close this one as Invalid and have a single one tracking attach_volume failure in LXC if possible.

Changed in nova:
status: New → Incomplete
Revision history for this message
David Kang (dkang) wrote :

Daniel answered to the question on my previous comment.
It is copied and pasted below.
Now it is all clear that OpenStack does NOT support volume attachment/detachment to an LXC instance, yet.

---- Daniel's email ----

Well all that LXC hotplug code can really just be ripped out. Bind
mounting a device into the container's /dev as seen from the host
OS really cannot work. The container is running in a separate
filesystem namespace with a private /dev mount on tmpfs. So whatever
you do to the /path/to/container/filesystem/dev on the host will
never be visible to the container.

Once the kernel supports attaching to a container namespace using
/proc/self/ns/mount, then libvirt will officially support LXC hotplug,
at which point libvirt can take care of cgroups too.

Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/
|: http://libvirt.org -o- http://virt-manager.org
|: http://autobuild.org -o- http://search.cpan.org/~danberr/
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc

Revision history for this message
David Kang (dkang) wrote : Re: [Bug 1046495] Re: attach_volume fails for LXC ("No such file or directory")
Download full text (15.8 KiB)

 Yes, now it becomes a dupe from bug 1009701.
Yes, please close 1046495 as Invalid.

 Thanks,
 David

----------------------
Dr. Dong-In "David" Kang
Computer Scientist
USC/ISI

----- Original Message -----
> @David: so is that now just a dupe from bug 1009701 ? or a new bug ?
> I'd
> like to close this one as Invalid and have a single one tracking
> attach_volume failure in LXC if possible.
>
> ** Changed in: nova
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the
> bug
> report.
> https://bugs.launchpad.net/bugs/1046495
>
> Title:
> attach_volume fails for LXC ("No such file or directory")
>
> Status in OpenStack Compute (Nova):
> Incomplete
>
> Bug description:
> * nova:
>
> commit fb84ed7b32520b11d4a6273eb002b1f1abd2fbe8
> Merge: 4ccc770 5a470f8
> Author: Jenkins <email address hidden>
> Date: Wed Sep 5 18:13:34 2012 +0000
>
> Merge "fix issues with Nova security groups and Quantum"
>
> * Symptom:
>
> $ euca-attach-volume vol-0000000d -i i-0000000d -d /dev/vdc
>
> --> It fails to attach.
> The log file of nova-compute shows that it fails at the following
> command:
>
> Command: sudo nova-rootwrap /etc/nova/rootwrap.conf touch
> /usr/local/nova/instances/instance-0000000d/rootfs/dev/c
>
> It fails because "..../dev/c" does not exist.
>
> * /etc/nova/nova.conf has the following configurations:
> use_cow_images=True
> libvirt_type=lxc
>
>
> ---- log of nova-compute ---
> 2012-09-05 14:52:45 DEBUG nova.virt.libvirt.config
> [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] Generated XML
> <disk type="block" device="disk">
> <driver type="raw" cache="none"/>
> <source
> dev="/dev/disk/by-path/ip-10.99.50.2:3260-iscsi-iqn.2010-10.org.openstack:volume-7d853f5b-1c46-4bf2-b9fe-f8610aee2f3e-lun-1"/>
> <target bus="virtio" dev="c"/>
> <serial>7d853f5b-1c46-4bf2-b9fe-f8610aee2f3e</serial>
> </disk>
> from (pid=25370) to_xml /usr/local/nova/nova/virt/libvirt/config.py:66
> 2012-09-05 14:52:45 INFO nova.virt.libvirt.driver
> [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] attaching LXC
> block device
> 2012-09-05 14:52:45 DEBUG nova.utils
> [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] Running cmd
> (subprocess): sudo nova-rootwrap /etc/nova/rootwrap.conf touch
> /usr/local/nova/instances/instance-0000000d/rootfs/dev/c from
> (pid=25370) execute /usr/local/nova/nova/utils.py:176
> 2012-09-05 14:52:45 DEBUG nova.utils
> [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] Result was 1
> from (pid=25370) execute /usr/local/nova/nova/utils.py:191
> 2012-09-05 14:52:45 ERROR nova.compute.manager
> [req-d5284f10-a4b4-4fda-a8e4-b2600d9d6e9f admin admin] [instance:
> d2e4af4b-2170-49b5-9430-7393211802f4] Failed to attach volume
> 7d853f5b-1c46-4bf2-b9fe-f8610aee2f3e at /dev/c
> 2012-09-05 14:52:45 TRACE nova.compute.manager [instance:
> d2e4af4b-2170-49b5-9430-7393211802f4] Traceback (most recent call
> last):
> 2012-09-05 14:52:45 TRACE nova.compute.manager [instance:
> d2e4af4b-2170-49b5-9430-7393211802f4] File
> "/usr/local/nova/nova/compute/manager.py", line 1930, in
> _attach_volume
> 2012-09-05 14:52:45 TRACE nova.compute.manager [instance:
> d2e4af4b-2...

Chuck Short (zulcss)
Changed in nova:
status: Incomplete → In Progress
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.