Answers to common questions on OpenStack Caching are covered in this topic.
What happens in caching?
Create a wrapper for Neutron client that caches response from Neutron server. If caching is enabled, networks, subnets and Floating IP networks are cached.
Caches list of networks and subnets.
Caches Floating IP networks for a given subnet.
Caches list of networks/ subnets when GET on a network is issued.
If the list already has network/ subnet, GET on a network/ subnet is fetched from the cache itself.
When deployed in Provider mode there is only one Neutron client, keeping track of tenants is not required. RBAC policies are not cached, since they change and networks may not be available for tenants.
When deployed in Tenant mode, there is a Neutron client for each tenant, each client has its own cache.
Issuing get-internals API on cloud will print the cache in /var/log/upstart/cloud-connector.log for inspection.
The API to view the cache entries is /api/cloud//internals</code> or to view from the CLI is
show cloud <cloud_name>. The internals which will be printed in the /var/log/upstart/cloud-connector.log.
The API is /api/cloud//internals</code> or from the CLI
show cloud <cloud_name> internals, post the API or CLI command is fired the cache entries can be seen in the /var/log/upstart/cloud-connector.log.
How can caching be enabled?
Set cloud level option
enable_os_object_caching. Below are the steps:
configure cloud <cloud-name> openstack_configuration enable_os_object_caching save save
What is the frequency of the caching, what is the expiry of caching?
Once caching is enabled, it remains in the same state until manually changed back.
There is no expiry for the cache, but the cache can be cleaned up by calling an API or by the CLI.
Issue GC with force option to run only GC. Running this will clear cache if caching is enabled. It can be also done with the API or CLI as mentioned below:
PUT /api/cloud/cloud-uuid/gc?force=Trueis used to clear the cache through API.
exec cloud cloud-name gc forceis used to clear the cache through CLI.
The above API and CLI are used to clear the cache.
If the caching does not have the information will it call an API towards OpenStack?
Yes, the API towards OpenStack is fired when there is no information in the cache.
When to refresh the cache?
When new tenant is onboarded.
When new routers or floating IP networks are added in OpenStack.