Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mso_schema_site_anp_epg_bulk_staticport.py - Add static ports to list of EPGs instead of one (DCNE-76) #424

Open
BGP-Boss10 opened this issue May 23, 2024 · 12 comments
Labels
enhancement New feature or request jira-sync Sync this issue to Jira

Comments

@BGP-Boss10
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

  • Currently, mso_schema_site_anp_epg_bulk_staticport.py is only able to bulk add static ports to one single EPG. This would be MUCH more useful if this same bulk action was able to be executed against a list of EPGs instead of just one.

New or Affected Module(s):

  • mso_schema_site_anp_epg_bulk_staticport.py

MSO version and MSO Platform

  • NDO version 3.7.2h and later

APIC version and APIC Platform for Site Level Resources

  • APIC version 5.2 and later

Collection versions

  • cisco.mso 2.6.0

References

@BGP-Boss10 BGP-Boss10 added the enhancement New feature or request label May 23, 2024
@akinross
Copy link
Collaborator

akinross commented May 24, 2024

Hi @BGP-Boss10,

I have added it to the todo list and we will discuss this with the team. Personally I think this would be a wider discussion as in providing list capability input for objects, which is not limited to the the epg object.

Furthermore, if we were to make changes it would be in the mso_schema_site_anp_epg_staticport module because the mso_schema_site_anp_epg_bulk_staticport has been deprecated and will be removed in future release.

@BGP-Boss10
Copy link
Author

Oh my apologies, I didn't realize it was being deprecated.

I must add that this would be one of the most useful enhancements possible. I do not know of a time that I have ever added one static port to one EPG. In my playbooks, I end up looping through a variable list for both, which overloads the API and sends x number of calls. Others in the community seem to use the same workaround as me. I've had some playbooks run for over 40 minutes because of this limitation. With the enhancement I described, this would be a matter of seconds instead.

@akinross
Copy link
Collaborator

akinross commented May 24, 2024

Hi @BGP-Boss10,

Not sure I follow your comment entirely, because you can add N static ports to one EPG. Also I am not sure what workaround you are referring to, could you please provide these details?

The mso_schema_site_anp_epg_bulk_staticport is deprecated because the mso_schema_site_anp_epg_staticport now allows your to add N static ports to an EPG or force replace ALL the static ports assigned to an EPG. See examples in the github repo: https://github.com/CiscoDevNet/ansible-mso/blob/master/plugins/modules/mso_schema_site_anp_epg_staticport.py#L242-L285. Or refer to the documentation for more explanation: https://galaxy.ansible.com/ui/repo/published/cisco/mso/content/module/mso_schema_site_anp_epg_staticport/.

The functionality of the module is thus a merge of the bulk and in addition of the bulk functionality it lets you add or delete multiple static ports in one task execution. These are still multiple add operations but in a single REST request. This increases the speed without risking overwriting changes that are potentially occurring in parallel.

How many EPGs and static ports are you configuring at the moment?

@BGP-Boss10
Copy link
Author

BGP-Boss10 commented May 24, 2024

Sorry about that, I'll try to explain with a bit more context.

I am aware that we can add multiple static-ports to ONE EPG with one REST request now. The limitation is that we cannot add multiple static-ports to multiple EPGs with one REST request.

Below is an example of one of the playbooks I am using currently:

image

As you can see, I am looping through two lists "staticpath" and "EPGList". These variables are lists present in a variable file that I will show below. Please note that I would no longer have to loop through a list called "staticpath" for static-ports, as that functionality is present in the current module, as you mentioned above. I built this playbook before that feature was included in this module. Again, the limitation here is the inability for the same static-ports to be created for multiple EPGs in the same REST request, so I would have to loop through my "EPGList" and execute that same task multiple times. This isn't a problem when I am only adding static-ports to a few EPGs, but I am often adding many static-ports to many EPGs.

Example vars file:

image

Below is an example of my playbook running, you can see that as I iterate over those two lists, "staticpath" and "EPGList", there is a task item for each EPG and each static-port. Again, I now realize I can speed this up a bit by using the bulk static-port enhancement and only loop through the "EPGList" list, but if my provided list of EPGs is very long (and it often is), this can still take a long time to complete.

image

I hope I did a better job at explaining it this time, please ask for more clarification if needed.

@akinross
Copy link
Collaborator

Hi @BGP-Boss10,

Thank you for the more elaborate explanation, I will discuss this further with the team and get back to you somewhere this week.

@akinross
Copy link
Collaborator

Hi @BGP-Boss10,

We have had an discussion with the team and decided that this will not have priority for now. This is due to the increase of complexity inside the module, and determining the exact scope of the module if we include those changes.

We will keep it open that track the interest throughout the community for this issue.

Finally in case you would like to develop this part your self and you need any assistance feel free to contact me directly.

@BGP-Boss10
Copy link
Author

Thanks for getting back to me. This is disappointing as it would have been a great enhancement.

Is your team willing to work on a way to send one static port update to multiple EPGs in one REST request instead? This should be less complex.

@akinross
Copy link
Collaborator

Hi @BGP-Boss10,

I understand that it is disappointing because it does not solve your specific case and apologies for this, but as mentioned previously for now this has no priority for us.

The single static port add to multiple EPGs would still introduce a fair amount of complexity. The complexity lies not in just the add operation, but idempotency, index based removal and list shifting, query and the corresponding output, back-worths compatibility, etc...

Is the add operation the time blocking issue? Or do you also require delete/query operations? If only adding has the speed requirement, have you considered leveraging mso_rest module for this specific add operation?

@BGP-Boss10
Copy link
Author

I can give this a try myself, but I am not proficient in Python. I'll reach out directly.

@akinross
Copy link
Collaborator

akinross commented Jun 2, 2024

Hi @BGP-Boss10,

Sure also feel free to send me an email directly. This way we can schedule a WebEx meeting if needed, which is sometimes easier to discuss topics.

@samiib samiib added the jira-sync Sync this issue to Jira label Aug 13, 2024
@github-actions github-actions bot changed the title mso_schema_site_anp_epg_bulk_staticport.py - Add static ports to list of EPGs instead of one mso_schema_site_anp_epg_bulk_staticport.py - Add static ports to list of EPGs instead of one (DCNE-76) Aug 13, 2024
@BGP-Boss10
Copy link
Author

Hi @akinross I have figured out how to make multiple EPGs and static ports updates within one single API call.

I would like to work on updating this module, but I don't fully understand how you all have written it.

Can we meet to discuss the best way for me to help contribute on this?

@akinross
Copy link
Collaborator

HI @BGP-Boss10, if you could send me an email at [email protected] then we can schedule something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request jira-sync Sync this issue to Jira
Projects
None yet
Development

No branches or pull requests

3 participants