Lack of volume status checks when detaching volume in rebuild.

Bug #1489304 reported by Zhenyu Zheng
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
sunhao
Stein
Fix Released
Undecided
Unassigned
Train
Fix Released
Undecided
Unassigned
Ussuri
Fix Released
Undecided
Unassigned

Bug Description

Currently, when rebuilding an instance with volume attached, the Nova compute manager will directly call _detach_volume() which will skip the checks of volume status (volume_api.check_detach) and setting the volume to 'detaching' (volume_api.begin_detaching) at Cinder side. This is different with the normal volume detach process.

Besides, when rebuilding, we should only allow detaching the volume with in-use status, volume in status such as 'retyping' should not allowed.

Changed in nova:
assignee: nobody → Zhenyu Zheng (zhengzhenyu)
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/217567

Changed in nova:
status: New → In Progress
Changed in nova:
importance: Undecided → Medium
description: updated
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Michael Still (<email address hidden>) on branch: master
Review: https://review.openstack.org/217567
Reason: This patch has been sitting unchanged for more than 12 weeks. I am therefore going to abandon it to keep the nova review queue sane. Please feel free to restore the change if you're still working on it.

Revision history for this message
Maciej Szankin (mszankin) wrote :

This bug report has an assignee for a while now but there is no patch
for that. It looks like that the chance of getting a patch is low.
I'm going to remove the assignee to signal to others that they can take
over if they like.
If you want to work on this, please:
* add yourself as assignee AND
* set the status to "In Progress" AND
* provide a (WIP) patch within the next 2 weeks after that.
If you need assistance, reach out on the IRC channel #openstack-nova or
use the mailing list.

Changed in nova:
status: In Progress → New
assignee: Zhenyu Zheng (zhengzhenyu) → nobody
Changed in nova:
status: New → Confirmed
Ameed Ashour (ameeda)
Changed in nova:
assignee: nobody → Ameed Ashour (ameeda)
Ameed Ashour (ameeda)
Changed in nova:
assignee: Ameed Ashour (ameeda) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/734734

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

Reviewed: https://review.opendev.org/734734
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=10e9a9b9fc62a3cf72c3717e3621ed95d3cf5519
Submitter: Zuul
Branch: master

commit 10e9a9b9fc62a3cf72c3717e3621ed95d3cf5519
Author: sunhao <suha9102@163.com>
Date: Wed Jun 10 10:26:49 2020 +0800

    Add checks for volume status when rebuilding

    When rebuilding, we should only allow detaching
    the volume with 'in-use' status, volume in status
    such as 'retyping' should not allowed.

    Change-Id: I7f93cfd18f948134c9cb429dea55740d2cf97994
    Closes-Bug: #1489304

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/747122

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

Reviewed: https://review.opendev.org/747122
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=bcbeae2c605f4ab4ad805dddccac802928a180b6
Submitter: Zuul
Branch: stable/ussuri

commit bcbeae2c605f4ab4ad805dddccac802928a180b6
Author: sunhao <suha9102@163.com>
Date: Wed Jun 10 10:26:49 2020 +0800

    Add checks for volume status when rebuilding

    When rebuilding, we should only allow detaching
    the volume with 'in-use' status, volume in status
    such as 'retyping' should not allowed.

    Change-Id: I7f93cfd18f948134c9cb429dea55740d2cf97994
    Closes-Bug: #1489304
    (cherry picked from commit 10e9a9b9fc62a3cf72c3717e3621ed95d3cf5519)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/748558

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

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/748559

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

Reviewed: https://review.opendev.org/748558
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=683005df39cbb825ff0702cd91773ad16d7b3998
Submitter: Zuul
Branch: stable/train

commit 683005df39cbb825ff0702cd91773ad16d7b3998
Author: sunhao <suha9102@163.com>
Date: Wed Jun 10 10:26:49 2020 +0800

    Add checks for volume status when rebuilding

    When rebuilding, we should only allow detaching
    the volume with 'in-use' status, volume in status
    such as 'retyping' should not allowed.

    Conflicts:
        nova/api/openstack/compute/servers.py
        nova/compute/api.py
        nova/tests/unit/api/openstack/compute/test_server_actions.py
    Modified:
        nova/tests/unit/compute/test_compute_api.py

    NOTE(elod.illes):
    * conflicts in servers.py and test_server_actions.py are due to bug
      fixing patch I25eff0271c856a8d3e83867b448e1dec6f6732ab is not
      backported to stable/train
    * api.py conflict is due to Ic2ad1468d31b7707b7f8f2b845a9cf47d9d076d5
      is part of a feature introduced in Ussuri
    * modification of test_compute_api.py is also required due to patch
      I25eff0271c856a8d3e83867b448e1dec6f6732ab is not backported and
      another patch, Ide8eb9e09d22f20165474d499ef0524aefc67854, that
      cannot be backported to stable/train

    Change-Id: I7f93cfd18f948134c9cb429dea55740d2cf97994
    Closes-Bug: #1489304
    (cherry picked from commit 10e9a9b9fc62a3cf72c3717e3621ed95d3cf5519)
    (cherry picked from commit bcbeae2c605f4ab4ad805dddccac802928a180b6)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/stein)

Reviewed: https://review.opendev.org/748559
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=4130ef8af0331bd1ec363b85c3c5cd827e6ea6c7
Submitter: Zuul
Branch: stable/stein

commit 4130ef8af0331bd1ec363b85c3c5cd827e6ea6c7
Author: sunhao <suha9102@163.com>
Date: Wed Jun 10 10:26:49 2020 +0800

    Add checks for volume status when rebuilding

    When rebuilding, we should only allow detaching
    the volume with 'in-use' status, volume in status
    such as 'retyping' should not allowed.

    Change-Id: I7f93cfd18f948134c9cb429dea55740d2cf97994
    Closes-Bug: #1489304
    (cherry picked from commit 10e9a9b9fc62a3cf72c3717e3621ed95d3cf5519)
    (cherry picked from commit bcbeae2c605f4ab4ad805dddccac802928a180b6)
    (cherry picked from commit 683005df39cbb825ff0702cd91773ad16d7b3998)

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