attach_volume fails for LXC due to wrong root_device_name and path

Bug #1046020 reported by David Kang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Vish Ishaya

Bug Description

 I'm trying to run the following command:
$ euca-attach-volume vol-00000007 -i i-0000000b -d /dev/vdc

It fails and the nova-compute log is copied and pasted below.
The error message is :
  "InvalidDevicePath: The supplied device path (/dev/a) is invalid."
The device name given is "/dev/vdc", but it looks like that get_device_name_for_instance()
changes it to '/dev/a'.
And it ends up the error of "InvalidDevicePath".

I pulled the nova from github on August 29th.
And the followings are configured in /etc/nova/nova.conf file.
  use_cow_images=True
  libvirt_type=lxc

--------

Vish's reply

This looks like a recent bug. Lxc may not be setting root_device_path in the block device mapping table. It is now using root_device_path to set the path for the volumes. We may need to supply a fallback if it isn't set.

Tags: lxc
Revision history for this message
David Kang (dkang) wrote :
Download full text (6.4 KiB)

------------- log of nova-compute ---------------

2012-09-04 13:37:46 DEBUG nova.utils [req-79250a0b-6c11-4afc-a0a4-75736d3853c5 admin admin] Got semaphore "f3fb4350-a72e-404f-a21f-10f333fe67e8" for method "do_reserve"... from (pid=13108) inner /usr/local/nova/nova/utils.py:712
2012-09-04 13:37:46 DEBUG nova.utils [req-79250a0b-6c11-4afc-a0a4-75736d3853c5 admin admin] Attempting to grab semaphore "compute_resources" for method "update_load_stats_for_instance"... from (pid=13108) inner /usr/local/nova/nova/utils.py:708
2012-09-04 13:37:46 DEBUG nova.utils [req-79250a0b-6c11-4afc-a0a4-75736d3853c5 admin admin] Got semaphore "compute_resources" for method "update_load_stats_for_instance"... from (pid=13108) inner /usr/local/nova/nova/utils.py:712
2012-09-04 13:37:46 ERROR nova.openstack.common.rpc.amqp [-] Exception during message handling
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp Traceback (most recent call last):
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/openstack/common/rpc/amqp.py", line 275, in _process_data
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp rval = self.proxy.dispatch(ctxt, version, method, **args)
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/openstack/common/rpc/dispatcher.py", line 145, in dispatch
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp return getattr(proxyobj, method)(ctxt, **kwargs)
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/exception.py", line 117, in wrapped
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp temp_level, payload)
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/exception.py", line 92, in wrapped
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp return f(*args, **kw)
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 211, in decorated_function
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp pass
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 204, in decorated_function
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp return function(self, context, *args, **kwargs)
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/local/nova/nova/compute/manager.py", line 237, in decorated_function
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp instance_uuid, e, sys.exc_info())
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp File "/usr/lib64/python2.6/contextlib.py", line 23, in __exit__
2012-09-04 13:37:46 TRACE nova.openstack.common.rpc.amqp self.gen.next()
2012-09-04 13:37:46 TRACE nova.openstack.comm...

Read more...

Thierry Carrez (ttx)
tags: added: lxc
Changed in nova:
importance: Undecided → High
milestone: none → folsom-rc1
status: New → Confirmed
Changed in nova:
assignee: nobody → Vish Ishaya (vishvananda)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/12384

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/12384
Committed: http://github.com/openstack/nova/commit/07e0b779fda808211853242415087753ca186ac4
Submitter: Jenkins
Branch: master

commit 07e0b779fda808211853242415087753ca186ac4
Author: Vishvananda Ishaya <email address hidden>
Date: Tue Sep 4 15:25:35 2012 -0700

    Automatically convert device names

    In the past, users have been able to specify xvda or xvdb and it
    has worked. We are now validating device names against the expected
    name from the backend, and this causes confusion, especially for lxc
    which expecting device names to be /dev/a /dev/b /dev/c etc.

    This patch addresses the issue by automatically converting between
    different formats. The proper format for the backend will be returned
    by the api. Includes tests to verify that the conversion works and
    that the lxc values work as expected.

    Fixes bug 1046020

    Change-Id: Iffa552ba05f89f70b6fb93043edf8882c8412215

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
David Kang (dkang) wrote :

Now the problem is gone. This bug is fixed. Thank you.

However, a volume cannot be attached to an LXC instance, yet.
I've reported another bug.

https://bugs.launchpad.net/nova/+bug/1046495/

Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
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.