bulk delete improvements

Bug #1495440 reported by ranjitray
34
This bug affects 4 people
Affects Status Importance Assigned to Milestone
neutron
Won't Fix
Wishlist
Unassigned
python-neutronclient
Fix Released
Wishlist
Unassigned

Bug Description

While trying to delete multiple firewall rule using CLI by passing firewall rule multiple times, it deletes only the first firewall Rule id

stack@hdp-001:~$ neutron
(neutron) firewall-rule-list
+--------------------------------------+-----------------+--------------------+-----------------------------+---------+
| id | name | firewall_policy_id | summary | enabled |
+--------------------------------------+-----------------+--------------------+-----------------------------+---------+
| 8c4ea5c6-a6e4-43ab-a503-0a2265119238 | test1491637 | | TCP, | True |
| | | | source: none(none), | |
| | | | dest: none(none), | |
| | | | allow | |
| b8c1c061-8f92-482d-94d3-678f42c7ccd7 | rayrafw2 | | ICMP, | True |
| | | | source: none(none), | |
| | | | dest: none(none), | |
| | | | allow | |
| ba35dde7-8b07-4ba1-8338-496962c83dbc | testrule1491637 | | UDP, | True |
| | | | source: 10.25.10.2/32(80), | |
| | | | dest: none(none), | |
| | | | deny | |
+--------------------------------------+-----------------+--------------------+-----------------------------+---------+
(neutron) firewall-rule-delete 8c4ea5c6-a6e4-43ab-a503-0a2265119238 b8c1c061-8f92-482d-94d3-678f42c7ccd7
Deleted firewall_rule: 8c4ea5c6-a6e4-43ab-a503-0a2265119238
(neutron) firewall-rule-list
+--------------------------------------+-----------------+--------------------+-----------------------------+---------+
| id | name | firewall_policy_id | summary | enabled |
+--------------------------------------+-----------------+--------------------+-----------------------------+---------+
| b8c1c061-8f92-482d-94d3-678f42c7ccd7 | rayrafw2 | | ICMP, | True |
| | | | source: none(none), | |
| | | | dest: none(none), | |
| | | | allow | |
| ba35dde7-8b07-4ba1-8338-496962c83dbc | testrule1491637 | | UDP, | True |
| | | | source: 10.25.10.2/32(80), | |
| | | | dest: none(none), | |
| | | | deny | |
+--------------------------------------+-----------------+--------------------+-----------------------------+---------+
(neutron)

It will be better if we can delete multiple firewall rule by passing multiple firewall rule id

Revision history for this message
Hong Hui Xiao (xiaohhui) wrote :

I think the issue is not only in deleting firewall rule. Not like nova delete, Neutron client can't accept multiple instance to delete.

Changed in neutron:
assignee: nobody → Aditi Rajagopal (aditirajagopal)
Revision history for this message
Aditi Rajagopal (aditirajagopal) wrote :

I'm guessing this request will be rejected. Deleting multiple items with a single CLI command is not supported in any of the OpenStack CLIs. I think the mindset here is "if you want to delete multiple things, call delete multiple times"

Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :

@Aditi:
I found this while experimenting for another bug

reedip@reedip-VirtualBox:/opt/stack/python-neutronclient/neutronclient/tests/unit$ neutron firewall-create --router 36a1abfd-8f7c-4d87-9cb3-b381a2f49d8a --router c850bb56-7c68-4fdc-8575-ea21e3ade14c a
Created a new firewall:
+--------------------+--------------------------------------+
| Field | Value |
+--------------------+--------------------------------------+
| admin_state_up | True |
| description | |
| firewall_policy_id | eb1eef1b-5970-468c-bd8f-040a49e54ce8 |
| id | d09ce95a-c87f-4b93-b783-e9990d46cb41 |
| name | |
| router_ids | 36a1abfd-8f7c-4d87-9cb3-b381a2f49d8a |
| | c850bb56-7c68-4fdc-8575-ea21e3ade14c |
| status | PENDING_CREATE |
| tenant_id | c999294ae135457b9eac85f230bff8de |
+--------------------+--------------------------------------+

Seems that it is possible :)

Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :

Just to be clear, I can add multiple routers while creating firewall.
If the above functionality exists, then there is no harm in working on the following issue as well (??)

Revision history for this message
Richard Theis (rtheis) wrote :

Hi Aditi, are you still working on this bug?

Revision history for this message
ranjitray (ranjitray) wrote :

agree with Reedip. I think it will be possible and also easy for customer to delete multiple firewall rule on ne shot instead of running the same command multiple times.
Note : Same implementation for other commands also.

tags: removed: client
Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :

However , I think the scope of this issue should not only lie with firewall rule delete.
Its scope can be extended to firewall policy and firewall CLI itself.

Changed in neutron:
assignee: Aditi Rajagopal (aditirajagopal) → nobody
Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :

I would like to discuss the scope of the CLI changes before moving forward on this bug.
Maybe in the next IRC

Changed in neutron:
assignee: nobody → Reedip (reedip-banerjee)
Changed in python-neutronclient:
assignee: nobody → Reedip (reedip-banerjee)
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

You're confusing the fact that, when creating a firewall, that firewall can be associated with multiple (pre-created) routers. So it's like you're associating a list of routers to the firewall on creation. This is something that is typically possible in a number of neutron commands (like when adding host routes or dns servers).

As for your request above, the initial assessment is somewhat correct. Even though there are a number of clients that can accept the deletion of multiple entries at once (like nova delete or cinder snapshot-delete or glance image-delete), you typically allow for the deletion of one entry at the time. We should investigate if the underlying API services allow for bulk deletes or the client is simply iterating over the CLI input. Neutron allows for bulk delete so this is definitely possible.

Raising the profile of the bug and marking it RFE, as this might require changes on either side (client and server).

Changed in neutron:
status: New → Confirmed
importance: Undecided → Low
Changed in python-neutronclient:
status: New → Confirmed
importance: Undecided → Low
summary: - Fwaas/CLI: Can not delete multiple firewall rule by passing multiple
- firewall rule id
+ bulk delete improvements
tags: added: api rfe usability
removed: fwaas
Revision history for this message
Cedric Brandily (cbrandily) wrote :

nova has no bulk delete feature or novaclient doesn't use it: when you "nova delete id0 id1 id2 ..." novaclient tries to delete id0 then id1 (even if id0 delete fails) then id2 ...

Revision history for this message
Kevin Benton (kevinbenton) wrote :

Regardless of bulk support in our API, it would be nice if our client had the capability to do the same thing.

Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :

There are currently 2 ways for further improvement of this feature:
- Option #1 : Allow bulk delete in Neutron CLIs by just changing the neutronclient, and sending the request to Neutron Server 'One by One'.
There would not be any API related changes and therefore the resultant code change would be limited to the neutronclient.
Example: Bulk deletes are possible in Horizon( but then again, they are done one by one)

-Option #2 : Allow for bulk deletes by changing both the client and the underlying REST API.
This change would be a bit larger, and would involve changes in the neutronclient and the REST API to begin with.
It would however , may also require change in the other clients which use the Neutron API( for example , Horizon) to improve the overall performance of the action, if required.

I would like to know what the Core and Driver Team thinks about the above options.

Changed in neutron:
importance: Low → Wishlist
Changed in python-neutronclient:
importance: Low → Wishlist
Revision history for this message
Reedip (reedip-banerjee-deactivatedaccount) wrote :

Certain improvements and participation were attempted (done) in
https://review.openstack.org/#/c/10732/ and https://bugs.launchpad.net/python-neutronclient/+bug/1021726

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Let's discuss this at the drivers meeting and figure out a coherent response for these class of requests. It's worth bearing in mind Nova's stance on the matter [1] (not that we must follow them religiously though). I wonder if bulk support can be considered borderline.

[1] http://docs.openstack.org/developer/nova/project_scope.html#no-more-orchestration

Changed in neutron:
status: Confirmed → Triaged
Changed in python-neutronclient:
status: Confirmed → Triaged
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

Based on discussion [1], let's go with option [1]. Let's limit this to core resources only in the context of this effort.

[1] http://eavesdrop.openstack.org/meetings/neutron_drivers/2015/neutron_drivers.2015-12-15-15.01.log.html

Changed in neutron:
status: Triaged → Won't Fix
Changed in python-neutronclient:
status: Triaged → Confirmed
status: Confirmed → Triaged
tags: added: rfe-approved
removed: rfe
tags: removed: api
Changed in neutron:
assignee: Reedip (reedip-banerjee) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-neutronclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/263609

Changed in python-neutronclient:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-neutronclient (master)

Reviewed: https://review.openstack.org/263609
Committed: https://git.openstack.org/cgit/openstack/python-neutronclient/commit/?id=b16c9a8d3d70fe2ec69ab44b740011dc2b2bc097
Submitter: Jenkins
Branch: master

commit b16c9a8d3d70fe2ec69ab44b740011dc2b2bc097
Author: reedip <email address hidden>
Date: Tue Jan 5 16:32:36 2016 +0900

    Add support for Bulk Delete in NeutronClient

    The following patch adds support for BulkDelete in NeutronClient.
    Currently, the core existing Neutron CLIs are going to support
    Bulk Deletion in NeutronClient. However, if any extension does not
    require Bulk Delete, it can be disabled by updating the
    class attribute 'bulk_delete'.

    DocImpact
    Depends-On: Ib23d1e53947b5dffcff8db0dde77cae0a0b31243
    Change-Id: I3b8a05698625baad3906784e3ecffb0f0242d660
    Closes-Bug: #1495440

Changed in python-neutronclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-neutronclient 6.0.0

This issue was fixed in the openstack/python-neutronclient 6.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.