<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
Hi </div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
I logged the following bug</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<a href="https://bugs.launchpad.net/nova/+bug/1634269">https://bugs.launchpad.net/nova/+bug/1634269</a></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div>I sent out review below please let me know if I am on right track</div>
<div><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<a href="https://review.openstack.org/#/c/387687/">https://review.openstack.org/#/c/387687/</a></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<u>Ajay</u></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<u><br>
</u></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<span id="OLK_SRC_BODY_SECTION" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Kevin Benton <<a href="mailto:kevin@benton.pub">kevin@benton.pub</a>><br>
<span style="font-weight:bold">Reply-To: </span>"OpenStack Development Mailing List (not for usage questions)" <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Date: </span>Friday, October 14, 2016 at 1:23 AM<br>
<span style="font-weight:bold">To: </span>"OpenStack Development Mailing List (not for usage questions)" <<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [openstack-dev] [openstack][nova] Port unbound from active VM<br>
</div>
<div><br>
</div>
<span style="mso-bookmark:_MailOriginalBody">
<div>
<div>
<div dir="ltr">I suggest filing a bug against nova for this. </div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Oct 13, 2016 at 9:44 AM, Ajay Kalambur (akalambu)
<span dir="ltr"><<a href="mailto:akalambu@cisco.com" target="_blank">akalambu@cisco.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>
<div>Any comments/input on this?</div>
<div>Ajay</div>
<div><br>
</div>
<div>
<div id="m_6734010782733070244MAC_OUTLOOK_SIGNATURE"></div>
</div>
</div>
</div>
<div><br>
</div>
<span id="m_6734010782733070244OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri;font-size:12pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>Ajay Kalambur <<a href="mailto:akalambu@cisco.com" target="_blank">akalambu@cisco.com</a>><br>
<span style="font-weight:bold">Date: </span>Monday, October 10, 2016 at 6:31 PM<br>
<span style="font-weight:bold">To: </span>"OpenStack Development Mailing List (not for usage questions)" <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.<wbr>openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span>[openstack][nova] Port unbound from active VM<br>
</div>
<div><br>
</div>
<span>
<div>
<div style="word-wrap:break-word"><span class="">
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">Hi</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">There seems to be a corner case bug in nova code. Steps to reproduce it are</div>
</span>
<ol style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
<span class="">
<li>Create a neutron port  </li><li>Create a VM and launch instance with this port</li><li>Shutdown nova compute and network agent on compute node</li><li>Unbind port from VM and delete the VM (offline delete) </li><li>Now create a VM with same port but on a different compute node<span class=""></span></li><li>Bring up nova compute on old node</span></li></ol>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">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 on
 a different compute node</div>
<span class="">
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">Reason nova simply sends a blind port-update with binding_host: “” even if that port is bound to a different instance</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">So following fix seemed to help any suggestions on a better fix</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><br>
</div>
<div><font face="Calibri,sans-serif">In </font><font face="Menlo"><span style="font-size:12px">nova/network/neutronv2/api.<wbr>py. So basically when neutron sees no ports for this instance don’t attempt an unbind</span></font></div>
<div><font face="Menlo"><span style="font-size:12px">In this case </span></font><span style="font-family:Menlo;font-size:12px">        </span></div>
<div><span style="font-family:Menlo;font-size:12px">data = neutron.list_ports(**search_<wbr>opts)</span></div>
<div><font face="Menlo"><span style="font-size:12px">C</span></font><span style="font-family:Menlo;font-size:12px">all in </span><span style="font-family:Menlo;font-size:12px">deallocate_for_instance returns empty ports</span></div>
<div><span style="font-family:Menlo;font-size:12px"><br>
</span></div>
<div><font face="Menlo"><span style="font-size:12px"><br>
</span></font></div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px"><span style="font-family:Menlo;font-size:12px"><br>
</span></div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">      # Reset device_id and device_owner for the ports that are skipped</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">        if data.get('ports', []):</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">            self._unbind_ports(context, ports_to_skip, neutron)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">        else:</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">            LOG.debug("Neutron sees a different view of this port hence skipping unbind”)</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">Ajay</span></p>
<p style="margin:0px;font-size:12px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"><br>
</span></p>
</div>
<div style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">
<div id="m_6734010782733070244"></div>
</div>
</span></div>
</div>
</span></span></div>
<br>
______________________________<wbr>______________________________<wbr>______________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">
OpenStack-dev-request@lists.<wbr>openstack.org?subject:<wbr>unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/<wbr>cgi-bin/mailman/listinfo/<wbr>openstack-dev</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</span></span>
</body>
</html>