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

Bug #1379212 reported by Rui Chen on 2014-10-09
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Rui Chen
Juno
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) on 2014-10-09
Changed in nova:
assignee: nobody → Rui Chen (kiwik-chenrui)

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

Changed in nova:
status: New → In Progress
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) on 2015-01-26
tags: added: compute
Changed in nova:
importance: Undecided → Low

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) on 2015-02-05
Changed in nova:
milestone: none → kilo-2
status: Fix Committed → Fix Released
Matt Riedemann (mriedem) on 2015-04-24
tags: added: volumes
Thierry Carrez (ttx) on 2015-04-30
Changed in nova:
milestone: kilo-2 → 2015.1.0
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) on 2015-11-06
Changed in nova:
importance: Low → Medium

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  Edit
Everyone can see this information.

Other bug subscribers