This change reduces info level logging such that it only produces
logs when CVX state needs to be updated. Internal accounting has
been changed to DEBUG level.
Network create before change at INFO level:
31521 Arista Sync time 1590625762.4879267 last sync 1590625762.2405837 timeout 0.7526607513427734
31521 Processing create network ID: e7af8f41-89ef-4a9c-b0bf-619056e5112f
31521 create network with id e7af8f41-89ef-4a9c-b0bf-619056e5112f
31521 Requesting create Networks resource e7af8f41-89ef-4a9c-b0bf-619056e5112f
31521 Resource Networks e7af8f41-89ef-4a9c-b0bf-619056e5112f found, creating
31521 Networks resource e7af8f41-89ef-4a9c-b0bf-619056e5112f added locally
31521 create requisite tenant with id tid
31521 Requesting create Tenants resource tid
31521 Resource Tenants tid found, creating
31521 Tenants resource tid added locally
31521 Tenants resource tid requires update
31521 create requisite segment with id 253f985d-4708-4980-a298-e99489cb6a74
31521 Requesting create Segments resource 253f985d-4708-4980-a298-e99489cb6a74
31521 Resource Segments 253f985d-4708-4980-a298-e99489cb6a74 found, creating
31521 Segments resource 253f985d-4708-4980-a298-e99489cb6a74 added locally
31521 Getting PortBindings from CVX
31521 No PortBindings resources to delete
31521 Getting BaremetalPorts from CVX
31521 No BaremetalPorts resources to delete
31521 Getting VmPorts from CVX
31521 No VmPorts resources to delete
31521 Getting RouterPorts from CVX
31521 No RouterPorts resources to delete
31521 Getting DhcpPorts from CVX
31521 No DhcpPorts resources to delete
31521 Getting Baremetals from CVX
31521 No Baremetals resources to delete
31521 Getting Vms from CVX
31521 No Vms resources to delete
31521 Getting Routers from CVX
31521 No Routers resources to delete
31521 Getting Dhcps from CVX
31521 No Dhcps resources to delete
31521 Getting Segments from CVX
31521 No Segments resources to delete
31521 Getting Networks from CVX
31521 No Networks resources to delete
31521 Getting Tenants from CVX
31521 No Tenants resources to delete
31521 Getting Tenants from CVX
31521 Getting Tenants from neutron
31521 Creating Tenants resources with ids tid on CVX
31521 Tenants resources with ids tid created on CVX
31521 Getting Networks from CVX
31521 Getting Networks from neutron
31521 Creating Networks resources with ids e7af8f41-89ef-4a9c-b0bf-619056e5112f on CVX
31521 Networks resources with ids e7af8f41-89ef-4a9c-b0bf-619056e5112f created on CVX
31521 Getting Segments from CVX
31521 Getting Segments from neutron
31521 Creating Segments resources with ids 253f985d-4708-4980-a298-e99489cb6a74 on CVX
31521 Segments resources with ids 253f985d-4708-4980-a298-e99489cb6a74 created on CVX
31521 Getting Dhcps from CVX
31521 Getting Dhcps from neutron
31521 No Dhcps resources to create
31521 Getting Routers from CVX
31521 Getting Routers from neutron
31521 No Routers resources to create
31521 Getting Vms from CVX
31521 Getting Vms from neutron
31521 No Vms resources to create
31521 Getting Baremetals from CVX
31521 Getting Baremetals from neutron
31521 No Baremetals resources to create
31521 Getting DhcpPorts from CVX
31521 Getting DhcpPorts from neutron
31521 No DhcpPorts resources to create
31521 Getting RouterPorts from CVX
31521 Getting RouterPorts from neutron
31521 No RouterPorts resources to create
31521 Getting VmPorts from CVX
31521 Getting VmPorts from neutron
31521 No VmPorts resources to create
31521 Getting BaremetalPorts from CVX
31521 Getting BaremetalPorts from neutron
31521 No BaremetalPorts resources to create
31521 Getting PortBindings from CVX
31521 Getting PortBindings from neutron
31521 No PortBindings resources to create
After:
32632 Arista Sync time 1590625370.1938148 last sync 1590625369.7015142 timeout 0.5077025890350342
32632 Processing create network ID: db232697-ba88-43c0-85e2-7957cf675aca
32632 Creating Tenants resources with ids tid on CVX
32632 Tenants resources with ids tid created on CVX
32632 Creating Networks resources with ids db232697-ba88-43c0-85e2-7957cf675aca on CVX
32632 Networks resources with ids db232697-ba88-43c0-85e2-7957cf675aca created on CVX
32632 Creating Segments resources with ids 978ae7ed-718f-4d43-8c4c-f227656278fa on CVX
32632 Segments resources with ids 978ae7ed-718f-4d43-8c4c-f227656278fa created on CVX
Change-Id: I77c569870f9c1a09e4d4956c87943ebd77d7a62f
(cherry picked from commit c35fef5129)
This change contains two fixes:
1. When a port goes to ERROR state, treat it as a delete
2. When a device_id is '', don't query for all instances
Change-Id: I587fef123e0552cc3bd2fe3fb74cfcb2dbb23c8b
This test adds support to store defined routes in unit tests and to
validate that no routes are recreated during sync operation
Change-Id: If2bc4b7334f472d83b307fecc6aad5b20f6b86af
(cherry picked from commit 5843ba4cc6)
This change removes the delete_default_gateway function from
create_router call path and updates the synchronize function to update
proper VRF default gateways only when needed.
Change-Id: I874b3f15f39e914282d7b92a07af9024c39e916f
Updated the code to use show version to check which vrf creation command
the switch supports. This will eliminate extra entries in syslog
Change-Id: Id3c3e42d2fc7165e5ea3c20bec3343c559f6465f
bind_port gets called in the API worker, of which there may be
multiple processes. This change passes external=True to ensure
we use an interprocess lock.
Change-Id: Ia4a94f00ef94faf8d4b6892550d32a6540c8e989
On switches that do not support vrf instance command, if the command
fails it will try again to check which commands are supported and will
generate a loop. This will prevent the L3 plugin to check for vrf
supported commands while it is checking what command are supported
Change-Id: If441bbf2c5d3863282aaede55f7f6f130c67844e
(cherry picked from commit b6d6c44428)
When an exception happens in synchronize thread, it will die and not
recover. Wrapping in try/catch to protect against any error. Also added
some logging to know step in processing
Change-Id: Ic0c9016daebd547ffa23408444c43849b953d98b
This change adds the option to create default route for routers that
have a default gateway defined. This is controled by setting
vrf_default_route option in the configution
Change-Id: I16ae7feacb04730111a4b5eb61d2c3ae0fb3f041
(cherry picked from commit 06d6342a44)
L3 plugin will be able to handle both swtiches that support only the
newer syntax with vrf instance and the old vrf definition syntax.
Change-Id: I2e9b88c4e6d18eb3880f44532c93cc8cb9b2f2f4
This change includes 3 fixes:
1. Sync workers sleep for [0,1) seconds after every sync
2. Dependent resources are always synced in the same sync cycle
3. Sync lock is released on failure if at least one successful sync has occurred
Change-Id: I1ab75dcce69b68acf63c24d31a3e106ecc506fb3
(cherry picked from commit 84a118e718)
Query one more time from NetworkSegment for a dynamic segment added
to the table instead of relying on what reserve_provider_segment returns
Change-Id: Idb9bdfc08767b0f17815f4189501df4307844e34
With previous patch the INTERNAL-TENANT-ID was used, instead of blank project_id,
for creating L3 HA network on CVX. This patch removes the use of
INTERNAL-TENANT-ID and instead it uses the project_id from HA router for
creating network, or port resources on CVX.
Change-Id: I632ce29f934d2e3cc96032e2baeee7e96f20d8f3
If L3 HA is enabled in neutron, by creating a router, a HA network with
no project_id is created. With this patch Arista ML2 driver uses an internal
project_id, i.e. 'INTERNAL-TENANT-ID', to set the project_id of the network when
creating it on the CVX.
Change-Id: Ifb9ce0a4594706945cef47321d902aa07a5944dd
(cherry picked from commit 094b199a71)
Introduced here: b9da887f10 (diff-a39fc679b45b22381f9becb81ed137f3L27)
The case of the 'o' in the error message was changed which results in
get_cvx_master not advancing to the next CVX server which breaks
HPB & the arista_vlan type driver if the first CVX in the list isn't
master.
Change-Id: I9d94b06c9862ba383f3a9044900db4e97b8072d6
With recent changes in security group rules where it uses dynamic lazy
mode for fetching security group rules, joinedload cannot be used as it is
using joined eager loading
Change-Id: I73c585a6e8d32e7556968f775011b649195ada40
(cherry picked from commit ab0e8a05d2)
Network with empty project_id is not supported on CVX. This patch
filters segments with network_ids that have empty project_id
Change-Id: I8f1f6f48f0ab7e05ca0130157199aeca34ea25e2
(cherry picked from commit 07ce6b1fc6)
This driver immediately sets ports to ACTIVE upon being bound
to simulate OVS/LinuxBridge agent operation when utilizing
the fake.FakeDriver compute driver.
Change-Id: Ia0c89aa00c1998fdf64a81113c1a355f44719fa1
The arista_vlan type driver's sync thread actually runs in
a separate process so interthread communication through shared
memory fails. This fixes the situation by having the type driver
query the db for the correct network_vlan_range before calling the
base vlan driver's allocation, verification and release methods that
use that variable.
Change-Id: I0e5590388b62a346aa747192dd84f93e9e380a63
We were filtering ports only by device_id for the purpose of SVI/VLAN
creation. We only create SVIs for network:router_interface ports in the
driver, so the same should hold for the sync worker.
Change-Id: I31f6229b3c50b0c57ecbfb32de99ec080070cb94
This adds two new config settings: enable_cleanup and protected_vlans
that allows the L3 sync worker to cleanup stale VRFs, SVIs and VLANs
on L3 hosts without affecting config from sources that are not the Arista
L3 plugin. This change also adds support for automatic config file
generation with oslo-config-generator.
Change-Id: Ia1f151e7e54a7d8712279aa0d7b3adf7731feaab
When the arista_vlan type driver is enabled, but CVX is not reachable,
Neutron cannot be started as the parsing of available VLANs hits an
exception. This change causes available VLANs to be an empty list
at startup, which will prevent VLAN network creation until CVX is reachable,
but will not interfere with Neutron startup.
Change-Id: I100a62da7782023e9acb167662c2a5159bedf338
(cherry picked from commit 21cd790be4)
1. Ensure port->network dependency is enforced in update_port_postcommit
2. Always send creates if resource in DB (resource may have been deleted by
another worker)
3. If resource in DB, do not send DELETE, send a POST instead
(indicates resource was recreated)
4. Ignore 'Unkown port id' in errors in DELETEs
5. Track that a sync is still necessary when sync lock is not grabbed
6. DB queries must be done with the sync lock to avoid race conditions
7. Run sync worker in separate process to avoid blocking other workers
Change-Id: I25b4c55d77a5a00087d8679a5323ab956f3b9665
This mech driver will essentially randomly distribute mech driver
updates randomly to one of 3 Arista sync workers in an effort to
simulate a neutron HA deployment (where there would be 3 mech drivers
distributing updates to 3 workers.)
Change-Id: I672b762e327d8a4cb54018cc3f8807725dce075b
(cherry picked from commit 799a87a651)
Also:
- Improved error logging for L3/SG/arista_vlan
- Fixed tenant_id filter for router query
- Fixed VRF creation for routers with a space in their name
Change-Id: I7917b988d3e45e653a19c791b8529077ba93389b
This change results in resource updates becoming implicit
when a resource has changed by comparing the new resource
to the existing resource and forcing a POST if they differ.
Change-Id: Id43b042228288a510dbc814135c006d72fe2f0ff
1. Fix the format string for full sync complete
2. Correctly force a full sync on any failure
3. Fully remove SG code from arista_sync
4. Don't create/delete port_bindings for unsupported ports
Change-Id: I990e55b9d116d258a3011290b025920f3fb4ae1d
(cherry picked from commit 493c5efce9)
Dependent resources should be deleted before the resources they
depend on to allow CVX to better handle the DELETEs. This avoids
situations such as where we delete a network before its segments
causing the segment DELETEs to fail as a result of being unable
to find the network in the region's network collection.
Change-Id: I1f1fa2d199b45bed52c549731580c06a306a3231
(cherry picked from commit e4685ca436)
The binding_levels may be cleared when update_port is called (e.g. in
case of deleting a baremetal instance). In such a case, original_binding_levels
can be used to get required binding levels.
Change-Id: Ibab2c9d90023c52141ce0b9d57fdafaf0aadf8c9
1. When beginning a sync, we set current_sync_name in the JSON rpc after
a successful POST to the sync endpoint. The only place we reset to the
current_sync_name is in the sync_end(). Therefore, any failure in sync
will result in current_sync_name not being cleared. A future attempt to
begin sync will fail as a result since a POST to sync with a sync_id
specified returns an error if a sync is not in progress with that sync
ID. The fix is to clear the current_sync_name when beginning a new sync
attempt.
2. Update CVX's sync interval if it's not set to avoid immediate sync
timeout.
3. Don't prematurely set the local uuid to cvx uuid, preventing full
syncs if the full sync fails.
4. We were querying CVX before beginning sync, we now do that after sync
begins.
5. Get rid of threading.Event for sync_worker communication. Neutron
starts the sync worker in another process, so it doesn't work.
multiprocessing.Queue uses sockets and fds to implement an interprocess
Queue that does wakeup the sync worker within the other process. It
however does not wakeup a thread within the same process, so use
eventlet.queue.LightQueue for testing.
6. Don't call delete_port_resources for a transition from DOWN -> DOWN
7. Fix network name and instance hostId to match the JSON API model
8. Improve logging for arista_resources and mechanism_arista.
9. Don't sync tenants with id ''
Change-Id: I5adc6f0f420f1d33e05a936d8ca4227c44414d4c
(cherry picked from commit d0372d7a21)