Attaching volume to iso instance is failure because of duplicate device name 'hda'.

Bug #1379212 reported by Rui Chen
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Rui Chen
Juno
Fix Released
Undecided
Unassigned

Bug Description

I try to attach a volume to iso instance, return code of volume-attach api is 200 ok, but the volume can't be attached to instance in fact, there are some error messages in nova-compute.log like this 'libvirtError: Requested operation is not valid: target hda already exists'.

The root device of iso instance is hda, nova-compute should not assign hda to cinder volume again.

The following is reproduce steps:

1. boot instance from iso image.
2. create a cinder volume.
3. try to attach the volume to iso instance.

Attaching volume is failed, I can find libvirt error in nova-compute.log.

http://paste.openstack.org/show/105144/

Rui Chen (kiwik-chenrui)
Changed in nova:
assignee: nobody → Rui Chen (kiwik-chenrui)
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/127168

Changed in nova:
status: New → In Progress
Revision history for this message
Rui Chen (kiwik-chenrui) wrote :

Note: this patch only address the issue of duplicate device name 'hda', disk bus 'ide' cannot be hotplugged, so we should stop iso instance first when attaching volume.

Rui Chen (kiwik-chenrui)
tags: added: compute
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/127168
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2f0f67d17cfedef2da4b1215f8d9072172a0d04f
Submitter: Jenkins
Branch: master

commit 2f0f67d17cfedef2da4b1215f8d9072172a0d04f
Author: kiwik-chenrui <email address hidden>
Date: Thu Oct 9 16:21:34 2014 +0800

    libvirt: fix failure when attaching volume to iso instance

    Attaching volume to iso instance results in failure like
    this 'libvirtError: Requested operation is not valid: target
    hda already exists'. The root device of iso instance is hda,
    nova-compute should not assign hda to cinder volume again.

    Note: this patch only address the issue of duplicate device
    name 'hda', disk bus 'ide' cannot be hotplugged, so we should
    stop iso instance first when attaching volume.

    Change-Id: If9f848dc3a3788862d25692250746387c6b35286
    Closes-Bug: #1379212

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Matt Riedemann (mriedem)
tags: added: volumes
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-2 → 2015.1.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/221876

Revision history for this message
Hua Zhang (zhhuabj) wrote :

Hi Sylvain,
     We aren't able to attach cinder volumes to the instance if it's deployed by an image that requires hw_disk_bus=ide to be set in glance, so I think this should be in Juno as well, can we put it in a higher priority ? Hope to hear from you. thanks.

Matt Riedemann (mriedem)
Changed in nova:
importance: Low → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/juno)

Reviewed: https://review.openstack.org/221876
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=4b439b955890efa819434c23b3ffdaf64a27ac1f
Submitter: Jenkins
Branch: stable/juno

commit 4b439b955890efa819434c23b3ffdaf64a27ac1f
Author: kiwik-chenrui <email address hidden>
Date: Thu Oct 9 16:21:34 2014 +0800

    libvirt: fix failure when attaching volume to iso instance

    Attaching volume to iso instance results in failure like
    this 'libvirtError: Requested operation is not valid: target
    hda already exists'. The root device of iso instance is hda,
    nova-compute should not assign hda to cinder volume again.

    Note: this patch only address the issue of duplicate device
    name 'hda', disk bus 'ide' cannot be hotplugged, so we should
    stop iso instance first when attaching volume.

    Closes-Bug: #1379212
    (cherry picked from commit 2f0f67d17cfedef2da4b1215f8d9072172a0d04f)

    Conflicts:
     nova/tests/unit/compute/test_compute.py
     nova/tests/unit/test_block_device.py

    Change-Id: If9f848dc3a3788862d25692250746387c6b35286

tags: added: in-stable-juno
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.