Commit Graph

239 Commits

Author SHA1 Message Date
Salvatore Orlando 60a7ede0f9 Remove check for external CIDR overlap
The constrains where T0 uplinks must not overlap anymore
with external subnets does not apply anymore.

Therefore this change removes the validation check upon subnet
creation, thus saving a round trip to the NSX backend.

Unit tests for validating this specific constraint are removed as
well.

Change-Id: I65cb6ae7822e9a03f05fba5d4fd4d4dc5202526a
2021-08-24 09:43:38 -07:00
Salvatore Orlando 73bf4bbe31 NSX-P+v3: Better handling for NSX address bindings
When allowed address pairs are specified they can overlap with
fixed IPs, especially when they specify CIDRs.
The plugin should not fail to create/update neutron ports in this
case, but should instead properly handle NSX address bindings.

Change-Id: I145950ebe5769490f1c05729d94869dfa2e7d856
2021-07-07 15:36:38 -07:00
Salvatore Orlando 607afed94d Relax IPAM validation for port IPs
Allow for setting multiple IPs from the same subnet, only if
the subnet is v4 and DHCP is disabled for the subnet.

Still make sure at most 1 IPv4 and 1 IPv6 subnet can be
configured.

Change-Id: I1113a24fa8cc09892bc89917d50c64f6a72c0dab
2021-05-07 15:32:59 +00:00
asarfaty 2f11462faf Fix unit tests
Commit Id5d8ac09a38c656619f88a6f87b8f384fe4c55a8 broke some unittests

Change-Id: If87a8b5acd5d0e21d5971aeec1cd783ba6b7b6ba
2021-01-11 07:35:38 +02:00
asarfaty 1ed3a3a895 NSX|V3 add test for ipv4 cidr address pairs
Change-Id: I3be5aa2dba4c1a926de1337beacd28fc50a33b4a
2020-11-22 05:11:20 +00:00
asarfaty e7f89bf63c Skip new unsupported unittests
Commit I054296c790b697198550acbeae29546758b422c2 added IPv6 related
test which is not supported by the v/v3 plugins

Change-Id: Ia30bd8aca47397c2ea2fb3c55f6a559ef2f22a91
2020-08-05 10:07:24 +02:00
Adit Sarfaty 4652cf44a3 Revert "NSX|V3+P: Address pair ip cannot duplicate the port fixed ip"
This reverts commit 7d4e6ee4cd.

Change-Id: I3f0b88e12f1e8d87bbdecc0f045db2ba002ede03
2020-07-15 07:39:32 +02:00
asarfaty 5d2837c83a Removing dependency on the "mock" package
Now that we are python3 only, we should move to using the built
in version of mock that supports all of our testing needs and
remove the dependency on the "mock" package.

Also see commit: Ifcaf1c21bea0ec3c35278e49cecc90a101a82113

Change-Id: I58da980351fe14357c210c02eb167a6c0af9d09e
2020-05-10 17:21:14 +02:00
asarfaty 7d4e6ee4cd NSX|V3+P: Address pair ip cannot duplicate the port fixed ip
Also exclude some other illegal ips

Change-Id: I81da2adf33d11b753d2f2ad862101d0bf94d53de
2020-05-07 09:33:40 +00:00
asarfaty cdec722d44 NSX|V3: Depracate config disable_port_security_for_ens
This config is only relevant for NSX version before 2.4.0, which
are no longer supported in this branch

Change-Id: I01c920230b537f20e3c3306c5653361ef7f1ac8c
2020-04-13 09:18:29 +02:00
asarfaty 9b36336e21 NSX|P: Fix port security update for network
Change-Id: Id576ea0bc2e9c3dff1f1ba683ba26f1e30dded44
2020-04-10 17:55:10 +02:00
asarfaty 5b84dd5e4d NSX|P: Support policy DHCP v6
Change-Id: Ibe4936b6f0b64e67cb3c7838d0f1a16304eb1180
2020-03-19 12:09:34 +00:00
asarfaty d1f41da8b5 NSX|V3: Fix broken unit tests
Commit Ibad52cca60131e970447536fd22c4f4440c66d34 groke the unit tests
by removing a mock that is needed by the plugin tests.
Adding back the mock in the plugin tests context.

Change-Id: I85c191c3c15aedc0740cb3c23990c0ea0b646fe7
2020-03-01 14:10:01 +02:00
asarfaty e68b87b176 NSX|P: Support policy DHCP
IPv4 support for Policy DHCP depending on the NSX version & on config.
Including devstack support for configuration & cleanup, and admin utilility
for migration from MP implementation to Policy one.

IPv6 support will follow in a future patch.

Change-Id: I01bfb5bd530c63ca8b635bbebcac47659187077e
2020-02-13 07:26:35 +00:00
Zuul 27a93cb2e6 Merge "NSX|V3+P: Fix MDProxy TZ validation" 2019-10-22 06:35:53 +00:00
Adit Sarfaty 164bd88795 NSX|V3+P: Fix MDProxy TZ validation
Checking if the TZ is valid shoul be done for all the transport nodes
togather.

Change-Id: I8287c8dcd1194bca56dd22370dfbc704654033c0
2019-10-13 12:33:31 +03:00
Adit Sarfaty 392a695bbd NSX|v+v3+p: Allow resetting port binding host
Change-Id: Ic9f3f080bbf51a04cea601b2c4b0614b9b5c4e33
2019-10-08 11:04:51 +03:00
Adit Sarfaty 95db356fc5 NSX|V3+P: Add vlan-transparent flag to port vif details
Change-Id: I984f1e06b69f98c3e7aaca4db70a76725919e344
2019-09-09 10:25:32 +03:00
Boden R eedbcdd03b use payloads for ROUTER_GATEWAY events
This patch switches the code over to the payload style of callbacks [1]
for PORT ROUTER_GATEWAY events for those that are not using them yet.
The unit tests are also updated where needed to account for the
payload style callbacks and publish() method. Finally the patch
normalizes the passing of gateway IPs which are currently referred to
as 'gw_ips' and 'gateway_ips' depending on the event; now all events use
'gateway_ips'.

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

Change-Id: Ibc255de79443e908cc3615a8e1cb108757f80011
2019-08-07 04:37:02 +00:00
Adit Sarfaty 48821d139c NSX|V3+P: Support QoS on ENS networks
Depending on the backend version

Change-Id: I33af8879a519a896b1d19e3dbbc0f007e3110235
2019-06-10 15:05:59 +03:00
Boden R 5362c65416 update bandit, hacking and flake8 requirements
This patch bumps the hacking, bandit and flake8 requirements to match
suit with similar work (ex [1]). It also updates the code to fix a few
new pep8 errors as well as adds a local tox target for
requirements-check-dev.

[1] https://review.opendev.org/#/c/658245/

Change-Id: I6caeb52dc1a5842338ec989a742ae5989608e0da
2019-05-31 08:42:37 -06:00
Zuul 4b3d0e9446 Merge "NSX|V3+P: restrict associate floatingip to router interface/DHCP ports" 2019-05-26 09:37:12 +00:00
Adit Sarfaty 46363e8d2f NSX|V3+P: restrict associate floatingip to router interface/DHCP ports
Change-Id: I9f79dcb5d12c9eda3e7cfa4b43bfbc6c121491a3
2019-05-23 08:30:24 +03:00
Adit Sarfaty f72324d397 NSX|V3 Fix dhcp-relay validation
When DHCP relay is configured, a compute port cannot be created
without a router attached to its subnet.
Due to an error in the validation, all compute ports creation
was blocked.

Change-Id: I6016d7015376c280a36b716f3e478d488988b237
2019-05-22 09:31:11 +03:00
Adit Sarfaty d753ec6945 Remove neutron-lbaas support & dependencies
Commit Ia4f4b335295c0e6add79fe0db5dd31b4327fdb54 removed all the
neutron-lbaas code from the master (Train) branch

Change-Id: I9035f6238773aad0591436c856550b7a5e01e687
2019-05-19 11:16:45 +03:00
Michal Kelner Mishali 5454b916fb NSX|V3+P: Change max allowed host routes
Change number of max allowed host routes to 26.
option121 is set as 27, but there's 1 host route set by default.
Fixing test.

Change-Id: I660ee1f710dd84fe3e91122a009d520d0341f261
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2019-05-16 09:47:27 +03:00
Anna Khmelnitsky 79dd8edae5 NSX|V3+P: Fix HTTP response code for cluster down
This change removes ManagerError from fault translation. ManagerError
is too generic and would pull in all child classes to be translated
as bad request, which is not correct for temporary errors such as
ClusterUnavailable. Explicit child classes should be added to the map
instead.

Change-Id: I5fb4bbcabd6540f30f4d30732bfb704680b5ffa9
2019-05-07 07:51:14 +00:00
Anna Khmelnitsky ac06b1b985 NSX|P: Update slaac config on router
In neutron, slaac is enabled per subnet. However on policy
slaac is router configuration.
In order to avoid another passthrough API, router will be
configured with slaac profile if at least one of its subnet
has slaac enabled.

Change-Id: I7a055aa4d73425011c22248c8d7d9d2e0a383dc8
2019-04-10 13:35:07 -07:00
Zuul 277422e530 Merge "NSX|V3+P: Ensure router GW & interfaces do not overlap" 2019-04-03 11:15:32 +00:00
Adit Sarfaty 1a607f7941 NSX|V3+P: Ensure router GW & interfaces do not overlap
The NSX backend will fail to add NAT rules in case the GW network
and the interface networks overlap.
This patch will ensure that the GW and interfaces do not overlap

Change-Id: I6a6c6be865dc05a1f73f17f47e182c7087cb8a21
2019-04-03 09:02:56 +00:00
Anna Khmelnitsky 58d9f658d4 NSX|P: Limit one ipv6 subnet per network
Change-Id: I41414ab5aab4856e892f6860e5660445409c8d6e
2019-04-03 09:02:19 +00:00
Zuul d4528e0b11 Merge "NSX|V3+P: Add verification of num defined address pairs" 2019-04-02 09:39:36 +00:00
Zuul 5774a61866 Merge "NSX|V3+P: remove redundent code in get_port/s" 2019-04-02 08:50:17 +00:00
Michal Kelner Mishali fd5eeb0bb8 NSX|V3+P: Add verification of num defined address pairs
This patch is adding a verification that the requested
number of requested address_pairs does not cross the backend
limit.

Change-Id: Id3ffe07c2e02c1ec3558031989da10aeafeabcd6
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2019-03-31 14:00:39 +03:00
Adit Sarfaty ce379c1128 NSX|V3+P: remove redundent code in get_port/s
In get_port and get ports the plugins used _get_port to get each of the
ports, and run the apply_funcs.
Since this cost a lot of time, and the super call to neutron already run
those, it can be removed.

Change-Id: I729b3e18d52df4c458f7ea8d2180deb534a375f1
2019-03-31 08:52:48 +00: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
Anna Khmelnitsky 01d70223e8 NSX|V3+P: Enable dual stack fixed IPs
Till now, only single fixed ip could be configured on port.
This patch will allow maximum one fixed ip per ip version to enable
dual stack ports.

Change-Id: Ia3e06c10c7f420f7f89f805650214645eec02ee8
2019-03-19 19:59:34 -07:00
Michal Kelner Mishali c9051bc615 NSX|V3+P: Limit number of subnet static routes per backend
Adding a parameter that sets the allowed static routes per
subnet, according to backend limitations.

Change-Id: I968fdef53bb9dab41a54561ca36b2e6880505d05
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2019-03-14 12:39:12 +00:00
Zuul 475c37437f Merge "NSX|V3: FWaaS v2 without GW" 2019-03-06 13:19:14 +00:00
Adit Sarfaty 1ab59eaca1 NSX|V3: Add unit tests mocks to avoid loggin errors
Change-Id: Iaeb882032fbc3da9cf5b8eade410fd1e8f0484ec
2019-03-03 05:19:35 +00:00
Adit Sarfaty c1ae9a5145 NSX|V3: FWaaS v2 without GW
When adding FWaaS v2 policy to a router interface, but the router has no
GW (and no service router), the rules should not be created on the backend.
Only when adding a GW, will all the rules be applied.
Since the FWaaS if for N-S traffic only, it shouldn't be applied without a
GW anyway.

This change required a little change in the service-rotuer creation logic
for NSX-V3 & NSX-P.
Since the logic got too complicated (FW rule can exist withour SR), the
new code will also check the current status on the backend.

Change-Id: I2a5d69e9443e8a468ce0d934ff1c846dc837bc89
2019-02-25 11:03:00 +00:00
Adit Sarfaty bff0c02417 NSX|V3+P: allow removing qos policy from a port
Change-Id: I20b53ffa0a467d65f2324ade79b038f076bd241a
2019-02-19 12:18:33 +02:00
Adit Sarfaty d77a0f2565 NSX|V3+P: Set router standby relocation when creating service router
The NSX backend does not support this flag without a service router
any more, so setting this flag will be done when creating the service
router, and it will be unset when removing the service router.

Change-Id: Iea4ea637359783c0d1de9b89b96135b63900ae26
2019-01-16 13:34:59 +02:00
Adit Sarfaty 1ac3b568e9 NSX|P support selection tier1 edge cluster
Change-Id: I92e4006ce47fa23307ef1a17e21b8397a1bc29fa
2019-01-10 14:24:17 +02:00
Anna Khmelnitsky cd85073e7e NSX|P: Handle subnet update and port dhcp bindings
Handle passthrough dhcp for updated subnet & ports binding

Change-Id: I98986210f42e75f01815bbd2c863bc169a6cc7b4
2019-01-10 10:08:20 +02:00
Zuul b32ba15b0e Merge "NSX|V3 reuse code for re-initializing the AZs in the unit tests" 2019-01-01 06:34:01 +00:00
Anna Khmelnitsky f40c196bbf NSX|P: Initial dhcp support
Policy does not support dhcp for infra segments yet, so support is
done on manager via passthough API. Same appliance is assumed.

Not covered here (will come as follow up):
- subnet update
- nsx cleanup

Change-Id: I9a64524edd80b1830c5b3dba2c63c087fe46a169
Depends-on: I47a1ec1994808f9ed8ebb00bbcc2bbe0a497a146
2018-12-31 13:37:31 -08:00
Adit Sarfaty 2a75de0bc8 NSX|V3 reuse code for re-initializing the AZs in the unit tests
Change-Id: Icc2503b0d24ed6ed13f39b9f3f04288377a0ff3d
2018-12-31 11:52:32 +02:00
Michal Kelner Mishali d2a44b76a3 NSX|T: Optional distinct edge cluster uuid for T1 router
Allowing the user to define a different edge cluster UUID than
the one defined by default, allowing the ability to define another
cluster for the T1 logical router.

Change-Id: I7976a90b2134a53c3ff80e5f0785f999c05137d3
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2018-12-25 11:43:50 +02:00
Michal Kelner Mishali f641808399 NSX|T: DR only Neutron logical router
Ensure that if a neutron router does not provide any service
which requires an edge appliance - no SR is created.
If a service is being removed - the SR will also be removed.

Change-Id: Ia1b24900acc5526e732c414682fa906c34860653
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2018-12-17 11:13:35 +02:00