If volume detach fails, it cannot be retried and the instance must be rebooted to detach
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
melanie witt | ||
Newton |
Fix Committed
|
Medium
|
Lee Yarwood |
Bug Description
There is a problem where if a volume detach fails at the libvirt driver level for some reason, the volume detach cannot be retried and the volume cannot be detached until the instance is rebooted.
Currently, a volume detach at the libvirt driver level happens in two steps:
1. Detach from the persistent domain (this will affect the instance upon next reboot)
2. Detach from the transient domain (this will affect the running instance)
A detach from a transient domain is a request from the host to the guest, to detach the volume. The guest can choose to ignore this request. 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 it is busy.
If this scenario occurs, when a user tries a later request to detach the volume, it will fail with the error:
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.
The behavior should be changed to detach from the transient domain first, retrying if necessary, and detach from the persistent domain only if the detach from the transient domain has succeeded. This way, if the guest volume is busy and it ignores the detach request, the detach can be tried again at a later time by the user.
Suggested steps to reproduce:
1. Boot an instance and attach a volume
2. Log in to the guest and open a file on that volume in a text editor
3. Try to detach the volume using 'nova volume-detach' (it should have failed)
4. Exit the text editor on the guest
5. Try to detach the volume using 'nova volume-detach' (should get the 'no target device' error)
tags: | added: volumes |
Changed in nova: | |
importance: | Undecided → Medium |
Fix proposed to branch: master /review. openstack. org/386257
Review: https:/