NSX: missing fk constraint between network gateway and devices

Bug #1319581 reported by Salvatore Orlando
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
vmware-nsx
New
Undecided
Unassigned

Bug Description

https://github.com/openstack/neutron/blob/master/neutron/plugins/vmware/dbexts/networkgw_db.py#L120

class NetworkGatewayDeviceReference(model_base.BASEV2):
    id = sa.Column(sa.String(36), primary_key=True)
    network_gateway_id = sa.Column(sa.String(36),
                                   sa.ForeignKey('networkgateways.id',
                                                 ondelete='CASCADE'),
                                   primary_key=True)
    interface_name = sa.Column(sa.String(64), primary_key=True)

The field 'id' refers to a gateway device. As there is no foreign key constraint the database layer will allow for creating gateway for non-existing devices - the error will then be detected in the backend anyway, but it should be caught at the DB layer.

Tags: vmware
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/93826

Changed in neutron:
status: New → In Progress
Kyle Mestery (mestery)
Changed in neutron:
milestone: juno-1 → juno-2
Kyle Mestery (mestery)
Changed in neutron:
milestone: juno-2 → juno-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-3 → juno-rc1
Revision history for this message
Kyle Mestery (mestery) wrote :

Moving medium priority bug out of Juno-RC1.

Changed in neutron:
milestone: juno-rc1 → kilo-1
Revision history for this message
Kyle Mestery (mestery) wrote :

Per my own confusion, moving back to Juno-RC1.

Changed in neutron:
milestone: kilo-1 → juno-rc1
Revision history for this message
Kyle Mestery (mestery) wrote :

Since we hope to cut the RC1 release on Monday/Tuesday, moving this out for now. If we have an RC2, I'm fine with adding this back on the radar if we need to.

Changed in neutron:
milestone: juno-rc1 → kilo-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/118148
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=906055b07771c816a3bb2954fbfbd89fafe2ab4f
Submitter: Jenkins
Branch: master

commit 906055b07771c816a3bb2954fbfbd89fafe2ab4f
Author: Salvatore <email address hidden>
Date: Mon Sep 1 14:37:00 2014 +0200

    NSX: Validate gateway device list against DB

    This patch adds a check for validating the devices for a network
    gateway are defined in the neutron DB before the request for
    creating the network gateway is sent to the NSX backend.

    Change-Id: Ic2245f965da332dbaee4ab5a869ce47f06a9e6ce
    Partial-Bug: #1319581

Kyle Mestery (mestery)
Changed in neutron:
milestone: kilo-1 → kilo-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Kyle Mestery (<email address hidden>) on branch: master
Review: https://review.openstack.org/93826
Reason: This review is > 4 weeks without comment and currently blocked by a core reviewer with a -2. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and contacting the reviewer with the -2 on this review to ensure you address their concerns.

Kyle Mestery (mestery)
Changed in neutron:
milestone: kilo-2 → kilo-3
Kyle Mestery (mestery)
Changed in neutron:
milestone: kilo-3 → none
no longer affects: neutron
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.