Commit Graph

1007 Commits

Author SHA1 Message Date
Salvatore Orlando 819c74ef30 Replace occurrences of registry.notify
This change replaces remaining occurences of the notify method with
calls to the publish method.
As NSX admin utilities heavily rely on callbacks, this change also
ensures that all callbacks are now accepting event payloads rather
thank kwargs.

Change-Id: I0450fff486898d6ab74086b7952dc27134cb77e2
2021-10-18 03:24:34 -07:00
Kobi Samoray 8031a85420 NSXV: validate metadata config for AZs
When an AZ is configured with a non-default DVS id, it must have a
metadata configuration as well.
The minimum required is the metadata edge IPs.

Change-Id: Iebbbf6e73975c67876a925a4d54a6a263c4da10f
2021-10-10 17:50:35 +03:00
Kobi Samoray fb6fc96afc NSXV status for out of sync LBs
When a LB exists in Octavia DB, but missing in NSX, its status is never
updated.
The following addresses this condition by collecting the LBs from
Octavia and validating them periodically.

Change-Id: I3c42a934a47532968c65aaeade8210364167f35a
2021-08-25 12:25:35 +00:00
Kobi Samoray 1316d7e43a NSXV: ensure default SG
Ensure default security group during port and SG creation

Change-Id: Ie0a46e08f603eb3647952ed7d2dbd76cc436601f
2021-07-13 11:39:37 +03:00
Kobi Samoray e28f9c13fb Fix pep8 issues
Change-Id: I673536bdb0d769de7e5e8f3e0dd315d81c6d23fe
2021-07-01 15:11:33 +03:00
Salvatore Orlando a9a8bfa13b NSX-V: Fail only if DHCP enabled when updating external subnet
The current logic is forbidding all sort of updates on subnets
associated with external networks.

Change-Id: I89f3ef821534f26b820790b48ba385889498ff46
2021-06-16 01:13:44 -07:00
Zuul 6597b37035 Merge "NSXV: fail attachment of VDRs to flat networks" 2021-06-07 11:11:32 +00:00
Kobi Samoray 9c189e303b NSXV: retrieve DNS IPs from subnet correctly
subnet['dns_nameservers'] is a list of strings, not dictionaries.

Change-Id: I929f5ab4d1eb3d538b9e50d08d13554575eab99b
2021-06-02 08:28:13 +00:00
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
Zuul 07034fcfc1 Merge "NSXV: handle missing SG mapping" 2021-04-28 13:22:34 +00:00
Zuul a36c11a833 Merge "NSXV: Handle requests ConnectionError exception" 2021-04-28 09:13:47 +00:00
Kobi Samoray fe0264d35a NSXV: handle missing SG mapping
When creating rules, the plugin fetches the SG mapping from Neutron DB.
If this mapping is missing, the plugin should issue a proper error and
fail.

Change-Id: Icd00116dc6e81949513db18f16eced8a2b125c7d
2021-04-28 08:59:17 +00:00
Zuul 1d6fbdf15b Merge "NSXV: protect against stale LB bindings" 2021-04-19 14:22:53 +00:00
Kobi Samoray 9f53623d2f NSXV: Handle requests ConnectionError exception
DNS failures cause requests module to raise a ConnectionError exception.
We should issue a retry upon this exception as DNS erros within a
network are normal.

Change-Id: Id543a55fbd7002f839981ba47909546ef229f5f9
2021-04-19 13:27:24 +00:00
Kobi Samoray 25b959bae3 NSXV: Elevate context for router firewall update
Edge firewall might contain FW rules which are originated from various
sources, e.g FWaaS rules, subnet rules, LB rules etc.

When a non-admin user applies a change to the FW config by changing any
of the above, the new FW config should still include resources which
aren't visible to the user. Therefore the context should be elevated.

Change-Id: I8cd3310976708b0bbf1442de7f38ebc06dc8506a
2021-03-30 13:25:02 +03:00
Kobi Samoray 5c68ca7bb2 NSXV: protect against stale LB bindings
When a stale load balancer binding remains in the Neutron DB while the
load balancer was deleted, it causes FWaaS failures.

To protect agains, we take the following measures:
- Use try-catch to ignore the LB edge firewall rule while performing
FWaaS transactions.
- Delete the LB binding while deleting the router, while routers are
used as LB platform.

Change-Id: I3ab60093e3ac8ce6ff1d3557622745484d43b759
2021-03-15 17:15:13 +02:00
asarfaty e499e6c1a9 NSX|V: Fix error message for add router interface
Change-Id: Id7db7e6d6d5ace173d7ebd06000c9692217e0d8c
2021-03-11 04:11:15 +00:00
asarfaty 3dcaa632e5 NSX|V: Fix portgroup provider network validation
In case the physical network is not assigned, the db query
should be skipped or else it fails and raise.

Change-Id: Ief5af76f47e6b037e5fdda707f7fa75f73b0653f
2021-03-02 11:36:57 +02:00
Kobi Samoray f96384fc20 NSXV: make service edge sizes configurable
Allow configuration of default sizes per edge purpose.

Change-Id: I7a8dcc42144edf064435357fb555f5cbe72c92e6
2021-02-17 10:19:04 +02:00
asarfaty abfe98d528 NSX|V: Support pagination in get virtual wires
Change-Id: I1d531d5bee8c852c3221fd0248876f4ba46d355b
2021-02-16 14:04:34 +00:00
asarfaty 09d2de0e75 NSX|V3+P: Do not set default Qos policy on external networks
Change-Id: I9cee1ac13f70268055eaa2598061a6e80b9c94cc
2021-01-21 10:27:04 +02:00
asarfaty 132f006574 Update code to match recent neutron changes
NSX|V3: fix call to _confirm_router_interface_not_in_use
Commit Iea58177cce30d7ce6ba7b36ce5f8375c0985179e changed the api

NSX|V: Fix _make_port_dict api
Commit Ic08e4049f6156c0700ca3c7aee251b6eb0eb97da added bulk argument
to this api.

Change-Id: I6bbe34cfedf731f0711fee45800d9f78247bc6ba
2021-01-17 12:09:47 +02:00
asarfaty 3909366192 V2T migration: update network segment with vni
1. NSX|V admin utils: Add utility to list virtual wires
2. Add network vni field to the api_repaly extension
3. Let policy plugin set the vni value on the new segment
   while working in api-replay mode.

Change-Id: I872edd03cdd1a7ff1422cdc12ea2a1d75b5d0bcb
2021-01-07 06:40:10 +00:00
asarfaty ead7695f47 NSX|V: Fix SG rule validation
Change-Id: I55aef54ff98b650f2dfc2e0de47a1ddec29ef2bd
2020-12-17 10:37:53 +02:00
asarfaty fca41da83f NSX|V: Add remote_address_group_id to SG rules if missing
Neutron added a new rule field that should be initialized if missing

Change-Id: I23fc3afe9625715edfdbf4e7b74f64bd42e7770b
2020-12-10 08:11:17 +02: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 9cc7eae5da V2T migration: add pre-flight checks
Also remove extra address pairs in api_replay, since its only a warning
at the moment.

Change-Id: I31259738f69ce89c08adc0b24c4807a269460be8
2020-11-04 05:26:43 +00:00
asarfaty 26f855f9c9 Remove some pylint exclusions (part 2)
Change-Id: I2047f083af01dd0452f61d9fb807098e0514ff36
2020-10-01 10:25:06 +02:00
asarfaty b6bd7e49d1 Remove some pylint exclusions
Change-Id: I6909c10471039f1e68224679ceeb2867ab5a3a47
2020-09-30 10:32: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
Zuul 3973b7b364 Merge "NSXV: Do not cache NSX version during exception" 2020-08-06 11:24:26 +00:00
asarfaty 06fee9c0d2 Stop using plugin _get_subnet
Subnets are now only consumed via OVO, see commit I57a4508f42820db7876a9a8a63bb4d46e7b7ac28

Change-Id: Ibdbfcc8561861157564ad1cfcc9d73b6c4f5cfb6
2020-07-27 05:58:47 +00:00
Zuul cd16e6bf8c Merge "NSX|V: Add allow icmp6 multicast rules in edge firewall" 2020-07-23 06:32:51 +00:00
asarfaty 00f43c2b63 Remove six package usage
Since py2 is no longer supported, built in methods can replace the
six package usage, as been done in the neutron project

Change-Id: I922963fbbcc0ab263e1f6e56907b73b007015a75
2020-07-19 17:19:31 +02:00
asarfaty 2defc5e7ac NSX|V: Add allow icmp6 multicast rules in edge firewall
Vsphere7 started to block this traffic so adding those rules to be
backwards compatible.
In addition, add admin utility to fix existing edge firewalls:
nsxadmin -r routers -o nsx-update-fw

Change-Id: Ia5c2832e377a1a17ef279191ee91b6fec8f65443
2020-07-11 04:14:37 +00:00
Kobi Samoray 39888393a8 NSXV: Do not cache NSX version during exception
NSX version retrieval may fail due to various reasons. It is incorrect
to cache this value as failure might (and probably) could be temporary.

Change-Id: Ifdd572579b3c52afc24107e147e483188e8030a7
2020-07-09 08:22:19 +03:00
asarfaty 4effe88ac6 NSX|V: Fix init connectivity validation
1. Make the validation optional (If False - only log the warnings)
2. Validate each resource against all clusters and fail only if not
   connected to any

Change-Id: I9abd091fc42d4dbe22e1b806df4d9131ab054726
2020-06-22 11:46:05 +02:00
Kobi Samoray 22e494f2b5 NSXV: allow DHCP reply on DHCP edges
Work around DHCP edge's behavior where firewall is blocking DHCP unicast
replies.

Change-Id: I2ed3de8d665166fed3bc42da56d2a180b070ca0d
2020-05-21 18:47:54 +03:00
asarfaty 51c5072c3d NSX|V: Fix SG icmp rules creation
In addition to the fix introduced in I31141eb7a05ff508acb3cea12d7bdd7d8695d9e1
the icmpcode 0 should also be removed from the rule creation

Change-Id: I380d5e45235fd0033bba924b42c6b83104f17241
2020-03-31 08:21:47 +02:00
asarfaty af0861ce2e NSX|V: Fix security groups rules creation
When updating a section, exising icmp echo request/reply rules cannot have
icmp code field.

Change-Id: I31141eb7a05ff508acb3cea12d7bdd7d8695d9e1
2020-03-22 12:45:29 +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
Zuul 23ba8075aa Merge "NSX|V: Fix get_edges for python3" 2019-12-23 07:33:50 +00:00
asarfaty 0328dea711 NSX|V: Fix get_edges for python3
This api is only used by the admin utilities

Change-Id: Ib362a1bb8208526015f4b82043db0d7262dcddc4
2019-12-22 12:53:24 +00:00
asarfaty 33c79c1a9b NSX|V: Partial support for distributed routers with FWaaS-V2
FWaaS V2 cannot be supported for distributed routers since the
FW rules are on the PLR, but only the TLR has the subnets interfaces.
This patch adds a partial support, assuming all interface ports
have the same policy & rules (as it was in FWaaSv1) by ignoring the vnic-id.
This way customers with distributed routers can migrate to FWaaS v2.

Change-Id: Ieaaf4149d5daa07341effdc480ae453a67d5b6bb
2019-12-22 06:23:42 +00:00
asarfaty b9dcadc148 Add logging in get_ports for all plugins
This will help debug performance issues

Change-Id: I60cfc8261c7b5f78a907d54822ce9fe126f2fc0d
2019-12-16 06:46:22 +00:00
Kobi Samoray 6966160da6 NSXv: evaluate NAT rules correctly
Change-Id: Ic558a08cd629e3b2b02190bb5fff9d4b5ad05396
2019-12-10 16:36:36 +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
Kobi Samoray 1c0f51d54f NSXV: fix router static routes for non-admin users
Non-admin users could not set static routes as neutron didn't fetch the
port info for the external network.

Change-Id: Ib266b6348d450b6b73064aeaf0b79a443c46a1ee
2019-11-07 15:24:14 +02:00