<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Hi,
<div><br>
</div>
<div>I have a VM that I start up outside of OpenStack (as a short term solution, until we get it working inside a Nova VM), using KVM. It has scrips associated with the three interfaces that are created, to hook this VM into Neutron. One I/F is on br-ex (connected
to the “public" network for DevStack), another to br-int (connected to a management network that is created), and a third is connected to br-int (connected to the “private” network for DevStack). It’s understood these are hacks to get things going and can
be brittle. With DevStack, I have a vanilla localrc, so using ML2, without any ML2 settings specified.</div>
<div><br>
</div>
<div>Now, the first two scripts use internal Neutron client calls to create the port, and then plug the VIF. The third, uses Neutron to create the port, and then Nova to plug the VIF. I don’t know why - I inherited the scripts.</div>
<div><br>
</div>
<div>On one system, where Nova is based on commit b3e2e05 (10 days ago), this all works just peachy. Interfaces are hooked in and I can ping to my hearts content. On another system, that I just reimaged today, using the latest and greatest OpenStack projects,
the third script fails.</div>
<div><br>
</div>
<div>I talked to Nova folks, and the vic is now an object, instead of a plain dict, and therefore calls on the object fail (as the script just provides a dict). I started trying to convert the vif to an object, but in discussing with a co-worker, we thought
that we could too use Neutron calls for all of the setup of this third interface.</div>
<div><br>
</div>
<div>Well, I tried, and the port is created, but unlike the other system, the port is DOWN, and I cannot ping to or from it (the other ports still work fine, with this newer OpenStack repo). One difference is that the port is showing {"port_filter": true,
"ovs_hybrid_plug": true} for binding:vif_details, in the neutron port-show output. On the older system this is empty (so must be new changes in Neutron?)</div>
<div><br>
</div>
<div><br>
</div>
<div>Here is the Neutron based code (trimmed) to do the create and plugging:</div>
<div><br>
</div>
<div>
<div>import neutron.agent.linux.interface as vif_driver</div>
<div>from neutronclient.neutron import client as qclient</div>
<div><br>
</div>
<div>qc = qclient.Client('2.0', auth_url=KEYSTONE_URL, username=user, tenant_name=tenant, password=pw)</div>
<div><br>
</div>
<div>prefix, net_name = interface.split('__')</div>
<div>port_name = net_name + '_p'</div>
<div>try:</div>
<div> nw_id = qc.list_networks(name=net_name)['networks'][0]['id']</div>
<div>except qcexp.NeutronClientException as e:</div>
<div> …</div>
<div><br>
</div>
<div>p_spec = {'port': {'admin_state_up': True,</div>
<div> 'name': port_name,</div>
<div> 'network_id': nw_id,</div>
<div> 'mac_address': mac_addr,</div>
<div> 'binding:host_id': hostname,</div>
<div> 'device_id': vm_uuid,</div>
<div> 'device_owner': 'compute:None'}}</div>
<div><br>
</div>
<div>try:</div>
<div> port = qc.create_port(p_spec)</div>
<div>except qcexp.NeutronClientException as e:</div>
<div> ...</div>
<div><br>
</div>
<div>port_id = port['port']['id']</div>
<div>br_name = 'br-int'</div>
<div><br>
</div>
<div>conf = cfg.CONF</div>
<div>config.register_root_helper(conf)</div>
<div>conf.register_opts(vif_driver.OPTS)</div>
<div><br>
</div>
<div>driver = vif_driver.OVSInterfaceDriver(cfg.CONF)</div>
<div>driver.plug(nw_id, port_id, interface, mac_addr, br_name)</div>
</div>
<div><br>
</div>
<div>Finally, here are the questions (hope you stuck with the long message)…</div>
<div><br>
</div>
<div><b>Any idea why the neutron version is not working?</b> I know there were a bunch of recent changes.</div>
<div><b>Is there a way for me to turn off the ova_hybrid_plug and port_filter flags? Should I?</b></div>
<div><b>Should I go back to using Nova and build a VIF object?</b></div>
<div><b>If so, any reason why the Neutron version would not work?</b></div>
<div><b>Is there a way to do a similar thing, but via using Northbound APIs (so it isn’t as brittle)?</b></div>
<div><br>
</div>
<div>Thanks in advance!</div>
<div><br>
</div>
<div>
<div apple-content-edited="true">
<div>
<div>PCM (Paul Michali)</div>
<div><br>
</div>
<div>MAIL …..…. <a href="mailto:pcm@cisco.com">pcm@cisco.com</a></div>
<div>IRC ……..… pcm_ (<a href="http://irc.freenode.com">irc.freenode.com</a>)</div>
<div>TW ………... @pmichali</div>
<div>GPG Key … 4525ECC253E31A83</div>
<div>Fingerprint .. 307A 96BB 1A4C D2C7 931D 8D2D 4525 ECC2 53E3 1A83</div>
</div>
<div><br>
</div>
<br class="Apple-interchange-newline">
</div>
<br>
</div>
</body>
</html>