<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@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:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
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-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Troy,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I’ve setup nova+quantum+mélange using devstack.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>devstack creates networks using tenant_id =”default” (This in itself looks incorrect, since it should be valid UUID for one of the tenant from keystone DB – but I can imagine that stack.sh can’t get UUID for demo or admin tenants easily)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>So I updated nova.networks, quantum.networks and mélange.ip_blocks tables manually and put tenant_id to use UUID of the “demo” tenant.<o:p></o:p></span></p><p class=MsoNormal><b><span style='color:#1F497D'>Question : What is the right way to create network entries for “demo” tenant, that are used by nova/quantum as well as mélange DB ?<o:p></o:p></span></b></p><p class=MsoNormal><span style='color:#1F497D'>(I tried “mélange ip-block create” for 10.0.0.0/24 but I got an error that that cidr is already being used (by tenant_id=”default”) – so I updated the DB manually. Also this would work only take care of mélange DB – what about nova and quantum DB ?)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Once I did these changes, my instances could not launch, they would get stuck in Networking/Error state – with “NetworkNotFound” error in the logs for network UUID which I know is valid for tenant “demo”<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Tracing this further, I came across the following code which tries to “get_allocated_ips” for “default” tenant, before user specified project_id<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>In my opinion, this is incorrect.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Once I switched the order i.e. try project_id before “default” everything started working.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Please comment whether the following code change makes sense (I’m not even sure, if I were to submit this code change – what would I write in the bug description – hence need comments from you)<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>diff --git a/nova/network/quantum/melange_ipam_lib.py b/nova/network/quantum/melange_ipam_lib.py<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>index c68d83c..ea39f60 100644<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>--- a/nova/network/quantum/melange_ipam_lib.py<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>+++ b/nova/network/quantum/melange_ipam_lib.py<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>@@ -152,7 +152,8 @@ class QuantumMelangeIPAMLib(object):<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>     def get_tenant_id_by_net_id(self, context, net_id, vif_id, project_id):<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>         ipam_tenant_id = None<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>-        tenant_ids = [FLAGS.quantum_default_tenant_id, project_id, None]<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>+        <span style='color:red'>#tenant_ids = [FLAGS.quantum_default_tenant_id, project_id, None]<o:p></o:p></span></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>+        <span style='color:#00B050'>tenant_ids = [project_id,FLAGS.quantum_default_tenant_id, None]</span><o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>         # This is confusing, if there are IPs for the given net, vif,<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>         # tenant trifecta we assume that is the tenant for that network<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>         for tid in tenant_ids:<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Regards,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>-Mandar<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'><o:p> </o:p></span></p></div></body></html>