nova list quantum security group cache

Bug #1161518 reported by Aaron Rosen
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Aaron Rosen
Grizzly
Fix Released
Medium
Aaron Rosen

Bug Description

When doing nova list it queries quantum for each vm to get the security groups. It would be better if we could just query quantum once for all the security groups owned by a tenant and then populate the information from that. Also we should take into consideration if quantum goes down we don't want to necessarily bring down the ability to list instances.

>nova list
GET /v2.0/ports.json?device_id=4110d985-f321-4416-a768-cef820861398 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=c2a3b824-cc30-45fc-9597-ab1020793502 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=9b349717-6ca0-4cf1-8a64-0272121b0f8d HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=d85020d1-1752-47c0-a290-60373de019bd HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=5a9656f0-5a00-4894-b915-0b10c3b993fb HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=c16033bb-7de0-4779-8cdd-60d510f5e78d HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=c1262f17-c90a-43f7-abe5-eefbdfb406af HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=2d66634f-e8ec-44d7-8367-385a31a2bca9 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=d0d3dec7-3f1a-4745-a625-740d06282134 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=9bf7a3c4-274c-43d8-9563-bb072b1c824b HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=0e1d3089-60de-4b3e-a9d5-4ec12dbfa0f9 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=c0cd75cc-b4e3-4572-a436-bc85123d99c8 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=57ede81a-258c-417d-af22-d5e4fd8e93c0 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=e78cfd7d-2bfa-4164-9f76-bb22771d2f14 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=393810a6-796b-42a4-8da9-d6f3b4a90de9 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=f644cd99-958d-41c2-b83f-f491b41e80fe HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=4573aa29-e897-42b2-b8f9-12576a748eda HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=a28347d8-b97a-4274-938c-cd1952381d79 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=76d9b8e4-b971-4256-8de6-35595cf2b7f7 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/ports.json?device_id=2199928e-5d5c-46be-8bf4-74f051b18601 HTTP/1.1 (HTTP/1.1 200 OK)
GET /v2.0/security-groups.json HTTP/1.1 (HTTP/1.1 200 OK)

Aaron Rosen (arosen)
Changed in nova:
assignee: nobody → Aaron Rosen (arosen)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: New → In Progress
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/25670
Committed: http://github.com/openstack/nova/commit/afeb95dfc924ed7e768d76bc5ae4bd4c55e9dcb3
Submitter: Jenkins
Branch: master

commit afeb95dfc924ed7e768d76bc5ae4bd4c55e9dcb3
Author: Aaron Rosen <email address hidden>
Date: Fri Mar 29 18:09:28 2013 -0700

    Query quantum once for instance's security groups

    This patch adds the method get_instance_security_group_bindings()
    which returns all the instance_id's and security groups for a given
    tenant. This method is then used to avoid querying quantum for it's
    security groups when using GET /v2/<project_id>/servers/detail.

    Fixes bug 1161518

    Change-Id: Ia28d5573c264f0316ab9fb257ca8e7ae35679883

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/grizzly)

Fix proposed to branch: stable/grizzly
Review: https://review.openstack.org/27393

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/grizzly)

Reviewed: https://review.openstack.org/27393
Committed: http://github.com/openstack/nova/commit/e653938ff7bc6b9b3e97e784bb07516576305b3e
Submitter: Jenkins
Branch: stable/grizzly

commit e653938ff7bc6b9b3e97e784bb07516576305b3e
Author: Aaron Rosen <email address hidden>
Date: Fri Mar 29 18:09:28 2013 -0700

    Query quantum once for instance's security groups

    This patch adds the method get_instance_security_group_bindings()
    which returns all the instance_id's and security groups for a given
    tenant. This method is then used to avoid querying quantum for it's
    security groups when using GET /v2/<project_id>/servers/detail.

    Fixes bug 1161518

    Conflicts:

        nova/tests/api/openstack/compute/contrib/test_security_groups.py

    Change-Id: Ia28d5573c264f0316ab9fb257ca8e7ae35679883
    (cherry picked from commit afeb95dfc924ed7e768d76bc5ae4bd4c55e9dcb3)

Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-1 → 2013.2
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.