28 Commits

Author SHA1 Message Date
Adit Sarfaty
7ebfb1062e NSX|V3: Refactor network & port validations
refactor the validation code for network & port create & update operations
and moce those to the common plugin code.
This will be used later by the policy plugin code.

Change-Id: Ia461851022a20f07cb50d05dc73cc37f48752164
2018-09-06 09:06:19 +03:00
Adit Sarfaty
bc5ceb6ac8 NSX|V3: Disallow port-security on port/net on ENS TZ
Raise an exception if a port or a network creation/update enables
port security on an ENS transport zone.

Change-Id: Ifbffec35c321d1ccf8c1aa00b4b3ed33140fb218
2017-10-10 14:49:11 +00:00
Zhenmei
53d1bd0e2f NSXv: Support ipsec VPNaaS on nsxv driver
Change-Id: Id3fd4da7e4dd4cac4eb2e32024c0d8242b85a0bb
Co-Authored-By: Roey Chen <roeyc@vmware.com>
2017-07-11 06:03:19 -07:00
Adit Sarfaty
6716b68bf0 Revert "Remove neutron-fwaas exception usage"
This reverts commit 2dd98c36652ed9c216992c37172af055f5ad7370.
And uses the neutron-fwaas exception instead.

Change-Id: I3934f4f0b6e4df3e51ad3038ba6c8a5c528697c2
2017-06-28 08:11:08 +03:00
Tong Liu
2dd98c3665 Remove neutron-fwaas exception usage
As of patch I677721aeada6fd74e8201c7f308771c887b2a1e9, the exception
module has been removed from upstream neutron-fwaas repo. This
breaks our neutron_fwaas driver and unit tests. Remove dependency
of that module in this patch and use the exception defined in
vmware_nsx common instead.

Change-Id: I9fb9df6505fb7493be98723988dc4f6288af1603
2017-06-27 16:39:06 +00:00
Roey Chen
5f0434ea51 NSXv BGP: Add more unittests
Also adding a check that only external network could be associtated with
a BGP speaker

Change-Id: I4f19f305c37b98f9dad8a79294e1ec198e8da22a
2017-06-08 04:38:12 -07:00
Roey Chen
d16c172389 NSXv BGP: Allow BGP only on networks with address-scope
Change-Id: I08c6ab053add7fae2c6415346a2dd638fcb9e689
2017-05-14 04:20:27 -07:00
Roey Chen
f016eb2bdd NSXv: Enforce address scopes for no-NAT routers
Change-Id: I087dbde530d14c5cd2b96629b34aef94666ebbc8
2017-05-14 02:18:44 -07:00
Roey Chen
868d2701bc NSXv BGP: Fixing get-advertise-routes
Change-Id: I4db58d6b8c9f103e4a6d66c2868a8ce5e9375578
2017-05-08 05:28:42 -07:00
Adit Sarfaty
388106758b NSX-V| improve AZ validation
Validate each moref in the availability zones specifically by the plugin.
Also - do not validate the same morefs multiple times,
in order to reduce the number of backend calls at init.

Change-Id: I161a118c9d4f7a4d38745ef5e056a001c6d13614
2017-03-26 13:37:07 +03:00
Anna Khmelnitsky
6e1a21881e NSXV3: Initial client certificate auth support
Client certificate authentication is disabled by default.
To enable client auth, define the following in nsx.ini:
nsx_use_client_auth = True
nsx_client_cert_storage = nsx-db
nsx_client_cert_file = <file to store certificate and private key>

To enable client auth in devstack, define the following in local.conf:
NSX_USE_CLIENT_CERT_AUTH=True

This commit covers only DB type of cert storage. Barbican storage
and imported cert will be added later. Also planned for near future:

    reload cert from DB if NSX connection failes due to bad cert
    show warning when cert nears expiration
    delete cert file from file system on neutron exit

Change-Id: Ic70a949b740d9149d71187b02640d3071a3e0159
2017-02-02 09:39:18 +00: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
Adit Sarfaty
2f2d770b9b NSX|V add edge_ha per availability zone
Support different edge_ha flag per availability zone

Change-Id: Iff1b9d76a62d23d600b57ad83d868c4de2b04ee9
2016-07-20 10:58:49 +03:00
Abhishek Raut
00610df088 [NSXv3]: Tap-as-a-Service NSXv3 driver
This patch adds support for Port Mirroring feature for
NSXv3 plugin. This driver implements the Tap-as-a-Service
APIs and maps the tap-flow and tap-service resources
to backend PortMirroring objects.

Closes-Bug: #1598318
Change-Id: I5719fbbacfd3ec39250c59ec73cac2dc84af596d
2016-07-09 13:41:39 -07:00
Roey Chen
ddfb880d5a NSXv3: Support CH nsgroup membership using dynamic criteria tags
CH release adds new way to associate resources with nsgroups by
creating specific tags on the resources.
We would like to support this feature in the plugin for better performance.
This patch make use of this feature to associate logical-ports with nsgroups
(Neutron ports with security-groups), for every LP-NSGroup association,
a special tag will be added to the LP.
The plugin will use this NSX feature only when supported by the NSX
version, and given that the designated boolean config option is set to True.

Change-Id: I2a802bc314d98dba9ecc54191fcbd7330f183e12
2016-06-30 01:53:05 -07:00
Adit Sarfaty
1b331422a0 NSX|V3 QoS: handle illegal max bandwidth
The backed does not allow max bandwidth < 1M.
Since the switch update is done from a notification callback,
we cannot fail the user action.
Instead, we log a warning, and use the minimal possible value.

Change-Id: Ic5aa7f933d7faf959bafd7f3f589fe29d6ded06d
2016-05-10 11:27:10 +00:00
Adit Sarfaty
6fbf7ff64c NSX|V3 add qos support for ports
Add support for the qos service in NSX|V3, including:
- Attach/Detach qos policy to a new or updated port
- Allow qos configuration on ports with internal networks only
- Update the switch profile with the BW limitations and tags
  through the qos notification driver
- Add a new mapping db table to link the policy id and the
  nsx-v3 switch profile id

For this to work, the following configuration should appear under the 'qos' section in the neutron.conf:
notification_drivers = vmware_nsxv3_message_queue

Change-Id: I4016de756cebe0032e61d3c2a5250527e44b49e4
2016-04-20 09:11:41 +03: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
640ac29a1e Fix log exception
When running the test
...test_cluster.ClusteredAPITestCase.test_cluster_proxy_stale_revision
we get the exception below:

Traceback (most recent call last):
  File "/usr/lib/python2.7/logging/__init__.py", line 851, in emit
    msg = self.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 724, in format
    return fmt.format(record)
  File "/usr/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/usr/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
  File "/home/gkotton/vmware-nsx/.tox/py27/local/lib/python2.7/site-packages/neutron_lib/exceptions.py", line 48, in __unicode__
    return unicode(self.msg)
AttributeError: 'StaleRevision' object has no attribute 'msg'
Logged from file cluster.py, line 418

Change-Id: I4ce6b90b3dbd2fd1a2987fafb1034fdd0cd05a60
2016-02-15 01:39:59 -08:00
Abhishek Raut
511295b8c6 [NSX-v]: Update existing vague exceptions
Use NsxResourceNotFound exception to detail the resource name and
resource ID not found on backend.

Change-Id: Ib7749380672e54f452b5721da2dd2d92feceb618
Depends-On: Ibba7b4997b89ecabfe5fba162f7b60c3c9a889c8
2015-12-29 22:39:25 -08:00
Abhishek Raut
eda75ec535 [NSX-v]: Introduce a more user friendly exception
This patch proposes the addition of new exception in vmware-nsx
repo for Resources not found on the backend. Now we can pass the
resource name and resource ID to this exception. This patch
specifically fixes the error message for physical network not
found on the backend.

See bug 1604490 on bugzilla for more details.

Change-Id: Ibba7b4997b89ecabfe5fba162f7b60c3c9a889c8
Fixes-bug: bug/1604490
2015-12-29 22:35:47 -08:00
Roey Chen
67c9b09efb Better error message when reaching security-group maximum capacity
Change-Id: Iebb230f33b75a81e8d58796e4911b9b8ce92f8d0
Closes-Bug: #1540101
2016-02-02 04:36:13 -08:00
Boden R
a59c9c4d0e Address pair validation for NSX v3 plugin
NSX v3 does not support CIDR notated IP addresses for
port IP address bindings; thus something like
9.10.11.12/24 is an invalid IP address to use for an address
pair. This patch adds a check to ensure IP address are
of the proper format.

Additionally this patch adds logic to the port update
flow in the case where a backend error occurs on port
update. The logic contained herein now reverts the
address pairs to ensure they are in sync with neutron.

Unit tests are also included.

Change-Id: Ia0c9187b1f6e304690e1a56e94c47fe069179645
Closes-Bug: #1531558
2016-01-14 10:31:51 -07: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
Zhenmei
791cb44ddf Check if l2gw has been used before creating l2gw-connection
Only single vlan is supported for one l2 gateway edge, so only one bridge can be created
in one edge. If user tried to connect multiple network to one l2gw
, the exception will be raised.

Change-Id: Ib17174b9735ca536b3701fdba4212123d51a0b23
2015-11-24 21:44:48 -05:00
Boden R
a03cec98da NSX v3 API client error propagation
Currently the NSX v3 REST API client masks the
backend NSX API error upon and invalid response.
This results in a very generic error message to consumers
(including the CLI) when a backend error happens.
This patch exposes the backend error message if
possible which provides more details of the issue
to consumers.

Change-Id: I215352d649b6579d6075cb104a7d311a7f1ffa66
2015-10-22 09:53:32 -06:00
Zhenmei
0fc47eabf5 NSXv driver for Layer 2 gateway
This patch adds the backend driver to support Layer 2 gateway
API calls for NSXv.

Partial-bug: #1481087

Change-Id: Iea8b5390300dfd653b275c4389bc0d12bc4cc59f
2015-09-18 01:06:29 +08:00
Shih-Hao Li
d8eeda9baf Move vmware_nsx/neutron/plugins/vmware to vmware_nsx
This is part of new vmware_nsx directory structure proposed in
https://goo.gl/GdWXyH.

Change-Id: I60d6ef62eb724df71dfda90137e00f107e220971
2015-09-14 18:51:57 -07:00