Detaching encryptors from volumes that are still attached to domains can result in failure

Bug #1642628 reported by Lee Yarwood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Lee Yarwood

Bug Description

Description
===========
Detaching encryptors from volumes that are still attached to domains can result in failure.

Steps to reproduce
==================
- Attach an encrypted volume to an instance.
- Mount and use the volume within the instance.
- Attempt to detach the volume via Nova while the volume is in-use within the instance.

Expected result
===============
The volume is detached.

Actual result
=============
Nova first attempts to detach the encryptors from the volume that is still attached to the libvirt domain. As a result this can fail with `Device or resource busy` as I/O is still in-flight between the instance and volume.

Environment
===========
1. master, stable/newton.

2. Which hypervisor did you use?
   Libvirt + KVM

2. Which storage type did you use?
   LVM / iSCSI + LUKS

3. Which networking type did you use?
   N/A

Logs & Configs
==============

Failed to detach an encrypted volume
https://bugzilla.redhat.com/show_bug.cgi?id=1388417

Changed in nova:
assignee: nobody → Lee Yarwood (lyarwood)
status: New → In Progress
tags: added: volumes
melanie witt (melwitt)
tags: added: libvirt
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit d55c5136d0f7ece722db889a4375133e827411c0
Author: Lee Yarwood <email address hidden>
Date: Wed Nov 16 15:51:02 2016 +0000

    libvirt: Detach volumes from a domain before detaching any encryptors

    I983f80822a5 introduced retry logic around the detaching of volumes from
    a libvirt domain. However it also reordered the surrounding code so that
    we attempt to detach any encryptors from a volume first while the volume
    is still attached to the domain. This can lead to `Device or resource
    busy` errors if the volume is still being used by the instance when we
    attempt to detach the encryptors.

    Closes-bug: #1642628
    Change-Id: Ia0f8e725ec8a0fbc44bd4592b021dea978cf4e4f

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

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/412201

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

Reviewed: https://review.openstack.org/412201
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7a7bbb6da25462737e755d6aa2845e395d60570b
Submitter: Jenkins
Branch: stable/newton

commit 7a7bbb6da25462737e755d6aa2845e395d60570b
Author: Lee Yarwood <email address hidden>
Date: Wed Nov 16 15:51:02 2016 +0000

    libvirt: Detach volumes from a domain before detaching any encryptors

    I983f80822a5 introduced retry logic around the detaching of volumes from
    a libvirt domain. However it also reordered the surrounding code so that
    we attempt to detach any encryptors from a volume first while the volume
    is still attached to the domain. This can lead to `Device or resource
    busy` errors if the volume is still being used by the instance when we
    attempt to detach the encryptors.

    Closes-bug: #1642628
    Change-Id: Ia0f8e725ec8a0fbc44bd4592b021dea978cf4e4f
    (cherry picked from commit d55c5136d0f7ece722db889a4375133e827411c0)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 15.0.0.0b3

This issue was fixed in the openstack/nova 15.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 14.0.4

This issue was fixed in the openstack/nova 14.0.4 release.

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.