Closed naved001 closed 5 years ago
okay, everything is functional now at least. tests/deployment/vlan_networks.py
took 290 seconds to run using ansible compared to 150 seconds with the curernt HIL driver (which uses REST API CLI).
Hm, hopefully using the roles will give us some portability. If not I don't see what we're getting out of this; the current implemenation is more code, brings in an extra dependency, and is apparently twice as slow. But it seems like we'll still need to have per-vendor drivers at least for a while, though maybe not per-model.
I have doubts about how this implemented. I would have expected the code to be completely generic and wrap around the role for implementation. The role can handle the abstraction northbound into HIL and implement device specific calls southbound towards the device. In this way there would only have to be a single Ansible driver and the role would handle the device specific interactions.
Adding support for new platforms becomes as easy as updating the role and not having to touch the code path. So adding support for vendor XYZ is a matter of adding the device specific implementation into the role (or even the lookup path). In fact, the role allows for specific implementation to be build on a per device / per connection type basis. In this way, the implemenation only needs to concern itself with the data exchange between Ansible and the HIL driver and not code device specific calls into the driver.
With regards to the performance, I would need to dig into this a bit more to understand how the performance is being measures. I would expect a light bump in performance as we are invoking an external process (Ansible) to handle the device configuration.
I would have expected the code to be completely generic and wrap around the role for implementation.
I agree. I kind of tried to split the driver into two files, with ansible specific code in one file (which I hard coded to use the dellos9 modules, just to get something working and to compare performance).
The role can handle the abstraction northbound into HIL and implement device specific calls southbound towards the device.
That sounds ideal and I'll update this PR to use that instead. Is there some generic networking role that I can use? I could only find the Dell vlan role which I linked to earlier.
With regards to the performance, I would need to dig into this a bit more to understand how the performance is being measured.
I ran our networking tests (which perform a bunch of networking operations on the switch) using pytest which returns how long it takes to run.
Thanks for the feedback @privateip!
Something like this perhaps https://github.com/openstack/networking-ansible/tree/master/etc/ansible/roles/openstack-ml2 ?
There's a bit of the portability story that's just not sticking to my brain: as far as I can see, the existant ansible roles and modules are all at least vendor-speciifc (if not device specific). I don't see how we can lean on ansible for portability given that it doesn't seem to actually expose a device-agnostic interface to role authors? Do you guys have plans to build a portable interface like this? What am I missing?
Just to keep folks updated, I'll get back to working on this next week (a more generic version that uses roles).
@zenhack sorry for the tardiness on my side.
Do you guys have plans to build a portable interface like this?
Yes, the work is well underway to have a more generate entry point role that will provide the level of abstraction you are looking for. The initial build is currently moving upstream into ansible networking right now and I will follow up here with a link to that effort as it comes.
Good to hear. Maybe it makes sense to defer most of the HIL work until that's available? Per the above, I don't know that it makes a ton of sense for us to write vendor specific drivers.
Still a work in progress, I am opening this to start some discussion and gather some feedback.
Few things:
I can run the methods from the interpreter, but when I run our test suite, I get some errors from ansible_runner. Haven't really looked into it yet.
cc: @zenhack @privateip