<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><font face="Calibri,sans-serif">Basically the issue is seen in the following three lines of nova compute log. For that port even though it received the vif plugging event 2 mins before it waits for it and blocks and times out</font></div>
<div><font face="Calibri,sans-serif">Is there a race condition in the code that basically gets the events to wait for and the one where it registers for this callback </font></div>
<div>Any comments?</div>
<div><font face="Calibri,sans-serif"><br>
</font></div>
<div><font face="Calibri,sans-serif">
<div>2016-10-09 07:35:24.869 6 DEBUG nova.compute.manager [req-afbc9c31-757a-478e-af8f-a4937e787a57 53a2bd71435c43e3953c37ffb9b38e21 56b04dfbb802430face997791412a62a - - -] [instance: 59b4f72b-5d1d-41ee-bc57-c57a8204383a] Received event
<b>network-vif-plugged-4cf63ac9-3848-4c0e-a666-25dca7fadda0 external_instance_event
</b>/usr/lib/python2.7/site-packages/nova/compute/manager.py:6509</div>
<div>2016-10-09 07:35:24.871 6 DEBUG nova.compute.manager [req-afbc9c31-757a-478e-af8f-a4937e787a57 53a2bd71435c43e3953c37ffb9b38e21 56b04dfbb802430face997791412a62a - - -] [instance: 59b4f72b-5d1d-41ee-bc57-c57a8204383a] No waiting events found dispatching
 network-vif-plugged-4cf63ac9-3848-4c0e-a666-25dca7fadda0 pop_instance_event /usr/lib/python2.7/site-packages/nova/compute/manager.py:545</div>
<div>2016-10-09 07:37:36.668 6 DEBUG nova.compute.manager [req-31f88ed2-ab3d-4b1d-a75b-b4e7b80b9202 28450924ed064558948f98eaec39fe6e 54e6da5850104d3682ef3500f3eb7a57 - - -] [instance: 59b4f72b-5d1d-41ee-bc57-c57a8204383a] Preparing to wait for external event
<b>network-vif-plugged-4cf63ac9-3848-4c0e-a666-25dca7fadda0 prepare_for_instance_event</b> /usr/lib/python2.7/site-packages/nova/compute/manager.py:507</div>
</font></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>Ajay Kalambur <<a href="mailto:akalambu@cisco.com">akalambu@cisco.com</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>Tuesday, October 4, 2016 at 10:56 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>[openstack-dev] [nova] VIF plugin issue _get_neutron_events<br>
</div>
<div><br>
</div>
<span style="mso-bookmark:_MailOriginalBody">
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>
<div>Hi</div>
<div>When booting Vms with 3 interfaces and when port binding happens quick enough I sometimes see that the first VM booted on a compute node gets stuck waiting for VIF plugging event but looking at the neutron logs the notification is sent and also nova responded
 with a 200 OK.</div>
<div><br>
</div>
<div>When looking at the code in nova/virt/libvirt/driver.py we see in spawn() there is a call to _create_domain_and_network which calls _get_neutron_events</div>
<div><br>
</div>
<div>So in what scenarios can this notification happen to soon or is there a race condition somewhere in this code wherby even though neutron sends the notification and nova responds the code here blocks for 300 seconds since it missed the event. </div>
<div><br>
</div>
<div>Any clues on what maybe going on here. Its almost like the neutron notification happened too quickly while nova code was busy performing create_image</div>
<div><br>
</div>
<div>This happens only with the first VM on a compute node </div>
<div><br>
</div>
<div>Any ideas on how to fix this</div>
<div><br>
</div>
<div>Ajay</div>
<div><br>
</div>
<div>
<div id=""></div>
</div>
</div>
</div>
</div>
</div>
</span></span>
</body>
</html>