[openstack-dev] [openstack][nova] Port unbound from active VM

Ajay Kalambur (akalambu) akalambu at cisco.com
Tue Oct 11 01:31:11 UTC 2016


Hi
There seems to be a corner case bug in nova code. Steps to reproduce it are

  1.  Create a neutron port
  2.  Create a VM and launch instance with this port
  3.  Shutdown nova compute and network agent on compute node
  4.  Unbind port from VM and delete the VM (offline delete)
  5.  Now create a VM with same port but on a different VM
  6.  Bring up nova compute on old node

It basically runs the reap for deleted instances and cleanes up VM from libvirt. In the process it unbinds the pre-existing ports and ends up unbinding the port from an active VM
Reason nova simply sends a blind port-update with binding_host: “” even if that port is bound to a different instance


So following fix seemed to help any suggestions on a better fix

In nova/network/neutronv2/api.py. So basically when neutron sees no ports for this instance don’t attempt an unbind
In this case
data = neutron.list_ports(**search_opts)
Call in deallocate_for_instance returns empty ports




      # Reset device_id and device_owner for the ports that are skipped

        if data.get('ports', []):

            self._unbind_ports(context, ports_to_skip, neutron)

        else:

            LOG.debug("Neutron sees a different view of this port hence skipping unbind”)



Ajay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20161011/4a0dc2cb/attachment.html>


More information about the OpenStack-dev mailing list