Answers to common questions on OpenStack Caching are covered in this topic.

  1. 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.

    1. Caches list of networks and subnets.

    2. Caches Floating IP networks for a given subnet.

    3. Caches list of networks/ subnets when GET on a network is issued.

    4. If the list already has network/ subnet, GET on a network/ subnet is fetched from the cache itself.

    5. 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.

    6. When deployed in Tenant mode, there is a Neutron client for each tenant, each client has its own cache.

    7. Issuing get-internals API on cloud will print the cache in /var/log/upstart/cloud-connector.log for inspection.

    8. 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.

    9. 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.

  2. 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
  3. What is the frequency of the caching, what is the expiry of caching?

    1. Once caching is enabled, it remains in the same state until manually changed back.

    2. There is no expiry for the cache, but the cache can be cleaned up by calling an API or by the CLI.

      1. 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:

        The API PUT /api/cloud/cloud-uuid/gc?force=True is used to clear the cache through API.

        The exec cloud cloud-name gc force is used to clear the cache through CLI.

        The above API and CLI are used to clear the cache.

  4. 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.

  5. When to refresh the cache?

    • When new tenant is onboarded.

    • When new routers or floating IP networks are added in OpenStack.