Bug 1474837

Summary: Raise DeviceNotFound detaching volume from persistent domain
Product: Red Hat OpenStack Reporter: Federico Iezzi <fiezzi>
Component: openstack-novaAssignee: Eoghan Glynn <eglynn>
Status: CLOSED DUPLICATE QA Contact: Joe H. Rahme <jhakimra>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.0 (Mitaka)CC: berrange, dasmith, eglynn, kchamart, mwitt, sbauza, sferdjao, sgordon, srevivo, vromanso
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-27 18:16:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Federico Iezzi 2017-07-25 13:29:33 UTC
Description of problem:
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.

Version-Release number of selected component (if applicable):
RH-OSP9 with latest available updates

How reproducible:
 - Create a VM and attach a volume
 - Format the volume and mount it
 - Create any sort of I/O and at the same time try to detach the volume 
Of course, the 3rd point is not a best practice but unfortunately, if you create a Heat Stack with a VM and an attachment procedure, Heat will first detach the volume and then delete the VM. In this situation, the Stack delete operation might fail because the guest refuses to detach the volume.

Actual results:
Sometimes the volume detach fails and a then it is impossible to detach the volume unless a hard reboot is done.

Expected results:
It's fine the guest refuses to detach the Volume but Nova should allow the user to retry the detach operation.

Additional info:
https://bugzilla.redhat.com/show_bug.cgi?id=1474102
https://review.openstack.org/#/c/425114/

Comment 1 melanie witt 2017-07-27 18:16:15 UTC

*** This bug has been marked as a duplicate of bug 1424656 ***

Comment 2 awaugama 2017-09-07 19:01:32 UTC
Dup -- QE will decide about automating the original