Commit Graph

61 Commits

Author SHA1 Message Date
Kobi Samoray 9e0db6030e NSXV: fail attachment of VDRs to flat networks
NSXV distributed routers cannot be attached to flat networks. Yet
OpenStack should fail with an error instead of letting the backend
transaction fail.

Change-Id: If2f0c4c47d049ec37348d6cea32f0bb069a0c9b2
2021-05-13 19:26:52 +03:00
asarfaty 5da150fcd2 Integrate with neutron DB engine facade migration
integrate with neutron patch Id3f09b78c8d0a8daa7ec4fa6f5bf79f7d5ab8f8b
And also skip new tests added in I99681736d05eefd82bdba72b3866eab9468ef5dd

Change-Id: I8b119bc69cc87185ea77646e70135c5984200038
2020-11-30 10:29:46 +02:00
asarfaty 50afa71853 Fix broken Victoria branch
1.Upgrade pylint to 2.4.4, add exclusions to the tests, and
  fix some lint errors in the code

2. Fix user creation with GRANT in MySQL 8.0(Ubuntu Focal)
In Ubuntu Bionic (18.04) mysql 5.7 version used to create
the user implicitly when using using the GRANT.
Ubuntu Focal (20.04) has mysql 8.0 and with mysql 8.0 there
is no implicit user creation with GRANT. We need to
create the user first before using GRANT command.
See also commit I97b0dcbb88c6ef7c22e3c55970211bed792bbd0d

3. Remove fwaas from the zuul.yaml
4. Remove DB migration test which is failing ue to FWaaS migration
with py38
5. Fix cover tests python version in .tox
6. fix requirememnts

Change-Id: I22654a5d5ccaad3185ae3365a90afba1ce870695
2020-09-21 15:31:18 +02:00
asarfaty 5779e3bfc2 Fix some typos
Change-Id: Id1f18847fafd769f11c23924fa50781d272d0fb1
2020-01-05 14:24:03 +02:00
asarfaty 3a5c2abc9b Add common code for network interfaces queries
Change-Id: Id5205e31b550078db2ae34ffe3dde94d08e9f26f
2019-12-26 14:24:27 +02:00
asarfaty afc3258566 NSX|V: Fix distributed router validation
Validation over router size was wrong

Change-Id: I4eb8160552fe071795804021f1f002f844f43584
2019-12-08 10:36:23 +02:00
asarfaty 511404073c NSX|V: Fix error handling for distributed router interface
1. No need to rollback the interface creation in teh distributed router
driver. It is rolled back on the plugin level. the Double rollback causes
a new error to be raised.
2. In the plugin level - do not alert on the rollback faliure.
It may be legit
2. In the plugin level raise a proper error to neutron, instead of the
internal one.

Change-Id: I129f595d6cd17cd0af62fc9e2855451b97e73ff0
2019-11-13 11:21:49 +02:00
Adit Sarfaty 420fc333a1 NSX|V: prevent updating router size
Changing router size is allowed only for exclusive routers.
Raise an error for this in case of shared or distributed routers.

Change-Id: I522db0a1a2160550f4a424b5b2939fd43d9b758e
2019-05-19 18:50:13 +00:00
Michal Kelner Mishali 7a402d2bdc NSX-V: fix exception for distributed router
When trying to add interface to another distributed
router, a proper message should notify the user
that this is incorrect and not supported.

Change-Id: If9230c821665813939e676fbaafe296d42cac498
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2018-06-12 14:36:19 +03:00
Boden R 50678f3e5a use retry_db_errors from neutron-lib
The externally consumed APIs from neutron.db.api were rehomed into
neutron-lib with https://review.openstack.org/#/c/557040/

This patch consumes the retry_db_errors from lib in prep for
https://review.openstack.org/#/c/570016

Change-Id: Id5cf5c0abe60fa1f3ca6193980e7f66cb3d48e1b
2018-05-28 04:33:03 +00:00
Adit Sarfaty 9fa3ce5990 Fix some typos
TrivialFix

Change-Id: Ie7e88e01c4424450a878b82409229f2ae99bf377
2018-04-29 11:35:31 +00:00
Adit Sarfaty 9743a4d0e4 Fix pep8 new warnings
A recent change in pep/pycodingchecks introduced new warnings as part of
the pep8 target that causes pep8 to fail now.

This patch fixes code that issued warnings W503,E731,E266,E402

Change-Id: I57c035440bd847193ea5f8a8078016fb9baa3c31
2018-04-11 09:00:58 +03:00
Gary Kotton 9a7bf3543a Retry with stale DB values
In the CI we were seeing failures with _update_router_gw_info due
to stale DB resources. Posting this as a stopgap until the patch
https://review.openstack.org/520324 lands

Change-Id: I9c899a2edb59ead81d9a2bdf728ee7207d4da0b0
2017-11-16 01:53:09 -08:00
Gary Kotton 39bf54f55f NSX|V: prevent V6 subnet from being attached to a DVR
DVR currently does not support IPv6

Change-Id: Icde4b6726fabcb53ff075a882f2a2c9f12472f59
2017-09-11 08:18:20 -07:00
Kobi Samoray df8f34c66d NSXv: use regular DHCP edges for VDR metadata
VDR-connected networks were using designated DHCP Edge appliances
to provide metadata.
That was necessary before we introduced option 121 - which can be
used for route injection, which directs metadata traffic towards the
DHCP Edge.
This change removes some redundant code which is supporting metadata
in the old manner.
The patch deprecates supports of older versions of NSX which do not
support insertion of host routes which is required for the change.
Therefore dhcp_force_metadata config parameter has been deprecated.

Change-Id: I6b5e2acf09ce61c87d8ae97471955599cddf320b
2017-06-28 07:03:25 +00:00
Gary Kotton 881bc26b3a NSX|V: prevent deadlock with subnet creation and deletion
Ensure that we treat the locks in the same order with the
delete and create operations.

The fix above result in a deadlcok due to a change in neutron
where ipam delete call port_update. This conflicted with
commit d89eba1a85.

To ensure locking for this we make use of a new lock for the
DHCP interfaces.

Change-Id: I6c3f25ab40247853024560c00d3faa106e5d90b8
2017-06-08 09:32:22 +00:00
Roey Chen f016eb2bdd NSXv: Enforce address scopes for no-NAT routers
Change-Id: I087dbde530d14c5cd2b96629b34aef94666ebbc8
2017-05-14 02:18:44 -07:00
Adit Sarfaty 3223cc5943 NSX|V Fail dist router set gw if edge not found
Sometimes during gateway-set the distributed router creation is not done yet,
and the edge-id is not found.
In this case we should make sure to produce an error before the 'super' method
adds the new GW to the DB.

Change-Id: I6faa824be3f70ed6f105e12b4fa2614e6f3e5c5f
2017-04-30 08:49:53 +03:00
Gary Kotton a7ba4590f5 NSX|V: fix distributed router interface deletion
Router interface deletion would not have the correct AZ. This would
result in an exception with the DLR.

Change-Id: Ic403692bf657a04a9bc60aa987f389b4dbbeafc5
2017-04-19 07:23:47 +00:00
Gary Kotton 01d33ffa65 Integration with new neutron code
1. Use new enginefacade + l3_db breakage
Use reader and writer for db operations.
Partially-Implements blueprint: enginefacade-switch

2. Fix the callback pass for _prevent_l3_port_delete_callback
which was changed in commit Ia8ac4f510c003667cac95f76dea0e9ae55159878

3. QoS driver integration
Commit I5f747635be3fd66b70326d9f94c85a6736286bd2 removes the qos
notification driver.
Fixing the nsx-v and nsx-v3 to work only with the regular driver

4. _get_extra_routes_dict_by_router_id was removed by
Ia815d6c597730bd5cb49455e7409ca747a4cc22c

5. Floating IP association without subnet gateway IP
not supported by our plugins.
Added in commit If212c36d918ed57400a53f4b5fa1925b3d1fa6fd

Co-Authored-by: Adit Sarfaty <asarfaty@vmware.com>
Change-Id: I277ec5c38c5895337011019f71d586b254bfafde
2017-04-18 18:56:05 +03:00
Roey Chen cb9b23aeae NSXv: Adding notifications for router service edge events
Adding two notifications for events AFTER_CREATE and BEFORE_DELETE to signal
subscribers a router is being associated or disassociated with a service edge
and a valid external interface.
This is required for integration with Neutron dynamic routing BGP
plugin, for supporting shared routers lazy allocation and to notify when
external interface is added to an edge (using ROUTER_GATWAY
notifications would not work as relevant plugin code structure doesn't
permit it).
Also moving calls for base class (remove/add_router_interface and
_update_router_gw) outside of edge lock, as these will invoke
notifications for subscribers which need to lock the edge as well and we
want to have a consistent behavior.

Change-Id: Ifbfa959526c5b5e3add94708d96517935e5cb3fa
2017-04-09 06:18:33 -07: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
Kobi Samoray 359ad6a8bf NSXv: Subnet create and attachment concurrency
Address subnet create and VDR attachement concurrency issues.

Change-Id: Iece2c486c3b2006c6ccbe0acb18a93d208753f90
2017-03-10 12:23:25 +00:00
Adit Sarfaty 2808ededb7 NSXv: Add metadata configuration to the availability zones
The next global configurations are now added also per AZ:
- mgt_net_moid
- mgt_net_proxy_ips
- mgt_net_proxy_netmask
- mgt_net_default_gateway
- external_network
- vdn_scope_id
- dvs_id

In case any of them is not defined in the AZ section, the global value will be used.

Change-Id: I5fca433fb86163cee84e3b9fc54182017a5f266b
2017-02-12 08:44:33 +02:00
Adit Sarfaty 2e113b305a NSXv: Fix dist router call to add fw rules
Change-Id: Ic7b9e88cf619487bcb51c0169e9ac7ebc0680799
2017-01-31 08:46:28 +02:00
Jenkins 34e165181a Merge "NSX-V| add firewall rules to dhcp edge" 2017-01-25 01:01:31 +00:00
Kobi Samoray a6ecc3866c NSXv: Do not lock RPC filter update
This results a deadlock

Change-Id: Ib68a251a768da299aa874e267fcf60faf9454241
2017-01-24 03:49:43 +02:00
Adit Sarfaty 157b118c00 NSX-V| add firewall rules to dhcp edge
When a new dhcp edge is created for a network that was just detached
from a distributed router, FW rules were not created, causing the
metadata not to work.

Change-Id: I4a60e45f4e5e16dafb13649b431d1f7fbacc9ab1
2017-01-24 03:22:09 +02:00
Kobi Samoray df95b51df3 NSXv: lock DHCP edge while making changes
When a network is attached to a VDR, we replace the DHCP edge which
the network subnets are using.
While doing so, a lock should be obtained on the DHCP edge.

Change-Id: Ib7b2975d00af816c4104fdac5bd68c53a7bd2320
2017-01-24 01:52:00 +02:00
Gary Kotton 03d62f94e3 NSX|V: ensure that FW rule updates on edge are locked
If this opertaion happens concurrently then therecould be a
exception on the edge.

Change-Id: I33542ee956b35b3616748b8d44017eb74d439bfa
2017-01-18 09:33:06 +00:00
Gary Kotton 548776e81e NSX|V: do not connect DVR to DHCP edge if not DHCP enabled
Ensure that the subnet is not attached to a DHCP egde if there is
no DHCP enabled on the subnet

Co-Authored-By: Kobi Samoray <ksamoray@vmware.com>
Change-Id: I480267ee98efb4f88d8b75b732af6d2f82cc0267
2016-12-14 15:07:27 +00:00
Adit Sarfaty 9ff79d003b NSX|V update router edge when gateway subnet changes
When a subnet gateway changes, and this subnet is the gateway of a router
we need to update the next hop on the router edge

Change-Id: If232ac89c880e8a501466abbfaae7b954609aa0d
2016-12-08 08:43:39 +02:00
Kobi Samoray 2b1f21cbcb NSXv: Make VDR transit net configurable
Allow the admin to set a global CIDR for VDR transit network which
connect the TLR with the PLR.
Value is global: set at the config file and will be used for all the
VDRs.

Change-Id: Idb0ac4c5629cfc00bb2c434a1771b4c4a551071e
2016-11-15 16:52:59 +02:00
Gary Kotton 1dec3bb2ae NSX|V: add context to missing configure_router_edge
Commit fe72c1bd0c added context to
the method above. Here we do 2 things:
1. add in the missing context to method calls
2. ensure that context is the first parameter to be consistant

Change-Id: Iad7f575a3a212f123ecdf7a4827e2ab61993a49b
2016-10-04 09:12:47 -07:00
Kobi Samoray 2060fac587 NSXv: DHCP reconfigure on VDR interface removal
While removing the last DHCP-enabled subnet interface from VDR, a
regular DHCP edge should be attached to the subnet's network.

Change-Id: Ie87fb708c561fa54a457f006f60d407a369dd0bf
2016-09-19 06:37:40 +00:00
Kobi Samoray fc45beeb03 NSXv: Configure metadata when detaching from VDR
When a network is detached from VDR and attached to a new DHCP Edge,
metadata LB should be configured on that Edge.

Change-Id: I74e11526b74c0699d91ea0ba9e34db5b63ab0a16
2016-09-15 14:25:30 +03:00
Kobi Samoray 61dee63240 NSXv: recover from bad VDR DHCP bind case
When a DHCP bind remains in DB due to breakage, we clean it up on
router delete.

Change-Id: Ifc421adb0404ffe85149187cf8e7d5fb5587d483
2016-08-24 13:30:32 +03:00
Shih-Hao Li bdd0700c2f Fix failing L3 test
- test_router_add_interface_dup_port
- test_router_add_interface_port_with_metadata_access
- test_router_add_interface_delete_port_after_failure

Change-Id: Ifb5becc414aa084b21119e09eab3e703792aa190
2016-08-15 16:39:17 -07:00
Kobi Samoray 874f248c5a NSXv: eliminate task use from update routes
Make update routes calls synchronous.

Change-Id: Ic70a39977b7c8560bdc3a7b70de41fa5192ac47d
2016-08-02 17:53:24 +03:00
Adit Sarfaty 97fce20f87 NSX|V Distributed router PLR creation with availability zones
Fix a bug that caused PLR to always be created with the default availability
zone

Change-Id: If1d2ea4a098cd6a4c78dfb99cee75315a97e68af
2016-07-26 16:18:55 +03:00
Adit Sarfaty 654b12fd55 NSX|V Extend Availability Zones to support data stores
The availability zones support will now include also data-store ids.
The configuration will include a name for each availability zone, resource pool
ID, datastore ID and optionally also HA datastore ID.
The user can choose a hint from this list when creating a router or a network.
The relevant edge appliances will be created using this data.

DocImpact: New format for the configuration parameter availability_zones under nsxv
Should include a list of availability zones. For each of them name, resource pool id,
datastore id and optionally also HA datastore id.

Change-Id: Icb72f6f674b8610687a6be730161a206d4c76257
2016-07-13 11:33:12 +03:00
linb 721307fea1 Fix add same network on different type routers failed
This critical error is introduced from commit
336431d016d163f3e46cb2aeff68fcca7caf68e7, which failed to filter out
non-distributed routers and instead get all routers leading to adding
network on different type routers failed.

Change-Id: Iff44d96db80016277c0ee87d2a2d11a687738e4c
2016-06-16 07:41:05 +00:00
Adit Sarfaty b2858f8719 NSX|V router create with availability zones hints
Add support for availability zones hints on routers creation
- The router will be created on an edge that belongs to the requested resource pool
- The nsxv_router_binding db table has a new column for the edge resource pool
- New nsxv configuration: availability_zones which should contain a list
of resource pools ids, that can be used as hints

DocImpact: New configuration parameter availability_zones under nsxv

Change-Id: Ib34689d554dafe25f62a045feebe9eed68d2174d
2016-05-24 08:38:26 +03:00
Adit Sarfaty dc6bb74134 NSX|V rename distributed router plr edge when router is renamed
When renaming a distributed router, we should rename the plr edge
too, if it exists

Change-Id: I1639ec143510a9a4416b46c19713b669fff18071
2016-05-19 11:51:48 +03:00
Jenkins 0d167e0d44 Merge "NSX|V rename backend edge name when router is being renamed" 2016-05-12 20:48:02 +00: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
Adit Sarfaty 57a5d18e43 NSX|V rename backend edge name when router is being renamed
when exclusive/distributed router is being renamed, also rename the backed edge

Change-Id: Ida0a96ec8b33d990a8ac0ba61982ec58465678c7
2016-05-11 08:37:48 +03:00
Adit Sarfaty f2ea6574c8 NSX|v fail adding external subnet/port as a router interface
We cannot support adding an external subnet/port as a router interface
at the backend, so it should fail. Adding thoe as a gateway will still
work

Change-Id: Ife2fe386bda96d1e748030d96aee5793b2d8e498
2016-05-04 16:29:46 +00:00
linb 0680a76886 Router intf/gw error enhance
When we add_router_interface or update_router_gw ops, plugin inside may
occur unexpected errors. For this case, plugin needs to try to clear error
configuration except for raising error.

Change-Id: Iadfea91c26358417e314ae4b2beeba5ab7953331
2016-04-26 22:28:44 +08:00
Jenkins e0bd8f4c87 Merge "NSX|v update edge device when the user changes the port ip address" 2016-04-05 09:12:23 +00:00