Cannot attach volumes to LXC instances

Bug #1330981 reported by Vladik Romanovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Vladik Romanovsky

Bug Description

Volumes cannot be attach to any LXC instances
since it's root device cannot be parsed properly.
This later causes a failure in device name generation in get_next_device_name(),
when attempting to generate a name for the attached volume.
The generated device name, will not be recognized by get_dev_prefix_for_disk_bus()
when trying to select a disk bus, nor libvirt will be able to attach the volume
with an unrecognized device name.

When creating a LXC instance, the /dev/nbd1 or /dev/loop0 devices will be saved as
instance root device in _create_domain()
Later, when attaching the volume, block_device.match_device will be called from compute_utils.get_next_device_name(),
The formed device will be named as /dev/na (for /dev/nbdX)
Which will not be recognized in blockinfo.get_dev_prefix_for_disk_bus()
Even if it will be recognized, libvirt wont be able to attach a volume named /dev/na

Tags: libvirt lxc
tags: added: lxc
tags: added: libvirt
Changed in nova:
assignee: nobody → Vladik Romanovsky (vladik-romanovsky)
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/104047

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

Reviewed: https://review.openstack.org/104047
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9283379849906f74047e47a679326e08e923fecc
Submitter: Jenkins
Branch: master

commit 9283379849906f74047e47a679326e08e923fecc
Author: Vladik Romanovsky <email address hidden>
Date: Fri Jun 27 08:19:39 2014 -0400

    libvirt: saving the lxc rootfs device in instance metadata

    Currently, nbd/loop device, to which lxc image has been
    connected, is being saved as instance root device, which causing
    the attached bug.
    Saving the device name in instance system metadata instead.

    Closes-Bug: #1330981
    Change-Id: I3a0533a89ea8af61349118a39b822f4af146cc04

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-3 → 2014.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.