71 Commits

Author SHA1 Message Date
Salvatore Orlando
c2a55c005e Catch exception when cleanup fails
Print an error message instead of a full traceback.
Exit with code 1.

Change-Id: I6102d14d1b4552a76d0aa694f758f2750abe5328
2021-04-29 09:50:10 -07:00
asarfaty
b03c5f23fe NSX|P: Add deletion of certificates to devstack cleanup
Change-Id: Ie2917aeeaae4b65b32f367f8de79720e167fa228
2021-03-16 08:26:30 +00:00
asarfaty
1c4d261c60 NSX|P: Add log about Qos in devstack cleanup
Change-Id: I246db6211961d7e08bcb0030255ef00dc0d60639
2021-03-10 07:09:10 +02:00
asarfaty
c06410362f NSX|P: Fix devstack cleanup for fwaas
Change-Id: Ibe21d84729785294611199a6fe900b86e8896391
2021-03-09 09:01:50 +00:00
asarfaty
b1503dd5b0 NSX|P devstack cleanup fix
- Delete segment dhcp static bindings
- Delete octavia llowed cidrs GW policy, group & service
- Delete Qos profiles

Change-Id: I524c1b3e5445ba9006017146c9797020e30c8e8a
2021-03-07 11:00:24 +02:00
asarfaty
35dd9d1878 NSX|P: add static routes deletion to devstack cleanup
Change-Id: I75152f3fcd0853b5068c2db142f068e28ada0baa
2021-02-21 12:30:11 +02:00
asarfaty
53aab18c11 NSX|P: Fix devstack cleanup
Change-Id: I2a45ad31c3bc2f8292756c90d5f001cdc801687d
2020-12-21 09:51:58 +02:00
asarfaty
343bb2f3f9 NSX|P: Fix devstack cleanup
Change-Id: I75391ba8edb5365c780959304d0c404bef90f6bc
2020-12-15 16:26:46 +00:00
Kobi Samoray
6c99ff9992 NSXV: replace requests with httplib2
nsxv_cleanup fails due to requests issue, replace with httplib2

Change-Id: Ib5ed173ff039423ed85f23243b8416a07c860b7e
2020-12-10 10:26: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
asarfaty
f9dc12ef39 NSX|P: devstack cleanup router interfaces
Change-Id: I79c19ebff4c9003930516527f45226277f862ae5
2020-01-16 14:09:51 +02:00
asarfaty
95f05a2097 NSX|V3: Fix devstack cleanup for tier0 ports
In case using the cleantup with a newutron_db, tier0 logical ports
were not deleted, becasue the tier0 routers could not be found in
the neutron DB.

Change-Id: I78e6641f2d94331a081bae218a99bbc2973f2540
2019-12-19 18:38:14 +02:00
Adit Sarfaty
cceaa376b9 NSX|P: Fix devstack cleanup to use the default domain
The policy plugin do not use per-tenant domain any more, so
it should delete objects from the default domain instead.

Change-Id: Ia93d9e1c888105305db880e8166c98a3d2fcad9f
2019-09-08 11:54:19 +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
Adit Sarfaty
5b591457c0 NSX|P: Create/delete tier1 locale-service upon router create/delete
The NSX backend needs each logical router to have a locale-service
entry, which should also be deleted before the router is deleted.

Change-Id: If64c1b67c19906105b07c6facedf5d07ac36176d
2019-05-16 05:29:24 +00:00
Kobi Samoray
e98a41d8d2 NSXP: LBaaS/Octavia support
Change-Id: I2bd7b01f921243d65f68ec328173e949607e7842
2019-04-01 14:41:02 +03:00
Adit Sarfaty
6867b051e2 NSX|P: DHCP & MD Proxy devstack cleanup
And some other cleanup fixes

Change-Id: I7fd26ee8320b4a3b863b42adff8dc756b31d8272
2019-01-08 11:19:51 +02:00
Adit Sarfaty
74f3831027 NSX|P: QoS support
Change-Id: I719c1adfa94676b5e8b3a7b60f8d9d034d54eeb3
2019-01-07 13:07:23 +02:00
Anna Khmelnitsky
d1bf1f324e NSX|P: Consume nsxlib folderization patch
Change-Id: I24e2099b8c13c61218ca3c7582961a8620cfca28
2019-01-06 07:48:27 +00:00
Adit Sarfaty
1f8ac3e9f6 NSX|P add port security support
Adding segment profiles to the backend port Including mac learning support,
port security & spoofguard.
In addition - adding the exclude port tag for ports without port security

Change-Id: Ief4a3989316f7b7097c5be6145aae169cde87e8e
2018-12-26 08:38:28 +02:00
Adit Sarfaty
4831350452 NSX|P: Remove tier1 router service in cleanup
Change-Id: I23d3919d56d6cdb7a5693e14e2db2fdafd1d92bb
2018-12-24 13:22:04 +00:00
Adit Sarfaty
582e6bab48 NSX|P Add SG rules groups cleanup
Fixing the ID of the rules remote/local NSX groups,
and adding devstck cleanup for those.

In addition, this patch adds try clauses around all cleanup actions,
to make sure the cleanup runs through even if some actions fail.

Change-Id: I9c0d70ceb174dcf8e00ac209e1eedc4afc833cc8
2018-12-19 11:30:04 +00:00
Adit Sarfaty
46bcd38717 Policy plugin floating IPs support
Including unit test & CI tests for routers & floating IPs,
and necessary routing related fixes.

Change-Id: If4f38e6081f1b68369102a1e9839feac8b33530e
2018-12-11 12:41:58 +02:00
Adit Sarfaty
183b86b1f0 NSX|P: Basic router interface & GW support
Additional actions will be added with nsxlib support

Depends-on: I10a3f691b33e37e1cd8ec8094f4bfa89d7a96f35
Change-Id: I92fff433646202a0245c1cef9630173fe245a296
2018-11-28 14:46:29 +00:00
Adit Sarfaty
af3dbf97b3 NSX|P: Add devstack cleanup for basic NSX resources
Change-Id: I57739712641e6e5ae1c0076069693f6bb7c11c9d
2018-10-29 12:25:40 +00:00
Michal Kelner Mishali
0fd1424dda NSX-Policy: Support NSX policy in devstack
Code to support nsx policy in devstack

Change-Id: I41a702c69d8869475e4f6dc9009fd63e88b62a9e
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
2018-10-15 08:44:03 +00:00
Adit Sarfaty
958b196601 NSX|V: Fix devstack cleanup for python 3
fix base 64 encodeing and integer casting for python3

Change-Id: I3c9bcc41ac1c18b4754465de0e95e42ea0825c81
2018-09-16 09:37:55 +03:00
inspurericzhang
fb3baeac73 fix misspelling 'configuration' of functions
Change-Id: I2038d9796c8f63e4fa6577d7bd9360cf97aa05c9
2018-08-15 16:16:11 +08:00
Adit Sarfaty
4902962453 Add devstack cleanup for loadbalancers
Delete all NSX LB objects on devstack cleanup, for LBaaS and Octavia

Change-Id: I6d3bd924414888406d60e1a3fa63e1f8aee949b9
2018-06-20 09:25:39 +03:00
Adit Sarfaty
cec3ed1788 NSX-V3 devstack cleanup for VPNaaS
Delete all NSX VPN objects on devstack cleanup

Change-Id: Ib6f49961e76e648d56f9c4576342bba0a1b9b778
2018-03-21 09:46:05 +02:00
Adit Sarfaty
bbddf61c87 NSX-V3 devstack: cleanup VPNaaS objects
Delete nsx vpn sessions and local endpoints when cleaning up devstack

Change-Id: Ie5e9d9f87230fb950b6951e67e5548b24ca64d33
2018-01-21 10:47:22 +00:00
Adit Sarfaty
9ac5edd12e NSX|v3 use nsxlib in devstack cleanup
Refactor the devstack cleanup script to use nsxlib instead of accessing
the nsxmanager directly.
This patch is needed for the XSRF support.

Change-Id: Ib2e8c4031aae22f97f5a400d9dc5e49a945f7aed
2017-08-31 06:02:18 +00:00
Gary Kotton
1b0aa848a7 NSX|V: autodraft does not require a NSX reboot
Remove the output to reboot the NSX.

Change-Id: I058dd078215272be1ba4759f8d81467ff45edc09
2017-08-05 22:13:55 -07:00
Jenkins
777825185f Merge "Use flake8-import-order plugin" 2017-07-06 05:30:33 +00:00
Gary Kotton
50cd210d59 Use flake8-import-order plugin
Automate the process

Change-Id: I54451e78c24eef2016293be87760a349df07a384
2017-07-05 00:39:10 -07:00
Adit Sarfaty
c976ab8e61 NSX|V3: devstack cleanup exclude list ports on devstack
If ports are added to the exclude list directly (not using tags),
they should also be deleted when using devstack cleanup.

Change-Id: Id2bc3690bf11be41a52e6b3301995cd71da0af3b
2017-07-05 10:13:48 +03:00
Gary Kotton
de196f9dc6 NSX|V3: ensure that devstack cleanup delets switches
Commit 3d24d19309f21e698b91385e39edf77e6309135a resulted in
networks not being deleted. This is due to the fact that some
ports on a network may not be stored in the DB. For example
a metadata port.

Change-Id: I192b5b85d99e08989bd68ebef73e592d398edbd4
2017-06-28 04:10:55 -07:00
Adit Sarfaty
7102def745 NSX-V3| fix devstack cleanup
Backend list results do not always have the cursor field so we should use
get when accessing it.

Change-Id: I3f31b56c50a8f014cc322ceb5e6c69b5540c879e
2017-06-17 05:17:52 +00:00
Adit Sarfaty
580331604c NSX-V3| fix devstack cleanup
firewall sections were not deleted properly causing other objects not
to be deleted too.
Fixed 2 things:
- backend list results do not always have the cursor field
- delete the fw section with cascade instead of deleting each rule.

Change-Id: Ib96ab16cc49e12111e729ead716953c8114fa99c
2017-03-27 14:10:43 +03:00
Anna Khmelnitsky
8bb4df14f1 NSXV3: Client certificate private key encryption
When certificate storage is nsx-db and nsx_client_cert_pk_password
is provided in configuration, private key will be stored encrypted.

Change-Id: Id0e6f3b614da9eb2381c80d1a76043e38d2d11ee
2017-02-06 08:00:51 +00:00
Anna Khmelnitsky
6e1a21881e NSXV3: Initial client certificate auth support
Client certificate authentication is disabled by default.
To enable client auth, define the following in nsx.ini:
nsx_use_client_auth = True
nsx_client_cert_storage = nsx-db
nsx_client_cert_file = <file to store certificate and private key>

To enable client auth in devstack, define the following in local.conf:
NSX_USE_CLIENT_CERT_AUTH=True

This commit covers only DB type of cert storage. Barbican storage
and imported cert will be added later. Also planned for near future:

    reload cert from DB if NSX connection failes due to bad cert
    show warning when cert nears expiration
    delete cert file from file system on neutron exit

Change-Id: Ic70a949b740d9149d71187b02640d3071a3e0159
2017-02-02 09:39:18 +00:00
Adit Sarfaty
f0f6e8df6d Fix cleanup prints
Change-Id: Icfd419b506f272fb37236d81b68244ac8af393cc
2017-01-31 09:09:23 +02:00
Roey Chen
3d24d19309 NSX cleanup script to clean only related resources
nsxv_cleanup and nsxv3_cleanup scripts are called by unstack.sh and
removes all backend resources, even resources which may have been
created by other devstack deployments using the same backend.
This patch fix this issue, when calling 'unstack.sh' the script will
only remove backend resources that have db record, if 'clean.sh' is
called, then previous behavior is used and all backend resources created
by openstack are removed.

To run the scripts manually, in such way that only backend resources
with db records are cleaned, one must specify '--db-connection' (e.g -
iniget /etc/neutron/neutron.conf database connection) option so the script can
query the DB.
When '--db-connection' option is not specified then all
backend resources are cleaned.

Change-Id: I2283bdb2758c303a46574296e0067f458a6eefcf
2017-01-30 10:20:11 +00:00
Anna Khmelnitsky
f32906a3fe NSX-V3: Handle pagination in devstack cleanup
NSX-V3 limits get-list APIs to 1000 objects per page.
Before this commit, unstack.sh would not clean up all objects on backend
if more than 1000 objects were present.

Change-Id: I1c5354e5638ad08538477bbba2483dc67e316f38
2016-12-09 17:58:30 -08:00
melissaml
7069324b2f Remove white space between print and ()
TrivialFix

Change-Id: Ic0aaa63fc1ea06bd235e22b6e60b62454fe75d03
2016-11-26 16:20:22 +08:00
Adit Sarfaty
5c1f2f5b30 NSX|V - initial support for NSX policy
This code adds an extension for policy-id in a security group.
when this feature is enabled (new nsxv config: use_nsx_policies):
- Each security group will be linked to an nsx policy.
- No rules will be added to any of the security groups
- Only admin can edit security groups (depending on the policy.json)
- the default security group will be using the new nsx.ini config
  default_policy_id

Change-Id: Iad5e90245c2f70ed88f65f0c5e6ec46cb2eedbbc
2016-11-07 15:27:57 +02:00
vmware
701af81a92 devstack: fixed backend cleanup during unstack
unstack should only delete ns-group created by openstack

Change-Id: I0b35fb52909fa18d5f3b9d14fa5f368ef5990880
Closes-bug: #1740678
2016-10-05 17:00:43 +05:30
Roey Chen
25b160653d NSXT: Adding a script to set global firewall config autodraft option
Change-Id: I3a7b0b7c5f4d2c2da083ac002dc799060dfd218e
2016-08-28 08:00:08 +00:00
Shih-Hao Li
c4a2cf6b14 NSX|V3: Delete backend DHCP servers during devstack cleanup
Add a new function to delete backend logical DHCP servers
created via openstack plugin when running devstack cleanup script.

Change-Id: Ib98c036af2d3e065eb73e9855501262aba30641a
2016-08-01 11:03:12 -07:00
Jenkins
1a89e51d3d Merge "NSX|V: add in edge resource configuration support" 2016-07-13 10:09:08 +00:00