Booting multiple instances causes race with port security groups

Bug #1372570 reported by Gary Kotton
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Critical
Gary Kotton

Bug Description

On a fresh installation, without spinning up any instance, if one boots a number of instances via nova there are a number of default security groups created for the admin user:

mysql> select * from securitygroups;
+----------------------------------+--------------------------------------+---------+-------------+
| tenant_id | id | name | description |
+----------------------------------+--------------------------------------+---------+-------------+
| 67e87d2ac4944c3eb93283637b6e4000 | 0fe7f583-7d9e-4be0-9ade-6a4ee9a07daa | default | default |
| 67e87d2ac4944c3eb93283637b6e4000 | 1a237a3c-39c3-4a92-bd7b-55a3bc5ef7e9 | default | default |
| 67e87d2ac4944c3eb93283637b6e4000 | 51c83ff8-97f9-426d-836e-10bf631219e4 | default | default |
| 67e87d2ac4944c3eb93283637b6e4000 | 8882d943-4309-410c-bd56-981da8d5d095 | default | default |
| 67e87d2ac4944c3eb93283637b6e4000 | 893b2462-800a-4936-9b35-fc47822237e9 | default | default |
| d639ee58de4f4db7b29f30a7b142a047 | baf7ac95-efaf-427d-8fd9-f8210d23cab1 | default | default |
+----------------------------------+--------------------------------------+---------+-------------+

This should never happen as the admin user is not even spinning up the vm's....

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
assignee: nobody → Gary Kotton (garyk)
status: New → In Progress
Gary Kotton (garyk)
Changed in neutron:
importance: Undecided → Critical
Gary Kotton (garyk)
tags: added: icehouse-backport-potential
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Gary, could you share the detail procedure to reproduce this bug?

On a single machine on devstack, I confirmed security group for admin tenant with the following steps.
What you reported seems possible with multi-node setup if port-create API calls are called by nova-compute.
I haven't checked the code but IIRC yes.

- Comment out create_neutron_initial_network in stack.sh
- Run stack.sh
- The remaining operations is available here: http://paste.openstack.org/show/114650/
(note that "admin_admin" command is my wrapper just to add OS_USERNAME=admin OS_TENANT_NAME=admin envvars to the command)

Revision history for this message
Gary Kotton (garyk) wrote :

Hi,
The details are below:

1. localrc:

disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-meta

HOST_IP=10.0.0.30
DATABASE_PASSWORD=openstack
RABBIT_PASSWORD=openstack
SERVICE_TOKEN=openstack
SERVICE_PASSWORD=openstack
ADMIN_PASSWORD=openstack

2. neutron.conf :
api_workers = 4

3. do a clean devstack installation
4. run: nova boot --image cirros-0.3.2-x86_64-uec --flavor 1 --num-instances 5 X

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/123925

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/123187
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=32ea2e349decd750e25cb00a8c907b8f73f795f3
Submitter: Jenkins
Branch: master

commit 32ea2e349decd750e25cb00a8c907b8f73f795f3
Author: Gary Kotton <email address hidden>
Date: Mon Sep 22 10:03:37 2014 -0700

    Security groups: prevent race for default security group creation

    When a VM is booted via the Nova the client connection is created
    with an admin user. This causes problems when creating the neutron
    port. That is, there may be a race for the creation of the default
    security group for the tenant.
    The problem was introduced by commit acf44dba26ca8dca47bfb5fb2916807f9f4e2060

    Change-Id: Ie0199c71231a322704f1f49995facde09c92da25
    Closes-bug: #1372570

Changed in neutron:
status: In Progress → Fix Committed
Revision history for this message
Fawad Khaliq (fawadkhaliq) wrote :

Thanks for taking care of this.

Thierry Carrez (ttx)
Changed in neutron:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-rc1 → 2014.2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (feature/lbaasv2)

Fix proposed to branch: feature/lbaasv2
Review: https://review.openstack.org/130864

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (feature/lbaasv2)
Download full text (72.6 KiB)

Reviewed: https://review.openstack.org/130864
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c089154a94e5872efc95eab33d3d0c9de8619fe4
Submitter: Jenkins
Branch: feature/lbaasv2

commit 62588957fbeccfb4f80eaa72bef2b86b6f08dcf8
Author: Kevin Benton <email address hidden>
Date: Wed Oct 22 13:04:03 2014 -0700

    Big Switch: Switch to TLSv1 in server manager

    Switch to TLSv1 for the connections to the backend
    controllers. The default SSLv3 is no longer considered
    secure.

    TLSv1 was chosen over .1 or .2 because the .1 and .2 weren't
    added until python 2.7.9 so TLSv1 is the only compatible option
    for py26.

    Closes-Bug: #1384487
    Change-Id: I68bd72fc4d90a102003d9ce48c47a4a6a3dd6e03

commit 17204e8f02fdad046dabdb8b31397289d72c877b
Author: OpenStack Proposal Bot <email address hidden>
Date: Wed Oct 22 06:20:15 2014 +0000

    Imported Translations from Transifex

    For more information about this automatic import see:
    https://wiki.openstack.org/wiki/Translations/Infrastructure

    Change-Id: I58db0476c810aa901463b07c42182eef0adb5114

commit d712663b99520e6d26269b0ca193527603178742
Author: Carl Baldwin <email address hidden>
Date: Mon Oct 20 21:48:42 2014 +0000

    Move disabling of metadata and ipv6_ra to _destroy_router_namespace

    I noticed that disable_ipv6_ra is called from the wrong place and that
    in some cases it was called with a bogus router_id because the code
    made an incorrect assumption about the context. In other case, it was
    never called because _destroy_router_namespace was being called
    directly. This patch moves the disabling of metadata and ipv6_ra in
    to _destroy_router_namespace to ensure they get called correctly and
    avoid duplication.

    Change-Id: Ia76a5ff4200df072b60481f2ee49286b78ece6c4
    Closes-Bug: #1383495

commit f82a5117f6f484a649eadff4b0e6be9a5a4d18bb
Author: OpenStack Proposal Bot <email address hidden>
Date: Tue Oct 21 12:11:19 2014 +0000

    Updated from global requirements

    Change-Id: Idcbd730f5c781d21ea75e7bfb15959c8f517980f

commit be6bd82d43fbcb8d1512d8eb5b7a106332364c31
Author: Angus Lees <email address hidden>
Date: Mon Aug 25 12:14:29 2014 +1000

    Remove duplicate import of constants module

    .. and enable corresponding pylint check now the only offending instance
    is fixed.

    Change-Id: I35a12ace46c872446b8c87d0aacce45e94d71bae

commit 9902400039018d77aa3034147cfb24ca4b2353f6
Author: rajeev <email address hidden>
Date: Mon Oct 13 16:25:36 2014 -0400

    Fix race condition on processing DVR floating IPs

    Fip namespace and agent gateway port can be shared by multiple dvr routers.
    This change uses a set as the control variable for these shared resources
    and ensures that Test and Set operation on the control variable are
    performed atomically so that race conditions do not occur among
    multiple threads processing floating IPs.
    Limitation: The scope of this change is limited to addressing the race
    condition described in the bug report. It may not address other issues
    such as pre-existing issue wit...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (stable/icehouse)

Change abandoned by Aaron Rosen (<email address hidden>) on branch: stable/icehouse
Review: https://review.openstack.org/123925

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.