Kilo:No command to configure LB session persistence in openstack CLI.

Bug #1515508 reported by hgangwx
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Expired
Low
Unassigned

Bug Description

openstack env is kilo using ubuntu 14.04, can't configure load balance session persistence in openstack CLI. anyway to configure it via cli?

[root@nsj1 ~]# neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=HTTP_COOKIE
name 'HTTP_COOKIE' is not defined

[root@nsj1 ~]# neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=http_cookie
name 'http_cookie' is not defined

[root@nsj1 ~]# neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=app_cookie
name 'app_cookie' is not defined

[root@nsj1 ~]# neutron lb-vip-create
usage: neutron lb-vip-create [-h] [-f {shell,table,value}] [-c COLUMN]
                             [--max-width <integer>] [--prefix PREFIX]
                             [--request-format {json,xml}]
                             [--tenant-id TENANT_ID] [--address ADDRESS]
                             [--admin-state-down]
                             [--connection-limit CONNECTION_LIMIT]
                             [--description DESCRIPTION] --name NAME
                             --protocol-port PROTOCOL_PORT --protocol
                             {TCP,HTTP,HTTPS} --subnet-id SUBNET
                             POOL
neutron lb-vip-create: error: too few arguments

Tags: lbaas
Revision history for this message
Dongcan Ye (hellochosen) wrote :

You can try like this:
neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type="HTTP_COOKIE", [cookie_name="test"]

ref lb-vip-update in:
https://wiki.openstack.org/wiki/Neutron/LBaaS/CLI

Revision history for this message
Dongcan Ye (hellochosen) wrote :

Sorry, command is:
neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type="HTTP_COOKIE"

Revision history for this message
hgangwx (hgangwx) wrote :

thanks, it works now.

Revision history for this message
hgangwx (hgangwx) wrote :

why we can't find this parameter in cli, can we add it?

tags: added: lbaas
Changed in neutron:
importance: Undecided → Low
Revision history for this message
hgangwx (hgangwx) wrote :

HTTP_COOKIE and SOURCE_IP can be enabled using your method, but APP_COOKIE still not be updated.

[root@nsj1 ~]# neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type="HTTP_COOKIE"
Updated vip: 748b4c56-7a3b-41d4-b591-ecd9014730ed
[root@nsj1 ~]#
[root@nsj1 ~]#
[root@nsj1 ~]#
[root@nsj1 ~]# neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type="SOURCE_IP"
Updated vip: 748b4c56-7a3b-41d4-b591-ecd9014730ed
[root@nsj1 ~]#
[root@nsj1 ~]#
[root@nsj1 ~]#
[root@nsj1 ~]# neutron lb-vip-show 748b4c56-7a3b-41d4-b591-ecd9014730ed
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| address | 10.88.4.100 |
| admin_state_up | True |
| connection_limit | -1 |
| description | |
| id | 748b4c56-7a3b-41d4-b591-ecd9014730ed |
| name | CNS_LB_base88_vip |
| pool_id | eabc5d42-e1b8-41e3-b9e5-536f0b353ae1 |
| port_id | ce1be0f3-6a85-42d0-b2a4-44dd8661473e |
| protocol | HTTP |
| protocol_port | 80 |
| session_persistence | {"type": "SOURCE_IP"} |
| status | ACTIVE |
| status_description | |
| subnet_id | 85985706-af6c-4e90-ad8b-5d035735029f |
| tenant_id | b9e67e0c573b40ff8ada568cb9dccd71 |
+---------------------+--------------------------------------+
[root@nsj1 ~]#
[root@nsj1 ~]#
[root@nsj1 ~]#
[root@nsj1 ~]# neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type="APP_COOKIE"
Internal Server Error (HTTP 500) (Request-ID: req-7c1d8555-5ef6-48fa-a93b-7143a6e2b1c4) >>>>>>>>>>>

Revision history for this message
Miguel Angel Ajo (mangelajo) wrote :

doug, sent to you to have some eyes on it, I think it's on the category of low or wishlist, and any patches from the requesters could be welcome.

Changed in neutron:
assignee: nobody → Doug Wiegley (dougwig)
Revision history for this message
Dongcan Ye (hellochosen) wrote :

when using APP_COOKIE, you should specify cookie_name.

neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type="APP_COOKIE", [cookie_name="test"]

Revision history for this message
hgangwx (hgangwx) wrote :

how to type this command, I tried it but failed.
[root@nsj1 ~]# neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type="APP_COOKIE" cookie_name="test"
Bad Request (HTTP 400) (Request-ID: req-9a530351-b744-453c-86d7-f06701d15ede)
[root@nsj1 ~]#
[root@nsj1 ~]#
[root@nsj1 ~]# neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type="APP_COOKIE", cookie_name="test"
usage: neutron
               [--session_persistence SESSION_PERSISTENCE [SESSION_PERSISTENCE ...]]
neutron: error: argument --session_persistence: invalid str2dict value: u'type=APP_COOKIE,'
[root@nsj1 ~]#
[root@nsj1 ~]#
[root@nsj1 ~]# neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type="APP_COOKIE" [cookie_name="test"]
Bad Request (HTTP 400) (Request-ID: req-03954803-7ff1-40fa-9dc2-f0c3fb05d937)

Revision history for this message
Dongcan Ye (hellochosen) wrote :

The wiki is error, try like this:

neutron lb-vip-update 748b4c56-7a3b-41d4-b591-ecd9014730ed --session_persistence type=dict type=APP_COOKIE,cookie_name="test"

Revision history for this message
hgangwx (hgangwx) wrote :

thanks a lot

Revision history for this message
hgangwx (hgangwx) wrote :

we can find the command from cli reference guide,but can't find it in CLI.

https://wiki.openstack.org/wiki/Neutron/LBaaS/CLI#lb-vip-update

lb-vip-create --subnet-id <subnet-id> --protocol <protocol> --protocol-port <tcp port> --name <name> [--address <address>] [--admin-state-down] [--connection-limit <connection limit>] [--description <description>] [--tenant-id <tenant id>] <pool-id> [--session-persistence type=dict type=<type>,[cookie_name=<name>]]

Gary Kotton (garyk)
Changed in python-neutronclient:
importance: Undecided → Low
status: New → Confirmed
no longer affects: neutron
li,chen (chen-li)
Changed in python-neutronclient:
assignee: nobody → li,chen (chen-li)
Revision history for this message
Bo Chi (bochi-michael) wrote :

I see all of neutron lb-**-update commands don't have help info, so we should add all of them?

Revision history for this message
Bo Chi (bochi-michael) wrote :

There's a bug for the similar issue for lbaasv2: https://bugs.launchpad.net/python-neutronclient/+bug/1515111

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

This bug is > 180 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 python-neutronclient:
assignee: li,chen (chen-li) → nobody
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for python-neutronclient because there has been no activity for 60 days.]

Changed in python-neutronclient:
status: Incomplete → Expired
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.