LbaasV2 session_persistence: Create and update

Bug #1469498 reported by Alex Stafeyev
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
python-neutronclient
Invalid
Undecided
Unassigned

Bug Description

When we create a Lbaas pool with session persistence it configured OK

neutron lbaas-pool-create --session-persistence type=HTTP_COOKIE --lb-algorithm LEAST_CONNECTIONS --listener 4658a507-dccc-41f9-87d7-913d31cab3a1 --protocol HTTP
Created a new pool:
+---------------------+------------------------------------------------+
| Field | Value |
+---------------------+------------------------------------------------+
| admin_state_up | True |
| description | |
| healthmonitor_id | |
| id | a626dc28-0126-48f7-acd3-f486827a89c1 |
| lb_algorithm | LEAST_CONNECTIONS |
| listeners | {"id": "4658a507-dccc-41f9-87d7-913d31cab3a1"} |
| members | |
| name | |
| protocol | HTTP |
| session_persistence | {"cookie_name": null, "type": "HTTP_COOKIE"} |
| tenant_id | ae0954b9cf0c438e99211227a7f3f937 |

BUT, when we create a pool without session persistence and update it to do session persistence, the action is different and not user friendly.

[root@puma09 ~(keystone_redhat)]# neutron lbaas-pool-create --lb-algorithm LEAST_CONNECTIONS --listener 4658a507-dccc-41f9-87d7-913d31cab3a1 --protocol HTTP
Created a new pool:
+---------------------+------------------------------------------------+
| Field | Value |
+---------------------+------------------------------------------------+
| admin_state_up | True |
| description | |
| healthmonitor_id | |
| id | b9048a69-461a-4503-ba6b-8a2df281f804 |
| lb_algorithm | LEAST_CONNECTIONS |
| listeners | {"id": "4658a507-dccc-41f9-87d7-913d31cab3a1"} |
| members | |
| name | |
| protocol | HTTP |
| session_persistence | |
| tenant_id | ae0954b9cf0c438e99211227a7f3f937 |
+---------------------+------------------------------------------------+
[root@puma09 ~(keystone_redhat)]# neutron lbaas-pool-update b9048a69-461a-4503-ba6b-8a2df281f804 --session-persistence type=HTTP_COOKIE
name 'HTTP_COOKIE' is not defined
[root@puma09 ~(keystone_redhat)]#

we need to configure it in the following way-
neutron lbaas-pool-update b9048a69-461a-4503-ba6b-8a2df281f804 --session-persistence type=dict type=HTTP_COOKIE
Updated pool: b9048a69-461a-4503-ba6b-8a2df281f804

The config and update should be done in same way.

Kilo+ rhel 7.1
openstack-neutron-common-2015.1.0-10.el7ost.noarch
python-neutron-lbaas-2015.1.0-5.el7ost.noarch
openstack-neutron-openvswitch-2015.1.0-10.el7ost.noarch
python-neutronclient-2.4.0-1.el7ost.noarch
openstack-neutron-lbaas-2015.1.0-5.el7ost.noarch
python-neutron-fwaas-2015.1.0-3.el7ost.noarch
openstack-neutron-fwaas-2015.1.0-3.el7ost.noarch
python-neutron-2015.1.0-10.el7ost.noarch
openstack-neutron-2015.1.0-10.el7ost.noarch
openstack-neutron-ml2-2015.1.0-10.el7ost.noarch

Tags: lbaas
Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

I'm not sure if this neutron issue or python-neutronclient issue

tags: added: lbaas
Changed in neutron:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Liyingjun (liyingjun) wrote :

Seems it is a neutronclient related bug

Changed in neutron:
assignee: nobody → yaowei (yaowei)
Changed in neutron:
assignee: yaowei (yaowei) → nobody
zhaobo (zhaobo6)
Changed in neutron:
assignee: nobody → zhaobo (zhaobo6)
Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This bug is > 240 days without activity. We are unsetting assignee and milestone and setting status to Incomplete in order to allow its expiry in 60 days.

If the bug is still valid, then update the bug status.

Changed in neutron:
assignee: zhaobo (zhaobo6) → nobody
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
Revision history for this message
Alex Stafeyev (astafeye) wrote :

Seeing the issue again on ocata

Changed in neutron:
status: Expired → New
Revision history for this message
Alex Stafeyev (astafeye) wrote :

Not working:
[stack@undercloud-0 ~]$ neutron lbaas-pool-update f38c3088-ed29-47b4-ad45-578fbc8c925f --session_persistence type=SOURCE_IP
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
name 'SOURCE_IP' is not defined

Working
[stack@undercloud-0 ~]$ neutron lbaas-pool-update f38c3088-ed29-47b4-ad45-578fbc8c925f --session-persistence type=SOURCE_IP

Difference:
session_persistence and session-persistence

Both should be supported as in other features it is that way ( ex security-group and security_group)

affects: neutron → python-neutronclient
Revision history for this message
Akihiro Motoki (amotoki) wrote :

--session-persistence and --session_persistence are not equal. Neutron CLI has never provided the equality of the hyphen version and underscore version.

--session-persistence is a defined option, so it works as you tested.

On the other hand, --session_persistence is not a defined option, so it will be interpreted based on the extra argument mechanism of neutron CLI. session_persistence attribute is a dict object and 'type' is a key of the dict, so you need to specify a parameter in a way the extra argument mechanism interpretes. Thus '--session_persistence type=dict type=SOURCE_IP' should work.

We have no plan to fix this. Generally speaking, ***ONLY*** the hyphen should be used unless you understand what happens and the underscore version (the extra argument mechanism) **only when you need to use it**. We cannot change the extra argument mechanism not to break existing users. (In addition, neutron CLI deprecation is the other reason we don't fix it).

[1] https://docs.openstack.org/python-neutronclient/latest/cli/neutron.html#extra-arguments-for-create-update-operation

Changed in python-neutronclient:
status: New → Invalid
importance: Medium → Undecided
summary: - LbaasV2 session persistence- Create and update
+ LbaasV2 session_persistence: Create and update
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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