Toggling admin_state_up has no effect

Bug #1619449 reported by Paul Glass
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
octavia
Fix Released
High
Michael Johnson

Bug Description

This was my setup - a single loadbalancer, one listener, one pool, and two members. `admin_state_up = False` on all of these resources.

  ===== Loadbalancer pglbutt-lb =====
  {
    "name": "pglbutt-lb",
    "operating_status": "ONLINE",
    "id": "782ede0c-251e-4bbb-bde0-c9cdc4564368",
    "pools": "{\"id\": \"bef3be76-0b57-4e1c-b35d-687949d5f3ef\"}",
    "provider": "octavia",
    "description": "",
    "admin_state_up": false,
    "tenant_id": "98a68f01476c4a3899ee709906d1cab3",
    "provisioning_status": "ACTIVE",
    "vip_subnet_id": "70fc37ca-aebb-4f2c-b4c1-0c9923aa7ef2",
    "listeners": "{\"id\": \"0786e713-331a-464f-9541-de1bf7c4fda3\"}",
    "vip_address": "10.0.0.10",
    "vip_port_id": "83168479-4ef6-4e0e-a2ff-0c99bb3a4a64"
  }
  ==== Listener pglbutt-listener =====
  {
    "name": "pglbutt-listener",
    "id": "0786e713-331a-464f-9541-de1bf7c4fda3",
    "default_pool_id": "bef3be76-0b57-4e1c-b35d-687949d5f3ef",
    "connection_limit": -1,
    "protocol_port": 80,
    "protocol": "HTTP",
    "description": "",
    "default_tls_container_ref": "",
    "admin_state_up": false,
    "loadbalancers": "{\"id\": \"782ede0c-251e-4bbb-bde0-c9cdc4564368\"}",
    "tenant_id": "98a68f01476c4a3899ee709906d1cab3",
    "sni_container_refs": ""
  }
  ===== Pool pglbutt-pool =====
  {
    "name": "pglbutt-pool",
    "id": "bef3be76-0b57-4e1c-b35d-687949d5f3ef",
    "members": "6b24a190-19f4-4d3c-bba2-b117d5f5b95e\nba471f88-c2b9-4573-9858-4fc4101ebc9d",
    "listeners": "{\"id\": \"0786e713-331a-464f-9541-de1bf7c4fda3\"}",
    "lb_algorithm": "ROUND_ROBIN",
    "protocol": "HTTP",
    "description": "",
    "admin_state_up": false,
    "loadbalancers": "{\"id\": \"782ede0c-251e-4bbb-bde0-c9cdc4564368\"}",
    "tenant_id": "98a68f01476c4a3899ee709906d1cab3",
    "session_persistence": "",
    "healthmonitor_id": ""
  }
  ==== Member pglbutt-2 =====
  {
    "id": "6b24a190-19f4-4d3c-bba2-b117d5f5b95e",
    "protocol_port": 80,
    "address": "10.0.0.13",
    "tenant_id": "98a68f01476c4a3899ee709906d1cab3",
    "subnet_id": "70fc37ca-aebb-4f2c-b4c1-0c9923aa7ef2",
    "admin_state_up": false,
    "weight": 1,
    "name": "pglbutt-2"
  }
  ==== Member pglbutt-1 =====
  {
    "id": "ba471f88-c2b9-4573-9858-4fc4101ebc9d",
    "protocol_port": 80,
    "address": "10.0.0.8",
    "tenant_id": "98a68f01476c4a3899ee709906d1cab3",
    "subnet_id": "70fc37ca-aebb-4f2c-b4c1-0c9923aa7ef2",
    "admin_state_up": false,
    "weight": 1,
    "name": "pglbutt-1"
  }

In this case admin_state_up is false everywhere, but curling the loadbalancer vip still allows traffic through:

    stack@octavia-devstack:~$ curl 10.0.0.10
    Hello, world (10.0.0.8)!
    stack@octavia-devstack:~$ curl 10.0.0.10
    Hello, world (10.0.0.13)!
    stack@octavia-devstack:~$ curl 10.0.0.10
    Hello, world (10.0.0.8)!
    stack@octavia-devstack:~$ curl 10.0.0.10
    Hello, world (10.0.0.13)!

Changed in octavia:
status: New → Incomplete
status: Incomplete → Triaged
Revision history for this message
Michael Johnson (johnsom) wrote :

I am seeing that admin-state-up=False does not work for loadbalancer and listener via the neutron client.

Pool and members do work.

Changed in octavia:
importance: Undecided → High
Revision history for this message
Michael Johnson (johnsom) wrote :

Hmm, interesting. So, with listener admin-state-up=False, the haproxy configuration file is empty as expected, but traffic is still flowing.

Revision history for this message
Michael Johnson (johnsom) wrote :

The problem is here: https://github.com/openstack/octavia/blob/master/octavia/amphorae/drivers/haproxy/rest_api_driver.py#L77

In the case of admin-state-up=False for the listener and load balancer, this check is returning the incorrect information which causes the controller to send a start instead of the reload it should.

Revision history for this message
Paul Glass (pnglass) wrote :

Just confirming Michael's findings. I tested this again with fresh api resources. The pools and members respect respect admin-state-up = False, while the listener and loadbalancer do not.

Changed in octavia:
assignee: nobody → Michael Johnson (johnsom)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to octavia (master)

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

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

Reviewed: https://review.openstack.org/364707
Committed: https://git.openstack.org/cgit/openstack/octavia/commit/?id=83731fd9a4b1f7748bb6af277b291f57756431df
Submitter: Jenkins
Branch: master

commit 83731fd9a4b1f7748bb6af277b291f57756431df
Author: Michael Johnson <email address hidden>
Date: Fri Sep 2 07:05:49 2016 +0000

    Fix admin_state_up for loadbalancer and listener

    The admin-state-up=False action for loadbalancer and listener
    failed to affect the appropriate change. This patch corrects that
    as well as removes an un-necessary call to the amphora-agent.

    Change-Id: I698f964f584d150f162f6c8cb41c65f5c5556b52
    Closes-Bug: #1619449

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

This issue was fixed in the openstack/octavia 0.9.0 release.

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.