<div dir="ltr">Yes, I think this is the desired behavior. If someone deletes a network we check to see if there are any ports on the network. If there are ports on the network we raise. If there are no ports on the network we allow it to be deleted. Since you cannot have a subnet without a network we should delete that then too. I don't see any reason to complicate things by forcing the user to delete the subnets first. <div>
<br></div><div style>Aaron</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 2:04 PM, Edgar Magana <span dir="ltr"><<a href="mailto:emagana@plumgrid.com" target="_blank">emagana@plumgrid.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="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word"><div>Before filing a bug, do we really want this kind of functionality?</div>
<div>Is it "correct" to delete a network without really checking if the owner really wants to delete all subnets associated with it?</div><div><br></div><div>Edgar</div><div><br></div><span><div style="border-right:medium none;padding-right:0in;padding-left:0in;padding-top:3pt;text-align:left;font-size:11pt;border-bottom:medium none;font-family:Calibri;border-top:#b5c4df 1pt solid;padding-bottom:0in;border-left:medium none">
<div class="im"><span style="font-weight:bold">From: </span> Aaron Rosen <<a href="mailto:arosen@nicira.com" target="_blank">arosen@nicira.com</a>><br><span style="font-weight:bold">Reply-To: </span> OpenStack List <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
</div><span style="font-weight:bold">Date: </span> Tuesday, July 2, 2013 1:55 PM<div><div class="h5"><br><span style="font-weight:bold">To: </span> OpenStack List <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span> Re: [openstack-dev] [Neutron] does delete_network call delete_subnet automatically?<br></div></div></div><div><div class="h5"><div><br></div><div dir="ltr">Good point. We should be calling delete_subnet() from delete_network() in the db_base class rather than deleting it directly from the database.<div>
<br></div><div>Aaron</div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, Jul 2, 2013 at 1:39 PM, Edgar Magana <span dir="ltr"><<a href="mailto:emagana@plumgrid.com" target="_blank">emagana@plumgrid.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><div style="font-size:14px;font-family:Calibri,sans-serif">
If the plugin performs operations when the subnet is created, how is possible to roll-back those operation if the plugin implementation of <i>delete_subnet()</i> is never called?</div><div><font face="Calibri,sans-serif">I don’t think we should let <i>delete_</i></font><span style="font-size:14px;font-style:italic;font-family:Calibri,sans-serif">network </span><span style="font-size:14px;font-family:Calibri,sans-serif">in</span><span style="font-size:14px;font-style:italic;font-family:Calibri,sans-serif"> </span><font face="Calibri,sans-serif"><i>debasepluginv2.py</i> delete all subnets, we could just ask the tenant user to delete all subnets first, is there any specific reason why we automatically delete all subnets?</font></div>
<div><font face="Calibri,sans-serif"><br></font></div><div><font face="Calibri,sans-serif">Edgar</font></div><div style="font-size:14px;font-family:Calibri,sans-serif"><br></div></div></div><span style="font-size:14px;font-family:Calibri,sans-serif"><div>
<div class="h5"><div style="border-right:medium none;padding-right:0in;padding-left:0in;padding-top:3pt;text-align:left;font-size:11pt;border-bottom:medium none;font-family:Calibri;border-top:#b5c4df 1pt solid;padding-bottom:0in;border-left:medium none">
<span style="font-weight:bold">From: </span> Aaron Rosen <<a href="mailto:arosen@nicira.com" target="_blank">arosen@nicira.com</a>><br><span style="font-weight:bold">Reply-To: </span> OpenStack List <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Date: </span> Tuesday, July 2, 2013 12:40 PM<br><span style="font-weight:bold">To: </span> OpenStack List <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>><br>
<span style="font-weight:bold">Subject: </span> Re: [openstack-dev] [Neutron] does delete_network call delete_subnet automatically?<br></div></div></div><div><div><div><div class="h5"><div><br></div><div dir="ltr"><div>delete_network() in the db_base class handles deleting the subnets associated with the networks. </div>
<div><br></div><a href="https://github.com/openstack/quantum/blob/master/quantum/db/db_base_plugin_v2.py#L1033" target="_blank">https://github.com/openstack/quantum/blob/master/quantum/db/db_base_plugin_v2.py#L1033</a><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 2, 2013 at 12:31 PM, Edgar Magana <span dir="ltr"><<a href="mailto:emagana@plumgrid.com" target="_blank">emagana@plumgrid.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="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word"><div>Folks,</div><div><br></div><div>When I create a network and a subnet associated to that network, I am able to delete the network without deleting the subnet first from both CLI and Horizon.</div>
<div>The difference is that in Horizon, both APIs are called: delete_subnet() and delete_network()</div><div>When I tried by CLI, only delete_network is called as you can see in these logs:</div><div><div><br></div><div>2013-07-02 12:26:57    DEBUG [quantum.policy] loading policy file at /etc/quantum/policy.json</div>
<div>2013-07-02 12:26:57    DEBUG [quantum.plugins.plumgrid.plumgrid_nos_plugin.plumgrid_plugin] QuantumPluginPLUMgrid Status: delete_network() called</div><div>2013-07-02 12:26:57    DEBUG [quantum.policy] loading policy file at /etc/quantum/policy.json</div>
<div>2013-07-02 12:26:57    DEBUG [quantum.plugins.plumgrid.plumgrid_nos_plugin.rest_connection] PLUMgrid_NOS_Server: 10.1.2.43 8080 DELETE</div><div>2013-07-02 12:26:57    DEBUG [quantum.plugins.plumgrid.plumgrid_nos_plugin.rest_connection] PLUMgrid_NOS_Server Sending Data: {'Content-type': 'application/json', 'Accept': 'application/json'}</div>
<div>2013-07-02 12:26:57    DEBUG [quantum.openstack.common.rpc.amqp] Sending network.delete.end on <a href="http://notifications.info" target="_blank">notifications.info</a></div><div>2013-07-02 12:26:57    DEBUG [quantum.openstack.common.rpc.amqp] UNIQUE_ID is ad8c5a233bd6403ea850cde73afb720a.</div>
<div>2013-07-02 12:26:57    DEBUG [quantum.openstack.common.rpc.amqp] Making asynchronous fanout cast...</div><div>2013-07-02 12:26:57    DEBUG [quantum.openstack.common.rpc.amqp] UNIQUE_ID is dcba5e2b55bb4cb89aab17f5797882e6.</div>
<div>2013-07-02 12:27:23    DEBUG [keystoneclient.middleware.auth_token] Authenticating user token</div><div>2013-07-02 12:27:23    DEBUG [keystoneclient.middleware.auth_token] Removing headers from request environment: X-Identity-Status,X-Domain-Id,X-Domain-Name,X-Project-Id,X-Project-Name,X-Project-Domain-Id,X-Project-Domain-Name,X-User-Id,X-User-Name,X-User-Domain-Id,X-User-Domain-Name,X-Roles,X-Service-Catalog,X-User,X-Tenant-Id,X-Tenant-Name,X-Tenant,X-Role</div>
<div>2013-07-02 12:27:23    DEBUG [keystoneclient.middleware.auth_token] Storing dd0bd438481c2d010d1abc5903fa11da token in memcache</div><div>2013-07-02 12:27:23    DEBUG [routes.middleware] No route matched for GET /subnets.json</div>
<div>2013-07-02 12:27:23    DEBUG [routes.middleware] Matched GET /subnets.json</div><div>2013-07-02 12:27:23    DEBUG [routes.middleware] Route path: '/subnets{.format}', defaults: {'action': u'index', 'controller': <wsgify at 37764240 wrapping <function resource at 0x24745f0>>}</div>
<div>2013-07-02 12:27:23    DEBUG [routes.middleware] Match dict: {'action': u'index', 'controller': <wsgify at 3776424</div></div><div><br></div><div>However, the subnet is not in the DB but the delete_subnet API is never called, can somebody explain what is happening here?</div>
<div>BTW. This is Grizzly release</div><div><br></div><div>Thanks,</div><div><br></div><div>Edgar</div></div><br>_______________________________________________<br>
OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div></div></div>
_______________________________________________
OpenStack-dev mailing list
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></div>
</div></span></div><div class="im"><br>_______________________________________________<br>
OpenStack-dev mailing list<br><a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></div></blockquote></div><br></div><div class="im">
_______________________________________________
OpenStack-dev mailing list
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</div></span></div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>