check the libvirt driver finally detach a device

Bug #1522400 reported by lvmxh
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Undecided
Unassigned

Bug Description

Now nova support detach a device dynamically, but it is not guaranteed to succeed.

What happens is that the hypervisor injects an ACPI request to unplug the device. The guest OS must co-operate by releasing the device, before the hypervisor will complete the action of physically removing it. So when require a guest OS that supports ACPI unplug of course, and if the guest is crashed or being malicious there is no guarantee the unplug will succeed. Libvirt will wait a short while for success, but nova must monitor for libvirt events to see if/when it finally completes. This delayed release has implications for when Nova can mark the PCI device as unused and available for other guests to assign.

here is the libvirt doc string about detachDeviceFlags.
 http://paste.openstack.org/show/480330/

 it says
 To check whether the device was successfully removed, either recheck domain
 configuration using virDomainGetXMLDesc() or add handler for
 VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED
 If so we can sync check by virDomainGetXMLDesc().
 Or async notification that the device is removed by an event handler.
 and this is the nova code about detach_interface.
 https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4940

Tags: libvirt
Revision history for this message
lvmxh (shaohef) wrote :

I also file a spec: https://review.openstack.org/#/c/251141/

But all agree to file a bug.

Changed in nova:
assignee: nobody → lvmxh (shaohef)
tags: added: libvirt
Revision history for this message
Matt Riedemann (mriedem) wrote :

We don't need a spec for this. Just code to register the event listener. There is a similar bug somewhere for this same issue.

Also note change https://review.openstack.org/#/c/227851/ which has made things a bit better, but we still don't have an event listener for the detach.

Changed in nova:
status: New → Confirmed
Revision history for this message
Maciej Szankin (mszankin) wrote :

lvmxh, do you still work on this bug? If so, please reassign yourself - I am removing you right now as there is no progress.

Changed in nova:
assignee: lvmxh (shaohef) → nobody
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.