Hyper-V volume attach issue: wrong SCSI slot is selected

Bug #1329764 reported by Lucian Petrut
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Claudiu Belu
Icehouse
Fix Released
Low
Denis

Bug Description

When attaching volumes, the Hyper-V driver selects the slot on the SCSI controller by using the number of drives attached to that controller.

This leads to exceptions when detaching volumes having lower numbered slots and then attaching a new volume.

Take for example 2 volumes attached which will have 0 and 1 as controller addresses. If the first one gets detached, the next time we'll try to attach a volume the controller address 1 will be used (as it's the number of drives attached to the controller at that time) but that slot is actually uesd, so it will raise an exception.

Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Lucian Petrut (petrutlucian94) wrote :
Changed in nova:
assignee: nobody → Petrut Lucian (petrutlucian94)
Changed in nova:
assignee: Petrut Lucian (petrutlucian94) → Claudiu Belu (cbelu)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit a73e31022c9fef532cc2d66462d13f4ab2358565
Author: Lucian Petrut <email address hidden>
Date: Fri Jun 13 18:53:51 2014 +0300

    Fixes Hyper-V SCSI slot selection

    Currently, when attaching volumes, the Hyper-V driver selects the
    slot on the SCSI controller by using the number of drives
    attached to that controller.

    This leads to exceptions when detaching volumes having lower
    numbered slots and then attaching a new volume, as Hyper-V will
    then try to use an occupied slot.

    This patch fixes the issue by simply getting a list of used slots
    and getting a slot that it's not among those. It also checks
    for the slot number to be smaller than the maximum number of slots
    per SCSI controller.

    Fixes bug: #1329764

    Change-Id: Id0c09c4debc848004a78971670cc3caef2f77ce3

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → juno-2
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/111789

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/icehouse)

Reviewed: https://review.openstack.org/111789
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=e874ee231bc8a98c476731e043574a0c00e12a29
Submitter: Jenkins
Branch: stable/icehouse

commit e874ee231bc8a98c476731e043574a0c00e12a29
Author: Denis Denes <email address hidden>
Date: Fri Jun 13 18:53:51 2014 +0300

    Fixes Hyper-V SCSI slot selection

    Currently, when attaching volumes, the Hyper-V driver selects the
    slot on the SCSI controller by using the number of drives
    attached to that controller.

    This leads to exceptions when detaching volumes having lower
    numbered slots and then attaching a new volume, as Hyper-V will
    then try to use an occupied slot.

    This patch fixes the issue by simply getting a list of used slots
    and getting a slot that it's not among those. It also checks
    for the slot number to be smaller than the maximum number of slots
    per SCSI controller.

    Fixes bug: #1329764

    (cherry-picked from commit a73e31022c9fef532cc2d66462d13f4ab2358565)

    Change-Id: Id0c09c4debc848004a78971670cc3caef2f77ce3

tags: added: in-stable-icehouse
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-2 → 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.