Comment 2 for bug 1633236

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

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

commit 63b2c8962697280f37fa888f1ab1d255757d1154
Author: melanie witt <email address hidden>
Date: Wed Oct 12 07:37:41 2016 +0000

    Raise DeviceNotFound detaching volume from persistent domain

    Currently, a volume detach at the libvirt driver level happens in two
    steps:

      1. Detach from persistent domain (affect instance upon next reboot)
      2. Detach from live domain (affect running instance)

    A detach from a live domain is a request from the host to the guest,
    which the guest can choose to ignore. For example, if the guest
    has a file open on the volume by some process, it might ignore the
    request to detach that volume because the file is in use.

    If this scenario occurs, when a user tries a later request to detach
    the volume, it will fail with this error when the attempt to detach
    from the persistent domain is made:

      libvirtError: invalid argument: no target device <device>

    because the volume was detached from the persistent domain the first
    time. Because of this, the volume can only be detached by rebooting
    the instance.

    This handles the VIR_ERR_INVALID_ARG
    "invalid argument: no target device" error [1] from libvirt for the
    detach from persistent domain and raises DeviceNotFound. The libvirt
    driver handles DeviceNotFound for volume detach.

    Note: Our code is already handling the VIR_ERR_OPERATION_FAILED
    "operation failed: disk vdb not found" error [2] for the case of the
    detach from live domain.

    Closes-Bug: #1633236

    [1] https://github.com/libvirt/libvirt/blob/f9d57f2/src/qemu/qemu_driver.c#L8055-L8059
    [2] https://github.com/libvirt/libvirt/blob/f81b33b/src/qemu/qemu_hotplug.c#L2859-L2863

    Change-Id: I09230fc47b0950aa5a3db839a070613c9c817576