Commit Graph

36 Commits

Author SHA1 Message Date
asarfaty 26f855f9c9 Remove some pylint exclusions (part 2)
Change-Id: I2047f083af01dd0452f61d9fb807098e0514ff36
2020-10-01 10:25:06 +02:00
Salvatore Orlando a642dc7f98 [NSX|v3] L2 gw: store segmentation id in DB in any case
Store the segmentation id for a connection even when not specified
on the connection create request, but inherited from l2gw device
configuration

Change-Id: I3ce91eed538ef467129c83e58d560961835db255
2019-06-17 01:46:06 -07:00
Salvatore Orlando 0a952ce786 [NSX-v3] Use bridge endpoint profiles for L2 gateways
Replace NSX bridge cluster with bridge endpoint profiles as the
backend resource used to implement L2 gateways.

The logic for creating a gateway connection is not changed,
with the only exception that bridge endpoints now have a reference
to a bridge endpoint profile.

Connections created using bridge clusters can be safely removed,
while creation of new connection on gateways leveraging bridge
clusters will fail.

Change-Id: I29cd9a2501ab4b7dd226729f33ab962bbba2dfff
2019-03-23 05:39:58 +00:00
Boden R b534afa38e use payloads for PORT BEFORE_DELETE callbacks
This patch switches BEFORE_DELETE callback events for PORT resources
over to the payload style args use a DBEventPayload object in prep for
the depends on patch.

Change-Id: I8c4b2f3700bbf8ca9aad82c32a54e33c1ad06c3d
2019-02-03 08:10:44 +00:00
Adit Sarfaty fa72daa9d2 NSX|V3: Add L2GW connection validation
1. Do not allow creating a connection with the same seg-id & bridge cluster again
as the NSX fails it
2. In case creation failed, allow delete to succedd (for rollback of the create)

Change-Id: I9db62a2b895bfac93381ba5200f96c96163e39a5
2018-12-27 11:53:34 +02:00
Gary Kotton 15a279dbc6 L2GW: support missing methods
Adds missing methods. Something changed witht he way in which
the callbacks were invoked which showed that we did not support
the correct methods.

Change-Id: I253ceee343d829923b874057603a32ccd8c662f6
2018-03-13 08:50:54 +00:00
Boden R 527eca9f73 use plugin common utils from neutron-lib
The public APIs that are part of neutron.plugins.common.utils were
rehomed into neutron-lib with Iabb155b5d2d0ec6104ebee5dd42cf292bdf3ec61
and will removed in neutron with commit
I1d63cbea463e92e1d2e053f8e1a564ed52cb84f8

This patch consumes the common plugin utils from neutron-lib

Change-Id: I54ef960de54bc3ae781af7ba9473729c94197d0d
2018-03-04 09:53:45 +00:00
Adit Sarfaty c6c155c1aa TVD: Add service plugins to separate list results
Adding service plugins for QoS, VPNaaS and L2Gateway
and updating the BGP plugin
to prevent users from getting objects belonging to a different
plugin

Change-Id: I3545c3acefaf50ca6937a0b7a65c131c569317cd
2018-02-20 10:34:18 +02:00
Boden R fdb1b6c915 use callback payloads for _SPAWN events
This patch switches callbacks over to the payload object style events
[1] for BEFORE_SPAWN and AFTER_SPAWN based notifications. As no event
data is passed for SPAWN notifications, an actual payload object is
not needed and thus this change uses publish() rather than notify()
and updates and callback receivers to accept the payload parameter.

Depends-On: Ifad4781d82aa07f213f4e075b0c9455aa95e94bb

[1] https://docs.openstack.org/neutron-lib/latest/contributor/callbacks.html#event-payloads

Change-Id: Icca5213d7372ea28204db50108d5f77e1acf400d
2018-01-03 13:47:09 -07:00
Adit Sarfaty 0a779b4389 TVD: l2gw support
Creating a wrapper driver for l2gw for hte TVD plugin
This driver choose the actual driver based on the project id.

Change-Id: I2edda8c780b7e14b36e3033108186ad63dd0449e
2017-12-24 13:38:20 +02:00
Abhishek Raut db9ad34821 Validate L2gateway exists in backend
Before creating L2gateway, we must validate whether the bridge
cluster exists in the backend.

Change-Id: I94c435d486b1fde2432c507de7181e6cdfb94d97
2017-04-20 05:31:32 -07:00
Adit Sarfaty 228181c7da Use neutron-lib callbacks module
Change-Id: Id348f28655d2e414201bbd71b9b2e47760aaed5a
2017-04-25 10:36:26 +03:00
Gary Kotton 6228a06399 Drop log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Change-Id: I9d37ae28a3fecbe910e60dc7f22e229a7b65940c
2017-03-26 05:09:02 -07:00
Gary Kotton da7c01fb18 Use neutron-lib's context module
This also addresses issues with commit 1f5ee0e8942e4b77a89a00ee0249de5d5014e2bc

Change-Id: I47809344fd2c2f21acba05354c3649342560148b
2017-03-07 07:16:57 -08:00
Boden R 96188c66a5 Use neutron-lib provider net api-def
This patch refactors vmware-nsx to use provider net
from neutron-lib. For more details see [1].

Also note that vmware-nsx code uses the private API
_raise_if_updates_provider_attributes(). While it's a bad
practice to use private APIs, I've submitted a patch to try
and get it into lib [2].

NeutronLibImpact

[1] https://review.openstack.org/421562/
[2] https://review.openstack.org/421961/

Change-Id: I340550a5564c5bbff2e20745f21a8c97a64b7395
2017-01-18 07:51:38 -07:00
Adit Sarfaty 3009f37757 Integration with neutron-lib plugin directory
Co-authored-by: Armando Migliaccio <armamig@gmail.com>
Change-Id: I7c7efbaa7a53f8d244f1b19ea3a7c8a8900602be
Depends-on: I7331e914234c5f0b7abe836604fdd7e4067551cf
Depends-on: Ia91dfbf9d93e19b43c0dd0b58b95fc0080b0ad7c
Depends-on: I48cd9257f419ad949ba0cecc9aca98a624ca4dcc
2016-11-23 20:18:17 +00:00
Adit Sarfaty 437e782ea5 Integration with nsxlib
Change-Id: Ief8af0d5cad8223fb52313d26d75c1f10b13c3cf
2016-11-03 05:56:36 +00:00
Adit Sarfaty 34f3ee275e nsxlib refactor: config + neutron deps
1. new config class was added to allow all the classes to use the same object
2. removing dependencies of the neutron project in nsxlib code & tests

Change-Id: I15ace2ab60c1e4307d7076426c48ecc7a242e792
2016-09-30 21:00:52 +03:00
Adit Sarfaty 701de5c48f nsxlib refactor - add hierarchy to the nsxlib apis
Separating the nsxlib apis into sub classed like
firewall, nsgroup, logical router, in order to make the api simpler

Change-Id: If67fae83515bd9e72aba116a78bb6afce1fe1ab9
2016-09-30 20:44:32 +03:00
Adit Sarfaty a7b5bfafcc nsxlib refactor continue
- separate nsxlib/v3 constants and utils from the common ones
- separate the nsxlib/v3 tests
- update the nsxlib tests to cover create_firewall_rules
- remove all of the DB calls from the nsxlib/v3
- merge security & dfw_api classes

To be done in future patches:
- Avoid using the nsx configuration values directly
- Improve nsxlib interface (as Aaron suggested in If2fe1e014b78703ff0a9cdff1e4e8d45f3a4a16d)

Change-Id: I43257f557ce1e98b4f64b8157d723cc84ea58c2b
2016-09-29 15:59:13 +03:00
Abhishek Raut c3b287d4b8 [NSX|v3]: L2gateway fails to start when Bridge cluster configured
Recent change If2fe1e014b78703ff0a9cdff1e4e8d45f3a4a16d
broke L2GW driver for NSXv3. This patch makes sure that the driver
starts and creates bridge clusters using the new nsxlib.
This patch adds a callback to create default l2 gw after the core
plugin is initialized.

Change-Id: Iced699b13e265f515c23fcc952ba9bb1e64b5762
2016-08-28 04:12:09 -07:00
Aaron Rosen 86118f6692 nxv3: mass refactor of nsxlib
This patch refactors the current codebase to be more modular
and testable. The main changes are:

  - pull out all of the profile setup logic from the __init__
    method to it's own method _init_nsx_profiles method to make
    testing the code easier.

  - refactors the nsxlib.v3 code to break out all neutron related
    exceptions and cleans up the interface so we can make nsxlib.v3
    it's own standalone library eventually.

To improve:

  - Currently we have nsxlib.v3.dfw_api and nsxlib.v3.firewall,
    we should refactor this code and merge them into one file.

  - refactor nsxlib to section of each api component to it's own
    subclass. For example, nsxlib().port.create() rather than
    nsxlib().create_port(). I think this would be most useful
    for the security group/firewall integration as there are many
    methods there that are needed to interface with nsx as the security
    group feature is requires the most orchestration with nsx.
    Breaking them into a sub class will make things more easy to understand.

Change-Id: If2fe1e014b78703ff0a9cdff1e4e8d45f3a4a16d
2016-08-19 12:28:20 +00:00
Abhishek Raut ecbed5d940 [NSX|V|V3]: Refactor NSX-V L2 Gateway driver
Commit Ib56ee8bfd182c031e468c503acb0cd75daea8c40 refactored code
in L2 gateway base plugin. This patch removes unused NSX plugin
code and makes appropriate changes to NSX-V driver.

This patch also adds a couple of update_l2_gateway methods to
both NSX|V and NSX|V3 L2GW drivers. These methods are added
since the base plugin expects the driver to define them.

Change-Id: Ifda5401ec5134268b8a9c3276ed7abf4cf8874aa
Partial-Bug: #1591413
2016-05-13 07:15:50 -07:00
Abhishek Raut 6080794f94 [NSXv3]: Refactor v3 L2 Gateway driver
Commit Ib56ee8bfd182c031e468c503acb0cd75daea8c40 refactored code
in L2 gateway base plugin. This patch makes appropriate changes
in NSX plugin and v3 driver.

Change-Id: I45d546e59e99d49d2a9b18258af94d90e91333ca
Partial-Bug: #1591413
2016-05-09 20:58:57 -07:00
Gary Kotton 0613e7773f Remove deprecated warnings for neutron_lib
neutron_lib should be used instead of the attributes and constants
imports. This patch moves to using neutron_lib. This removes all of
the deprecated warnings (there are still some from neutron and
l2gw - those are addressed in other patches).

Change-Id: I796d749c46a69107a1a484e8774c5d501fc4704f
2016-05-11 19:26:04 -07:00
Jenkins be5d8c0508 Merge "[NSX-v3]: Fix L2GW connection-create" 2016-04-19 00:16:47 +00:00
Adit Sarfaty a88b99b6c9 NSX|v3 replace configuration uuids with names
Support configuration of name or uuid (instead of only uuid) for 4 nsx_v3
parameters: default_overlay_tz, default_vlan_tz, default_bridge_cluster
and default_tier0_router.

Assert on init if the uuid or name was no found on the backend, or if the
name is not unique.

DocImpact: Configuration options default_overlay_tz_uuid, default_vlan_tz_uuid,
           default_bridge_cluster_uuid and default_tier0_router_uuid were
           replaced with default_overlay_tz, default_vlan_tz, default_bridge_cluster
           and default_tier0_router and support name or uuid now.

Change-Id: Id153d4d69165b161c04c403b578657c51af20e9c
2016-04-18 16:28:09 +03:00
Abhishek Raut 1e2208170a [NSX-v3]: Fix L2GW connection-create
If no seg-id is passed during l2 gateway connection create, we
must retrieve the seg-id from l2 gateway resource. This patch
makes sure we retrieve the seg-id from the l2 gateway resources
interface list.
This patch also adds validation to make sure only one interface
is created for a given L2GW resource.

Change-Id: Ida957f7b2e048574ee7ea48958a875c679bb2d07
Closes-Bug: #1569622
2016-04-07 20:28:19 -07:00
Abhishek Raut 8c61877187 NSX: make use of neutron_lib exceptions
Commit 87a79256c494c36f2d9597313f430b24c0110161 added neutron_lib
for shared exceptions. This patch moves us to make use of the
aforementioned library.

Change-Id: I9fe014c5da85faca87bf88a80c4ee19f7f123123
2016-02-21 22:30:41 -08:00
Gary Kotton afcf3f3232 Fix plugin(s) following upstream changes
Commit 3082949cffeefd7ef0dcc3f63f235ce597539ef3 deleted the
API method _get_tenant_id_for_create.

Commit 526d28c5dba75e517bf833b895b69b840f03c6a4 added in a use
case not relevant for NSX|V3

Change-Id: I039165be0e49e5dd58284750b08b091b120c0468
2016-01-09 02:26:59 -08:00
Janet Yu 4055680555 [NSXv3] Add os-project-name tag
Add a new tag for the name of the project (tenant) that owns the resource.

Change-Id: I3b554cc40bc10ce058c16d83a564d7d0b80d189e
2015-12-18 03:26:23 -08:00
Gary Kotton 0a88c5d7b0 NSX|V3: add in tag resource
Add in a resource type to the tags. This will enable the
admin to know what the correspoinding neutron resource is.

Th elength of the scope is also validate to not exceed 20.
That is the maximum length on the backend.

Closes-bug: #1527208

Change-Id: I3a9a8cac6e7e42a424717d58380b56d32ce5b4f6
2015-12-18 02:51:12 -08:00
Gary Kotton a67d0ad9bd Use the correct _ from vmware_nsx._i18n file
Ensure that the correct _ method is used.

Change-Id: I7ff4cb24bbde47e480dc6dd410b122693bd63ad3
2015-12-06 07:04:17 -08:00
Gary Kotton 4afa13c3c4 Switch to internal _i18n pattern, as per oslo_i18n guidelines
- Guidelines referenced from:
  http://docs.openstack.org/developer/oslo.i18n/usage.html

Change-Id: I938919958525b2db0c8a517b951a23f974a7762e
2015-12-02 06:59:23 -08:00
Abhishek Raut 8ed9217274 Missed l2gw port check in driver
Currently the l2gw port is created as a logical port for the switch
but not plugged in the bridge endpoint for bridging.
This check will ensures that the port is plugged in the bridge
endpoint.

Change-Id: Ifeabd1111fdd1a29c32cab1d4a0fbf8a833a4706
2015-08-24 16:57:58 -07:00
Shih-Hao Li 453994f57e Divide vmware_nsx/services into plugin-specific subdirectories
This patch will create:
vmware_nsx/services/common for common plugin files
vmware_nsx/services/nsx_v3 for nsx_v3 specific plugin files

This is part of new vmware_nsx directory structure proposed in
https://goo.gl/GdWXyH.

Change-Id: I30753aef1c06e2a1b15d336e1d661f3b44ea669e
2015-09-15 15:53:58 -07:00