<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Phil,<br>
<br>
Le 24/01/2014 14:13, Day, Phil a écrit :<br>
</div>
<blockquote
cite="mid:BD26CCD58723F74AA8E6BCB31052A1F006F901F0@G6W2490.americas.hpqcorp.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">HI
Sylvain,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">The
change only makes the user have to supply a network ID if
there is more than one private network available (and the
issue there is that otherwise the assignment order in the
Guest is random, which normally leads to all sorts of
routing problems).<o:p></o:p></span></p>
</div>
</blockquote>
<br>
I'm sorry, but the query also includes shared (so, public) networks
from the same tenant. See [1]. <br>
<br>
<blockquote
cite="mid:BD26CCD58723F74AA8E6BCB31052A1F006F901F0@G6W2490.americas.hpqcorp.net"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I’m
running a standard Devstack with Neuron (built from trunk a
couple of days ago), can see both a private and public
network, and can boot VMs without having to supply any
network info:<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span><br>
</p>
</div>
</blockquote>
<br>
Indeed, that does work because Devstack is smart enough for creating
the two networks with distinct tenant_ids. See [2] as a proof :-)<br>
If someone is building a private and a public network *on the same
tenant*, it will fail to boot. Apologies if I was unclear.<br>
<br>
So, the question is : what shall I do for changing this ? There are
2 options for me:<br>
1. Add an extra param to
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
_get_available_networks : shared=True and only return shared
networks if the param is set to True (so we keep compatibility with
all the calls)<br>
2. Parse the nets dict here [3] to expurge the shared networks when
len(nets) > 1. That's simple but potentially a performance issue,
as it's O(N).<br>
<br>
I would personnally vote for #1 and I'm ready to patch. By the way,
the test case needs also to be updated [4].<br>
<br>
-Sylvain<br>
<br>
<br>
[1]
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L127">https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L127</a><br>
[2] :
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a href="http://paste.openstack.org/show/61819/">http://paste.openstack.org/show/61819/</a><br>
[3] :
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L528">https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L528</a><br>
[4] :
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="https://github.com/openstack/nova/blob/master/nova/tests/network/test_neutronv2.py#L1028">https://github.com/openstack/nova/blob/master/nova/tests/network/test_neutronv2.py#L1028</a>
</body>
</html>