28 Commits

Author SHA1 Message Date
Shih-Hao Li
43d0482cc6 Find tier0's tranzport_zone via advanced_config
When finding the overlay transport zone of a tier0 router,
if its advanced_config already has transport_zone_id defined,
then return it directly. Otherwise search through the edge nodes
in the corresponding edge_cluster.

Change-Id: Idf1efd9d0cd2c2ef5af895d22fc156630d855488
2019-10-22 19:09:11 -07:00
Durgesh Rane
b0126b6fef Add and Get centralized service port with Manager API
Added support to create centralized service port to attach Tier1
router to Logical Switch
Added support to get centralized service port for a given Tier1
router

Change-Id: I4e017b8e11c5fd6bfcd689238e0f71ebd29c379e
2019-06-28 16:21:00 -07:00
Adit Sarfaty
4b91eba9f5 Verify validate_tier0 gets tier0 to produce the right error
Change-Id: I129dd9ff0eea64a39431aebc1e1bc84278e4b53e
2019-02-14 13:41:57 +02:00
Quan Tian
837e15ed22 Add return value to add_router_link_port method
Add return value to add_router_link_port method then an API call could
be saved if client code needs the ports.

Change-Id: I5cc2f33be75888e014fda9aad3f4e0c80674ea27
2019-01-27 08:32:06 +00:00
Michal Kelner Mishali
91c7e32e1a Router: check if service router exists on backend
This code is for checking whether a service router exists.

Change-Id: Ife28174802460f16c11aea521628124dada8339a
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2018-11-26 15:20:28 +02:00
Michal Kelner Mishali
90def527e8 NSX|T: Add handling of disable/enable firewall
Adding a section for handling API call to enable/disable
firewall on logical router.

Change-Id: I5527f8316445e27ba0f96f71c089c27e2bd8bbb0
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2018-11-01 11:02:57 +00:00
Adit Sarfaty
98ed976475 Fix get_connected_t0_transit_net ot return the IP we need
Change-Id: I10846d53a77647bf2147bae923484c5422faf896
2018-07-29 15:53:47 +03:00
Adit Sarfaty
d21bee4ed5 New api for getting router port transit cidr
Change-Id: I82bb71186ccba599ff81c24d624b51167c58c521
2018-07-25 11:04:37 +03:00
Adit Sarfaty
18b03b993f Add router lib unittests
Change-Id: I86ac6564d4df1f3d0ee76da6d49b7476c642ffaf
2018-07-25 11:02:02 +03:00
Adit Sarfaty
12c8ed0639 Add None default for an unused parameter in rotuer API
Change-Id: Ifabec2f039089744bce71c82be568d00c8676683
2018-07-25 10:57:24 +03:00
Qian Sun
734270d9e9 Enabled naming nat rules
The following methods now have the ability to name nat rules:
- add_fip_nat_rules
- add_gw_snat_rule
- add_nat_rule

Change-Id: I62b36fcec1a53b6d2c0c0b64c9dcb4200c9b0ae9
2018-05-21 02:17:43 -07:00
Zuul
e69d8de2e6 Merge "Enabled adding tags to nat rules" 2018-03-08 05:48:31 +00:00
Gary Kotton
4447dcaed9 Enabled adding tags to nat rules
The following methods now have the ability to add tags:
- add_fip_nat_rules
- add_gw_snat_rule
- add_nat_rule

Change-Id: I6dc34ab3749ff4a5f1a575f407d8474538c69f96
2018-03-07 01:38:04 -08:00
Adit Sarfaty
1849131a06 Add router transport zone
In NSX 2.2 & up, there is a logical router advanced config of
an overlay transport-zone-id.
Also adding a router api to get the tier0 router overlay TZ to
be used here.

Change-Id: I3a447202785b7b6ac320ddbb6a3f2cdeac1f78aa
2018-03-07 11:20:06 +02:00
Adit Sarfaty
af56e15ff0 Add Transport Nodes api support & router TZ support
1. Add support for the transport nodes resource basic operations
2. Use it for getting the list of TZ of a tier0 router

Change-Id: I381c947044454c04efbc1c38ed7691ef8213ffef
2018-03-06 07:26:42 +00:00
Gary Kotton
df13d53903 Enable router interface to have 'centralized' type
This is required when we have a VLAN network that needs to be
attached to a router

Change-Id: I34ae08841158635e10ec4bd4518db4712ba4e984
2018-02-02 13:03:36 +02:00
Gary Kotton
cdcb5963da Remove neutron-lib from the dependencies
The patch removes the neutron-lib from the dependencies. We do not
want/need the consumers of this library to pull in all of the
neutron-lib dependencies.

The patch adds the following:
1. callback to bind is_attr_set - set_is_attr_callback
2. A new exception NsxLibInvalidInput - this is raised when inputs
   are invalid.

Change-Id: Ia8ec71dee2d5de921700a9b4fd7e789d2aed4679
2017-11-15 00:42:05 -08:00
Abhishek Raut
90f223d1b2 Add LB related flags for update_route_advertisement
Change-Id: Ia84cd4fa9ff1b57cfd46582ed67f774b724d5e0a
2017-09-15 17:34:19 +00:00
Adit Sarfaty
05a0f019e0 Add DHPC relay service to router port
Create/update a router port with a DHCP service UUID
This will be supported only if the nsx version is 2.0.0
or above.

Change-Id: I0843fd91e1631bec80ec19e9fa1edcc013523c28
2017-07-11 16:19:12 +03:00
Adit Sarfaty
af1d3cb1e5 Support different options for deleting NAT rules
Support different methods for deleting router nat rules
- delete a single rule with gw-ip
- delete a single rule with gw-ip and source ip
- delete all rules matching a gw-ip

Change-Id: Id43a2ced7d6526f538f485f345c20ba44673c7b2
2017-06-29 12:31:14 +03:00
Adit Sarfaty
c934c6f40a Adding optional source network to GW SNAT rule creation
Change-Id: I07179e4c0fb9c9feed0a211752626ed810426962
2017-06-27 12:38:35 +03:00
Adit Sarfaty
8e30d17b58 Support bypass-firewall param for router NAT rules
Adding nat_pass parameter to router NAT rules creation.
The backend default value for this parameter is True, meaning the
firewall rules will be bypassed.
So this is also the default of the api, for backwards compatibility.

This parameter is acceptable only since nsx v2, so the api needs the
ability to check the supported features before creating the request body.
For that use, the core_resources will now get the nsxlib object at init.

Change-Id: I7c9dfe13a146a47b180fc3df2d4d6174f252e0a3
2017-06-13 05:55:23 +00:00
Adit Sarfaty
5a045e3db1 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: I9b383ef3fd9a6487b1ee7726d892d1a94e3d9370
2017-03-27 08:03:53 +03:00
Tong Liu
4fa7c0da15 Fix FIP DNAT rule match_ports bug
When we create FIP in Neutron, default DNAT is created without
passing match_ports to add_fip_nat_rules. However, when adding
nat rules, [] is not None, and it goes ahead to create default
DNAT rule only allowing TCP protocol which is wrong. We should
ANY protocol for FIP DNAT.

Closes-Bug: #1672939

Change-Id: Ib3743018646c521923bb8bbc5fad1409eb4fbe16
2017-03-14 21:59:34 +00:00
Jenkins
f438d502c3 Merge "Disable uRPF check on lrp on container LS" 2017-01-27 22:38:59 +00:00
Abhishek Raut
2181d94403 Disable uRPF check on lrp on container LS
uRPF check which prevents evil endpoints from spoofing source
IP address needs to be disabled for logical router ports on
logical switches with container ports in case of Kubernetes.

This is to enable kubelet to perform health check. So in this
scenario the kubelet runs on the minion and the container runs
on the same minion. The packet from the kubelet hairpins back
into the VM via the tier-1 router.

Interestingly, the 'urpf_mode' property is only valid in the port
create body when the router is either of type LogicalRouterUplinkPort
or LogicalRouterDownlinkPort.

The other two port types LogicalRouterLinkPortOnTIER0 and
LogicalRouterLinkPortOnTier1 do not have 'urpf_mode' as their object
properties, and passing them results in a API validation error.

Hence in the code in the base LogicalRouterPort create method, we
add the urpf_mode to the body only if its not None. And we pass
'urpf_mode' only when creating the Downlink port ie. when attaching
the logical router to the logical switch.

Change-Id: Ib266da6e6f232e78e07f8d6c56cb69606f2ee9fe
2017-01-08 22:16:33 -08:00
Abhishek Raut
6b99e7693a Add match_ports argument while adding NAT rule
While adding NAT rules, if match_ports argument is set,
add a match_service parameter in the the request body to match
the service type, protocol and port for the corresponding rule.

Also add support to delete nat rules by using internal IP only.

Change-Id: I7c3f37bfea6c9f348d966e3f97e9f3b141bdfad3
2017-01-08 21:44:55 -08:00
Adit Sarfaty
e9ddc3dd33 Move all nsxlib code and tests to vmware_nsxlib
Change-Id: I75533e713a680674368d16f0a7aeb4fdbffe3608
2016-10-06 09:59:47 +03:00