Commit Graph

206 Commits

Author SHA1 Message Date
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 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 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 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
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
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
Kobi Samoray 8535d0fa5f NSXv: improve logging for metadata setup
Add logging in init process and in DHCP/router initialization to
troubleshoot metadata failures.

Change-Id: I973b4883ec4817f205a7d2cf446f11fbed3c40c6
2019-02-28 17:35:17 +02:00
Salvatore Orlando c8768e34da [NSX-V] Ensure binding exists before assigning lswitch_id
When fetching router bindings, make sure the binding exists
before accessing its properties

Change-Id: I6e1a4af530394444f5513df1f606d8bc62cc7c2d
2019-02-05 13:43:28 -08:00
Adit Sarfaty cda47aa304 NSX|V: Fix host groups for DRS HA for AZ
For the fire cell anti affinity to work as designed, there is a need to use different
groups & rules per host group, since those hostgroups can be different for differnet
availability zones

Change-Id: I092f5c228489a3a0d73f060380f1a1a6c526fb00
2018-08-16 13:08:39 +03:00
Adit Sarfaty d17f3aad1b NSX|v: Fix create_dhcp_binding error handling
create_dhcp_binding may fail with timeout or other types of exceptions
which do not have a response field.
This patch checks its existince before trying to decode it.

Change-Id: Ie62d3965a10bf07795c1bd56b7c6191eb5c73251
2018-04-23 14:22:56 +03:00
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
Gary Kotton b448aba9b8 NSX|V: enable binding floating ip's per AZ
Enable admin to enable this config variable per AZ.

Change-Id: I19ee2b4adf49e9bcd3e6004dc76d61761bb81b92
2018-01-15 22:09:08 -08:00
Kobi Samoray 84da10cf22 NSXv HK: recover broken backup edge appliances
When there is a failure during the recycling of an edge appliace to the
backup pool, the edge at the backend may still be attached to networks
and use IP addresses which are free for reuse by Neutron.
Housekeeping job should address such cases.

Change-Id: I3a8ba622f742064bdc8906ba745da0a54a4576ac
2017-12-28 14:42:02 +00:00
Zuul d99c2fbf5e Merge "Add metadata setting for new created dhcp edge." 2017-12-10 06:37:14 +00:00
Adit Sarfaty bbbcc7819b NSX|V: Add configuration for shared rotuer size
Adding a new configuration parameter to define the appliance size used for
new shared routers: shared_router_appliance_size

Change-Id: Ie28877469439917bf6df91702fd6608c78562d0d
2017-12-07 10:03:24 +02:00
Zhenmei 1342ec78dc Add metadata setting for new created dhcp edge.
Change-Id: Ie33d3d13207fafa2dca002f985e8e9724089128f
2017-11-18 08:14:02 +02:00
Adit Sarfaty 1d5af38ed7 NSX|V prevent adding illegal routes
The nsx-v backend does not suport adding a route where the
nexthop is part of the destination.
This patch skips it (instead of failing at the backend)
and also skips a tempest test that tries the same thing

Change-Id: I41181d43cffbf0e5cbb63069ed864683834c77b9
2017-11-08 12:08:02 +02:00
Boden R 17213439c9 use l3 api def from neutron-lib
Commit I81748aa0e48b1275df3e1ea41b1d36a117d0097d added the l3 extension
API definition to neutron-lib, commit
I2324a3a02789c798248cab41c278a2d9981d24be rehomed the l3 exceptions and
Ifd79eb1a92853e49bd4ef028e7a7bd89811c6957 shims the l3 exceptions in
neutron.

This patch consumes the l3 API definition from neutron-lib
in prep for If2e66e06b83e15ee2851ea2bc3b64ad366e675dd

Change-Id: I56409beb595c69f2ecaac5349dea35bee14a26ce
2017-10-31 15:20:46 -06:00
Adit Sarfaty 3b0f140c0a NSX|V remove warning on no dhcp edge
When deleting a network, the plugin delets the rotuer binding entry
before deleting the dhcp port.
So we should not log a warning about not finding the dhcp edge.

Change-Id: I7a58a6789d59055ce1782c987bd359756b8bc16b
2017-10-24 04:11:06 +00:00
Adit Sarfaty ff0fc94abe NSX|V: check md proxy handler exists before usage
When something fails during the init_complete process, the plugins
md_proxy data is not fully initialized, so it is possible that even the default
handler was not set yet.
This patch ensures that the relevant md-proxy handler exists before using it.

Change-Id: I1db84c0abc30d8ea3d601f26b5b852a254a6036c
2017-09-24 11:42:43 +03:00
Jenkins 3f56cc8669 Merge "NSX|V: ensure locking when removing a network from DHCP edge" 2017-08-21 21:35:43 +00:00
Gary Kotton 45fc5cc7e3 NSX|V: remove unuse dmethod _get_sub_interface_id
This was removed in commit df8f34c66d

Change-Id: I0ac9cad84d994d61b2bec37f0fd29b30f994af97
2017-08-21 11:04:33 -07:00
Gary Kotton f9b8d1f094 NSX|V: ensure locking when removing a network from DHCP edge
Ensure that the vnic incides are lock when removing the network.
This may cause a race when multiple networks are deleted at the
same time.

Change-Id: I13c01947ebe2762c76a75cdebb023aa7fed88aca
2017-08-20 23:58:37 +00:00
Jenkins 803a6bffe4 Merge "NSX|v: fix deletion of edges in PENDING_UPDATE" 2017-08-14 15:23:55 +00:00
Adit Sarfaty 71f67ac7be NSX|v: fix deletion of edges in PENDING_UPDATE
If an edge is stuck in PENDING status for too long, we are deleting it.
In case of PENDING_UPDATE or PENDING_DELETE we should compare the current time
the updated_at field and not created_at

Change-Id: Iec02c254233fd55362a8c51b6c153e7b6a2ee083
2017-08-14 15:46:10 +03:00
Gary Kotton c2d7155b70 NSX|V: make use of granular API for getting DHCP binding
NSX 6.2.8 and 6.3.3 support the granular API:

New GET api:

GET https://<nsxmanagerIp>/api/4.0/edges/<edge-id>/dhcp/config/bindings/<binding-id>
RESPONSE:
           <staticBinding>
                <autoConfigureDNS>false</autoConfigureDNS>
                <leaseTime>86400</leaseTime>
                <subnetMask>255.255.255.0</subnetMask>
                <bindingId>binding-1</bindingId>
                <vmId>vm-34</vmId>
                <vnicId>1</vnicId>
                <hostname>test</hostname>
                <vmName>3-vm_ubuntu_1404_srv_64-shared-1668-02458540-04f1-4508-8037-2f2ce5542b91</vmName>
                <ipAddress>12.12.12.1</ipAddress>
           </staticBinding>

2) Quering a binding with a invalid ID:
   GET https://<nsxmanagerIp>/api/4.0/edges/<edge-id>/dhcp/config/bindings/<binding-id>
   RESPONSE:
           <error>
                <details>[Dhcp] Static binding is not found: binding-2</details>
                <errorCode>12510</errorCode>
                <moduleName>vShield Edge</moduleName>
         </error>

Change-Id: If1049035797c525344c46e1ae7f664a7b9daa4a1
2017-08-04 15:45:05 +03:00
Jenkins 72e15a14de Merge "NSXV: use correct exception for NoResultFound" 2017-07-25 18:47:23 +00:00
Gary Kotton bc60478ef0 NSXV: use correct exception for NoResultFound
Change-Id: Icbe226e3ea86d16860c20d9b18ac49b6410f9de5
2017-07-25 04:29:24 -07:00
Kobi Samoray 1785298177 NSXv: locking DHCP
Change-Id: If3aed690dd5607288cbc23faa3809ab59f6f92d0
2017-07-25 13:26:52 +03:00
Gary Kotton ba81638fcb NSXV: ensure that binding update does not fail if deleted
A concurrent task may have deleted the router binding.

Change-Id: Icd5a64f7688c0a8389323deed84d7adf7c949006
2017-07-13 00:14:33 -07:00
Jenkins 9439aa0a76 Merge "NSX|V: treat edge cases with edge deletions" 2017-07-06 05:53:44 +00:00
Jenkins c55cb65cc1 Merge "NSXv: Backup pool locking" 2017-07-06 05:53:38 +00:00
Gary Kotton dd43e222e3 NSX|V: treat edge cases with edge deletions
- When doing a deletion is a async task we create a new context
to deal with that deletion
- We add some additional logs

Change-Id: I9a707d1292858428ab51295167360bfa26513430
2017-07-05 05:43:59 -07:00
Kobi Samoray f9e7b86b96 NSXv: Backup pool locking
Backup pool management should be fully protceted by locking.

Change-Id: I8a8c4bddb5684801596aae4adba50b53932786fe
2017-07-05 13:53:10 +03:00
Gary Kotton 50cd210d59 Use flake8-import-order plugin
Automate the process

Change-Id: I54451e78c24eef2016293be87760a349df07a384
2017-07-05 00:39:10 -07:00
Jenkins 3f34e78153 Merge "NSXv: use regular DHCP edges for VDR metadata" 2017-06-28 11:42:16 +00:00
Kobi Samoray df8f34c66d NSXv: use regular DHCP edges for VDR metadata
VDR-connected networks were using designated DHCP Edge appliances
to provide metadata.
That was necessary before we introduced option 121 - which can be
used for route injection, which directs metadata traffic towards the
DHCP Edge.
This change removes some redundant code which is supporting metadata
in the old manner.
The patch deprecates supports of older versions of NSX which do not
support insertion of host routes which is required for the change.
Therefore dhcp_force_metadata config parameter has been deprecated.

Change-Id: I6b5e2acf09ce61c87d8ae97471955599cddf320b
2017-06-28 07:03:25 +00:00
Jenkins 7b1999f5c5 Merge "NSX|V: delete old pending-update/delete edges" 2017-06-27 11:59:28 +00:00
Adit Sarfaty b642470390 NSX|V: delete old pending-update/delete edges
Commit If07937636f2312e86ae71d7345053ef72b28e2aa added the logic to
delete edges which are waiting to be created for too long.
This commit does the same also for edges waiting to be updated or
deleted.

Change-Id: I9ca1c525593c28fb9ee7610d2f1dd3cee6f81939
2017-06-26 15:33:07 +03:00
Gary Kotton 3f308ed6d2 NSX|V: make sure host groups updated only once
There may be an edge where a back edge is created prior to a edge
being allocated from the pool.
Both of the callbnacks for the edge complete would create the edge
host groups.
This will make sure that we validate that it does not exist prior.

Change-Id: If8c5afed1ce3076e4458b50eb11ffb87e7534e10
2017-06-25 04:06:52 -07:00
Gary Kotton 881bc26b3a NSX|V: prevent deadlock with subnet creation and deletion
Ensure that we treat the locks in the same order with the
delete and create operations.

The fix above result in a deadlcok due to a change in neutron
where ipam delete call port_update. This conflicted with
commit d89eba1a85.

To ensure locking for this we make use of a new lock for the
DHCP interfaces.

Change-Id: I6c3f25ab40247853024560c00d3faa106e5d90b8
2017-06-08 09:32:22 +00:00
Gary Kotton e256b32a71 NSX|V: use the same DHCP if multiple subnets on same network
When using the exclusive DHCP flag and we have more than one subnet
then make use of the existing edge.

Change-Id: I7b1c779db185b439bf5caf4f6578e7487a78aeff
2017-05-30 04:53:47 +00:00
Adit Sarfaty b754e5ffd5 NSX|V: Support tftp-server dhcp option
The DHCP option tftp-server-name is referred to upstream as tftp-server.
This patch supports both names as the same backend option.

Change-Id: Ied936532eafadcd11cb83c51d456509f9d5eedd6
2017-05-21 09:36:11 +03:00
Gary Kotton d89eba1a85 NSX|V: ensure that the subinterface validations are atomic
Make sure that this is locked with the network id

Change-Id: If12ea3f9ccfddbbd403fe916dbb16a700eeed479
2017-05-15 22:55:18 -07:00
Boden R 4d60df9910 use extra_dhcp_opt api-def from neutron-lib
neutron-lib 1.6.0 is out and among other things contains the rehomed
extra_dhcp_opt API definition. This patch switches usage of such
references from neutron to neutron-lib.

Change-Id: I01736dd067b962689a2fe81903a12099dd638e82
2017-05-15 09:11:28 +00:00
Jenkins 6e6f82acbb Merge "use neutron-lib constants rather than plugin constants" 2017-05-05 01:13:43 +00:00
Boden R b87406fb6e use neutron-lib constants rather than plugin constants
Many of the constants from neutron.plugins.common.constants are now in
neutron-lib. This patch switches over to those in neutron-lib.

Change-Id: Ic266440aae034783e5371842ab293da70deeae04
2017-05-04 06:56:51 -06:00
Adit Sarfaty 35d13ead0f NSX|v: Support more than 2 hostgroups
If edge_ha=True and ha_placement_random=True
The user can configure more than 2 edge_host_groups globally or
per availability zone.
In this case 2 of those will be randomly selected for each deployed edge.

Change-Id: Iaa673e5acf78ecdf8cbc942499cce70a2fe0546c
2017-05-01 04:19:06 +00:00