3056 Commits

Author SHA1 Message Date
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
Adit Sarfaty
f836b5fa90 NSX-V3: Do not add mac learning profiles for ENS port
Commit I944021cbb6dfc950cff353e0ac908fa2b9c29bfe added a code to
avoid adding the mac learning + no security profiles for ENS ports
upon creation.
This patch does the same for the port update action

Change-Id: I287ccbc85c1a8ec201650b1d7b9ce9e603044815
2018-04-10 12:10:55 +03:00
yuyangbj
2ffa65f5b9 Adding --force support for nsxadmin backup-edges resources
Change-Id: Ic4d55c734230460225091c8e002cc68dbb785efb
2018-04-10 11:03:49 +08:00
Gary Kotton
4013b4ca65 NSX|V3: ensure that 0.0.0.0/0 is treated correctly
The NSX will not accept 0.0.0.0/0 for remote and local IP
prefixes. This is changed internally to 'ANY'

The 'ANY' will only be internal. The API for the user will not
change, they will stell see the 0.0.0.0/0

Change-Id: I24adc9da9f52d17621117b46d8a535ccedf93227
2018-04-09 06:31:05 +00:00
Zuul
b9cbacb1c5 Merge "NSXv: Fix LBaaS foreign key migration" 2018-04-08 13:01:28 +00:00
Adit Sarfaty
410effd667 NSX-V3: Do not remove edge id from logical router
When removing or changing the gateway of a router, we should not
set the edge-cluster id to None, and the NSX backend does not
support it.

Change-Id: I46e3ccdf1f3325ff0f6995b40146e26fe5a195d9
2018-04-08 10:55:25 +03:00
Kobi Samoray
78e8080c06 NSXv: Fix LBaaS foreign key migration
LBaaS forreign key migration adds several foreign keys, to enforce the
cleanup of stale NSXv DB objects when the LBaaS object is being deleted.
However, garbage rows may exist - and must be cleaned up prior to the
creation of the foreign key.

Change-Id: Ie6a0348df8b19a49525a1f2bad89f12370a3cd46
2018-04-08 10:20:26 +03:00
wangqi
e427c8fe39 Replace uuid.uuid4() with uuidutils.generate_uuid()
Since oslo.utils provide the ability to generate the uuid string,
and some others use oslo.utils[0] too. For consistency, this ps
replaces uuid.uuid4() with uuidutils.generate_uuid().

Change-Id: I9b3ebff137d0ffaed8c54031c8587c3bfc1acdce
2018-04-05 13:19:15 +00:00
Adit Sarfaty
dc1d46dca2 NSX-V3 Use admin context for VPN port creation
Change-Id: I4d4c0df44a95bc4c263667d2809ff85ccacfc016
2018-04-05 11:21:59 +03:00
Michal Kelner Mishali
9ce4e29a3e Handle network and port create/update, ENS + QOS
Bug fix 2082554: handle the exception in neutron side for Qos
since its not supported from NSXT for ENS TZ

Change-Id: I8ca4c7d04286830ce785a60d7a24439b9a39d801
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2018-04-04 13:34:23 +00:00
Zuul
db32fcec6f Merge "Allow NSX plugins to work without VPNaaS" 2018-04-04 07:51:27 +00:00
Zuul
6decf15cf6 Merge "Allow NSX plugins to work without FWaaS" 2018-04-04 07:35:03 +00:00
Adit Sarfaty
3eb130a2b4 Allow NSX plugins to work without VPNaaS
When neutron VPNaaS is not configured, the NSX plugins should
come up and work even if the neutron-vpnaas code is not installed.
This patch moves a constant the plugin needs to a file without
neutron_vpnaas imports so that the plugin doesn't have to import it.

Change-Id: I4c0893128fe8fd9c4797531bdb31d6407d18f034
2018-04-03 11:12:50 +03:00
Adit Sarfaty
f7318af8a0 Allow NSX plugins to work without FWaaS
When neutrion FWaaS is not configured, the NSX plugins should
come up and work even if the neutron-fwaas code is not installed.
This patch adds try/except on fwaas imports, and some mocks to
allow it.

Change-Id: I44895c1ded046668c56d559b47a69c44102d2f04
2018-04-02 15:08:48 +03:00
Adit Sarfaty
2535cac55f NSX-v3: fix overlay network check
Change-Id: I8e6db4d89b9741f50a19f2499703a9c755063c31
2018-04-02 14:51:09 +03:00
Gary Kotton
7c3f1e63df NSX|V3: fix ENS VLAN attach to router
When the default TZ is a ENS VLAN TZ then we identify this this
is not a regular overlay network. It is a VLAN network. There was
a missing check for regular networks that were not provider
networks.

Change-Id: I9e4241fd2e1047ba14442babc4677efa4dcab3a5
2018-03-23 04:31:16 +03:00
Zuul
456ac69e49 Merge "Filter port-list based on security-group" 2018-03-28 11:11:20 +00:00
Zuul
3ea32b0293 Merge "NSX|V3: ensure external subnet does not conflicts with T0 address" 2018-03-28 09:27:33 +00:00
Michal Kelner Mishali
1b5d0867ab Filter port-list based on security-group
This patch will allow users to filter ports according
to security_group supplied as a filter.
Code is for V and V3.

Change-Id: I20b4655cb188aae9d031fee20aea917268ebdf48
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2018-03-28 12:04:54 +03:00
Gary Kotton
4c4a62ba5c NSX|V3: prevent attaching transparent VLAN to router
Currently NSX does not support attaching a trunked network to a
router

Change-Id: I6396d07cbd12f023263b9b50374b49255f54102d
2018-03-27 04:42:01 -07:00
Gary Kotton
cffc8ab57b NSX|V3: ensure external subnet does not conflicts with T0 address
The NSX T0 interface should not be part of the external subnet.

Change-Id: I45e6f821a03f81d5a0ca7852276ab1b14c3d22af
2018-03-27 02:06:07 -07:00
Adit Sarfaty
778b04ead0 NSX-V3: prevent the user form changing vpn internal ports
The VPNaaS uses a neutron port to allocate a local peer ip.
This port should not be updated or deleted by the neutron users.

Change-Id: I5c0e823ebd1fe79cb3ccdf175f760b16d5e2f562
2018-03-25 06:39:04 +00:00
Adit Sarfaty
3fd27427ae NSX-V3: Enhance VPNaaS related validations
a No-SNAT router subnets cannot overlap with VPN subnets becasue of the rotuer
advertisment.
This patch adds validations when changing the rotuer GW or addign an interface.

Also change the local endpoint port creation so this port will have a distingished
name and device id/owner and won't be queried by mistake.

Change-Id: I41faf97bae67ca85b38da3ade47894865eac8d51
2018-03-22 13:22:16 +00:00
Gary Kotton
8965202777 NSX|V3: improve trandparent VLAN support
The NSX currently does not support trunking for DHCP and
metadata ports. When a network and subnet are create we will
not create these if transparent VLAN is set on the network.

Change-Id: I7f8c4c81ba5074c58e61d31b08e0af66ef43accb
2018-03-21 05:44:47 -07:00
Adit Sarfaty
163dd0b214 NSX-V3 Add NO-DNAT rules only if supported
Commit I34d72b12289d6f6527bc114a32dac88281dd2cc4 added NO_DNAT rules
for each router interface. Those rules are not supported and unnecessary
for older NSX versions as VLAN networks were not supported with routers.
This commit adds the NO_DNAT rules only when supported.

Depends-on: I4d99193caac6940911cc071016359a1361428967
Change-Id: Ic0934979931e20645ee1d7d6b5968d7d3efc9c01
2018-03-21 05:28:47 +00:00
Adit Sarfaty
9d99e2ffb6 NSX-V3 fix FW rules for VPNaaS
The edge firewall rules for VPNaaS traffic where created in the
opposite direction

Change-Id: Ifdd51c64264e2a01ae6afb68ee7fe4cac5da430e
2018-03-20 10:29:41 +02:00
Gary Kotton
fc59514f30 NSX|V3: prevent disabling MAC learning on ENS TZ
By default MAC learning is enabled on these networks. The patch
does the following:
1. prevent disabling this for TZ networks
2. marks the port mac learning as enabled on create
3. does some minor optimization in reading id the port is on a TZ
   network

Change-Id: I944021cbb6dfc950cff353e0ac908fa2b9c29bfe
2018-03-19 10:06:30 +00:00
Zuul
bab5abe82d Merge "Revert "use str names rather than classes for orm relationships"" 2018-03-18 15:56:39 +00:00
Zuul
341314742a Merge "NSX-V3 Fix some VPNaaS configuration bugs" 2018-03-18 15:48:19 +00:00
garyk
ec9ff32ac6 Revert "use str names rather than classes for orm relationships"
This reverts commit dec28f6d2b83700e96180b1b10b712799f0c76f7.

We needed to revert this as it broke the nsx cleanup utility
for NSX|V. This broke the CI.

Change-Id: Iffb05ab0c0bcb8c8184a0c821dece1e88cdd3fb3
2018-03-18 13:32:27 +00:00
Adit Sarfaty
a494a35444 NSX-V3 Fix some VPNaaS configuration bugs
- Support the case of empty neutron names
- Fix NSX local endpoints tags
- Support connection/service admin-state configuration

Depends-on: Ieb9da32b6f3b908dda7b4c5b99cb4ca2b79c9286
Change-Id: If5509fdcf3c496ad446921a3fb57b48deb6179f4
2018-03-18 14:23:56 +02:00
Zuul
b3e9311686 Merge "TVD: configure the list of supported plugins" 2018-03-18 10:15:14 +00:00
Gary Kotton
0356a7909c NSX|V: fix for existing spoofguard policy
Ensure that the policy is published.

Change-Id: Iba2ecd86e88ee4523b1af30554c6318b345059bc
2018-03-16 14:09:27 +02:00
Adit Sarfaty
3e49ed86b4 TVD: configure the list of supported plugins
Instead of always trying to load all 3 plugins (v, t, dvs), the customer
can now configure those he wishes to support.
This way we will be quicker on neutron restart (and CIs) and avoid the errors
in the logs.

Change-Id: I9b41dc4002e7bd758dd46810763e70dbfc9202b0
2018-03-14 12:15:53 +00:00
Zuul
1a7368c13f Merge "NSX-V3: Update NSX objects on network update" 2018-03-13 19:04:37 +00:00
Zuul
c52d97012b Merge "L2GW: support missing methods" 2018-03-13 13:13:51 +00:00
Gary Kotton
15a279dbc6 L2GW: support missing methods
Adds missing methods. Something changed witht he way in which
the callbacks were invoked which showed that we did not support
the correct methods.

Change-Id: I253ceee343d829923b874057603a32ccd8c662f6
2018-03-13 08:50:54 +00:00
Gary Kotton
b5a195ecc4 NSX|V3: ensure that description is not None
Commit a96d83ece64d1ab662be8ee62eca15c3e3ab4c19 set the internal
security group description to be None. This should be a string.

Change-Id: Ia4b1e0cea3f4e1493e41bf1e97bcf3016e389bf9
2018-03-13 08:50:47 +00:00
Adit Sarfaty
f9071f3f9f Fix security groups ext_properties loading
Commit I123ae390bec489a931180a2e33f4bf7b1d51edb2 broke the extended
security group code, by removing the 'is_default' attribute from the
list of fields that should have been updated in the DB.
Not sure exactly why it broke us.

Change-Id: I891bc792e62ac90683ce8745f98a3139c9ffd3d9
2018-03-13 08:09:05 +00:00
Zuul
5a25e38e8b Merge "TVD: Fix get-floatingips plugin selection" 2018-03-12 07:02:37 +00:00
Zuul
df79a8634e Merge "AdminUtil: V3 refactor get md_proxy_status" 2018-03-11 14:24:01 +00:00
Adit Sarfaty
476b3b924b TVD: Fix get-floatingips plugin selection
When getting floating ips by port id, we should ignore the requesting
tenant since this is called via nova with a service tenant.

Change-Id: I557a9bb7071481e15c8be064a14cad583140991f
2018-03-11 15:34:03 +02:00
Zuul
f96fdeab73 Merge "NSX-V: Avoid warning on deleting dhcp binding for non compute port" 2018-03-11 12:59:55 +00:00
Michal Kelner Mishali
dbe86b248a AdminUtil: V3 refactor get md_proxy_status
Depends-on: I9b4e8520965878c949bee5129fa5c20a4b80671d

Change-Id: Iafb8f2b5ab7af089e41fcc86fe21509f3da03f88
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2018-03-11 12:42:16 +00:00
Adit Sarfaty
e8d446d6d4 NSX-V3: Update NSX objects on network update
When the neutron network updated, some related NSX objects may need
be updated as well: DHCP server & port & metadata port

Depends-on: I07658bdaabe919f94dc877585206c76a1191f16c
Change-Id: Id563788af4b41aa360f8e87b28c310d1bab33feb
2018-03-11 12:35:30 +02:00
Adit Sarfaty
b565c4bda3 NSX-V: Avoid warning on deleting dhcp binding for non compute port
When a port is deleted, the plugin should delete its backend dhcp
static binding only if it is a compute port, since it is added
only for compute ports.
Note that the case of changing the device owner of the port was already
handled in the update-port code.
Calling the delete on non-compute ports issues a warning in the logs
We keep callign it anyway to avoid edge cases but will skip the warnings.

Change-Id: I5e76b14de0c2f2b844c7411bc325e46746fda54d
2018-03-11 11:56:32 +02:00
Boden R
dec28f6d2b use str names rather than classes for orm relationships
In Rocky we are going to start working on decoupling neutron db. This
will be a long effort, so from a vmware-nsx POV we can hopefully pick
away at it as we go.

This patch changes to use of class references to fully qulified class
names when defining ORM relationships. This allows us to remove a few
of the neutron db related imports in vmware-nsx.

Change-Id: I1df4cb3eec59488a5b35fac9f943bbfdbb44df63
2018-03-11 06:56:23 +00:00
Gary Kotton
02f4ccb6bb NSX|T DFW support
Commit c211f02e642f0339077fb9d37c3452132e1163f9 deleted two lines
by mistake. This returns them.

Change-Id: I612074358af58cd6d63764be6862c6c77d2ccc5b
2018-03-09 13:50:40 +00:00
Zuul
6a6a7b9db4 Merge "NSX-V3: verify router transport zones" 2018-03-08 13:59:57 +00:00
Zuul
9b8ee7abf8 Merge "Remove old TODO comments" 2018-03-08 11:51:07 +00:00