From b7673143decc67f4708d92837deb38c324125536 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 13 Jan 2021 13:53:42 +0200 Subject: [PATCH] Add glance cache variables into glance-api In glance caching doc is stated[1], that some of the variables should be defined in both glance-api and glance-cache config and should be exactly the same, otherwise issues might raise. We also introduce glance_image_cache_stall_time variable to control cache time reliable across config files [1] https://docs.openstack.org/glance/train/admin/cache.html#configuration-options-for-the-image-cache Change-Id: Ic229e71978961546cec5f58a9c963c71e05ffba4 --- defaults/main.yml | 1 + .../glance_image_cache_stall_time-ca8d2750b079279a.yaml | 5 +++++ templates/glance-api.conf.j2 | 3 +++ templates/glance-cache.conf.j2 | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/glance_image_cache_stall_time-ca8d2750b079279a.yaml diff --git a/defaults/main.yml b/defaults/main.yml index b175bfa7..110fd5e3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -178,6 +178,7 @@ glance_keystone_auth_plugin: password ## Glance config glance_image_cache_max_size: 10737418240 +glance_image_cache_stall_time: 86400 # CORS options glance_cors_allowed_origin: "{{ (glance_show_multiple_locations | bool) | ternary(openstack_service_publicuri_proto | default('http') + '://' + external_lb_vip_address, None) }}" diff --git a/releasenotes/notes/glance_image_cache_stall_time-ca8d2750b079279a.yaml b/releasenotes/notes/glance_image_cache_stall_time-ca8d2750b079279a.yaml new file mode 100644 index 00000000..fe1bf215 --- /dev/null +++ b/releasenotes/notes/glance_image_cache_stall_time-ca8d2750b079279a.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Added variable ``glance_image_cache_stall_time`` to control glance cache + time if needed. Defaults to ``86400``. diff --git a/templates/glance-api.conf.j2 b/templates/glance-api.conf.j2 index 5a77ce00..2b4552d4 100644 --- a/templates/glance-api.conf.j2 +++ b/templates/glance-api.conf.j2 @@ -21,7 +21,10 @@ transport_url = {{ glance_oslomsg_rpc_transport }}://{% for host in glance_oslom delayed_delete = False scrub_time = 43200 + image_cache_dir = {{ glance_system_user_home }}/cache/ +image_cache_stall_time = {{ glance_image_cache_stall_time }} +image_cache_max_size = {{ glance_image_cache_max_size }} # defaults to true if RBD is used as default store show_image_direct_url = {{ glance_show_image_direct_url }} diff --git a/templates/glance-cache.conf.j2 b/templates/glance-cache.conf.j2 index 7e8258b1..459e6143 100644 --- a/templates/glance-cache.conf.j2 +++ b/templates/glance-cache.conf.j2 @@ -9,7 +9,7 @@ admin_password = {{ glance_service_password }} admin_user = {{ glance_service_user_name }} admin_tenant_name = {{ glance_service_project_name }} image_cache_dir = {{ glance_system_user_home }}/cache/ -image_cache_stall_time = 86400 +image_cache_stall_time = {{ glance_image_cache_stall_time }} image_cache_max_size = {{ glance_image_cache_max_size }} auth_url = {{ keystone_service_internalurl }} filesystem_store_datadir = {{ glance_system_user_home }}/images/