This patch adds an option to collect per cluster or per endpoint API
call records during _proxy() call. This enables client side API auditing
without the need to rely on NSX support bundles. By default this option
is disabled.
Change-Id: Ied30d90fc745d5009850c1c83c74eacd46d5fbd9
In a multi cluster setup, an adaptive API rate limit is more useful as
utilization can be dynamically balanced across all active clusters.
AIMD from TCP congestion control is a simple but effective algorithm
that fits our need here, as:
- API rate is similar to TCP window size. Each API call sent
concurrently is similar to packets in the fly.
- Each successful API call that was blocked before sent will cause rate
limit to be increased by 1. Similar to each ACK received.
- Each failed API call due to Server Busy (429/503) will cause rate
limit to be decreased by half. Similar to packet loss.
When adaptive rate is set to AIMD, a custom hard limit can still be set,
max at 100/s. TCP slow start is not implemented as the upperbound of
rate is relativly small. API rate will be adjusted per period. API
rate under no circumstances will exceed the hard limit.
Change-Id: I7360f422c704d63adf59895b893dcdbef05cfd23
Now that we are python3 only, we should move to using the built
in version of mock that supports all of our testing needs and
remove the dependency on the "mock" package.
Also see commit: Ifcaf1c21bea0ec3c35278e49cecc90a101a82113
Change-Id: I11dc8a80471be347f89a30f59c1cc14cdb879726
The user will be able to specify exception config object, that
defines which exceptions bring endpoint down, and which exceptions
trigger retry.
This change removes exception handling from the client class, which
hopefully makes the code more readable and easier to follow.
Change-Id: If4dd5c01e4bc83c9704347c2c7c8638c5ac1d72c
Currently in nsxlib, there's no client side API rate throttling. In a
scale setup it is deemed to easily overwhelm NSX backend. This patch
introduces a per-endpoint rate limiter that blocks over-limit calls.
Change-Id: Iccd1d2675bed16833d36fa40cc2ef56cf3464652
API calls can fail with corfudb exception if the MP cluster is
reconfiguring. When this exception was encountered, MP recovered
in a second and subsequent API calls went through. Added a retry
with random exponential back-off mechanism if this exception is
seen with a API call.
Change-Id: I1bb4f432f15b9da025ae204a2f6e7646f268b8f1
Those tags can be used for policy resources, where there is no need
to add the os resource id to the tags, as it is the same as the NSX id.
Change-Id: I4e9644957dbfd16194f556cbff5447f2a2e49669
In case of too many requests in a short period of time, the NSX will
return response 429.
In this case (if configured) the nsxlib client will retry sending the request.
This option is controlled by a new parameter in the nsxlib config
rate_limit_retry which is enabled by default.
Change-Id: I20fca36d553e1e74da61292342a87247b53b5d13
The NSX has various tag limitations. For example the maximum
length of the tags and the maximum amount of tags per resource.
This may increase with NSX versions.
This patch enables the library to learn from the NSX the tag limits.
Change-Id: Ie2eac9c51a36496908140018d7ca1d15ed0e9d58
The patch removes the neutron-lib from the dependencies. We do not
want/need the consumers of this library to pull in all of the
neutron-lib dependencies.
The patch adds the following:
1. callback to bind is_attr_set - set_is_attr_callback
2. A new exception NsxLibInvalidInput - this is raised when inputs
are invalid.
Change-Id: Ia8ec71dee2d5de921700a9b4fd7e789d2aed4679
Adding log messages before & after each retry call, to help debugging.
The before message (will not appear before the first call):
Retrying call to 'func-name' for the #th time:[Last exception here]
The after message:
Finished retry number #th to 'func-name' after X(s) with args: (...):
[Last exception here]
Change-Id: Ib4a91fbfd45d9454bbd92d9f77f8c888cec80efa
This patch adds API wrapper classes for nsxv3 load balancer
resources including the followings:
- ApplicationProfile
- PersistenceProfile
- ClientSslProfile
- ServerSslProfile
- Monitor
- Pool
- VirtualServer
- Service
These nsxlib classes are used initially for neutron LBaaS/Octavia.
But can also be consumed by other use cases.
Change-Id: I0fc80e20551e0994888d8c222a9a620dcb2f6e32