-
Notifications
You must be signed in to change notification settings - Fork 5
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
NSXT Bulk API for realizing SGs #129
base: stable/yoga-m3
Are you sure you want to change the base?
Conversation
For ports with more than 27 SGs, the approach of adding them as static member one by one results in a rpc-timout. Thus ports rely on the update_sg_group method executed after a port binding. With this commit, we use the nsxt bulk API to add the staticmembership of ports directly after binding the port.
c2e98fa
to
58c4718
Compare
"resource_type": "Child{}".format(o.get("resource_type")), | ||
"marked_for_delete": o.get("marked_for_delete") | ||
} for o in child_objs | ||
{ o } for o in child_objs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This simplification improvement does not work for the delete segment port scenario. Also, this is the reason why one of the functional tests failed. Suggest reviewing it to the old structure and adding the additional fields you need (if any). Also, it will be more readable.
LOG.info(report, "created") | ||
path = "{}".format(API.INFRA) | ||
|
||
res = self.client.patch(path=path, data=data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a lock before the execution of the actual update/create operation. The challenge here is not to lock on the entire "SG_MEMBERS" type but for each group ID individually "member-{}".format(os_id). A semaphore implementation would be required.
|
||
# Fetch _revision data (needed to run put requests) for all updated objects | ||
# This is needed to run put requests on objects since put relies on the correct _revision number | ||
updated_nsxt_objs = self.client.get_all(path=API.SEARCH_DSL, params=API.SEARCH_DSL_QUERY(nsxt_res_type, dsl)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the search API approach. Ideally, we need to use GET /infra as we use the same endpoint for the update/create operation.
For ports with more than 27 SGs, the approach of adding them as static member one by one results in a rpc-timout. Thus ports rely on the update_sg_group method executed after a port binding.
With this commit, we use the nsxt bulk API to add the staticmembership of ports directly after binding the port.