Bug 1622453 - cinder always check image_volume_cache_max_size_gb and image_volume_cache_max_count when either of them is specified.
Summary: cinder always check image_volume_cache_max_size_gb and image_volume_cache_max...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-cinder
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 10.0 (Newton)
Assignee: Cinder Bugs List
QA Contact: Avi Avraham
Kim Nylander
URL:
Whiteboard:
Depends On: 1641111
Blocks: 1642155
TreeView+ depends on / blocked
 
Reported: 2018-08-27 08:50 UTC by Keigo Noha
Modified: 2022-03-13 16:02 UTC (History)
3 users (show)

Fixed In Version: openstack-cinder-9.1.4-44.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1641111 1642155 (view as bug list)
Environment:
Last Closed: 2019-01-16 17:11:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1792944 0 None None None 2018-09-17 14:00:14 UTC
OpenStack gerrit 603145 0 None MERGED Fix image volume cache max size and max count limits 2020-05-22 13:55:35 UTC
OpenStack gerrit 612470 0 None MERGED Fix image volume cache max size and max count limits 2020-05-22 13:55:35 UTC
Red Hat Issue Tracker OSP-13694 0 None None None 2022-03-13 16:02:06 UTC
Red Hat Product Errata RHBA-2019:0079 0 None None None 2019-01-16 17:11:07 UTC

Comment 2 Alan Bishop 2018-09-06 13:47:48 UTC
I see the problem in the upstream code.

Comment 3 Alan Bishop 2018-09-27 14:41:27 UTC
Starting backports to upstream stable branches.

Comment 4 Keigo Noha 2018-10-09 00:38:43 UTC
Hello Alan,

Is it possible to include the fix into RHOSP13 also?

Best Regards,
Keigo Noha

Comment 5 Alan Bishop 2018-10-09 12:50:15 UTC
The fix will be available in OSP-13z3. The patch is on upstream stable/queens, and will be brought downstream during the next bulk import. You may soon see this BZ cloned to track the fix for all releases (except OSP-11, which is EOL) back down to OSP-10.

Comment 6 Alan Bishop 2018-10-19 19:34:49 UTC
Just to clarify, if you follow bug #1641111 you will see the upstream patch for this issue will be included in the next OSP-13 release. Work continues on backporting the fix downstream for this OSP-10 release.

Comment 15 Tzach Shefi 2018-12-03 12:52:34 UTC
Verified on:
openstack-cinder-9.1.4-44.el7ost.noarch


Configure cache setting

UC
PROJECT_ID = openstack project list | grep admin | awk {'print $2'}
USER_ID = openstack user list | grep admin | awk {'print $2'}


crudini --set /etc/cinder/cinder.conf DEFAULT cinder_internal_tenant_project_id $PROJECT_ID
crudini --set /etc/cinder/cinder.conf DEFAULT cinder_internal_tenant_user_id $USER_ID
crudini --set /etc/cinder/cinder.conf tripleo_iscsi image_volume_cache_enabled True
crudini --set /etc/cinder/cinder.conf tripleo_iscsi image_volume_cache_max_count 2
systemctl stop openstack-cinder-volume.service
systemctl start openstack-cinder-volume.service


Upload three different images:
glance image-create --disk-format qcow2 --container-format bare --file cirros-0.3.5-i386-disk.img --name cirros
glance image-create --disk-format raw --container-format bare --file cirros-0.3.5-i386-disk.raw --name cirros.raw
glance image-create --disk-format iso --container-format bare --file dsl-4.4.10.iso  --name dsl

Create a volume, see it's associated image-xx cache volume. 
cinder create 1 --image cirros --name cirros

c-vol log
cache for host hostgroup@tripleo_iscsi#tripleo_iscsi current_size (GB) = 1 (max = 0), current count = 1 (max = 2). ensure_space /usr/lib/python2.7/site-packages/cinder/image/cache.py:146


cinder list
+--------------------------------------+-----------+--------------------------------------------+------+-------------+----------+--------------------------------------+
| ID                                   | Status    | Name                                       | Size | Volume Type | Bootable | Attached to                          |
+--------------------------------------+-----------+--------------------------------------------+------+-------------+----------+--------------------------------------+
| 20a7e726-cb65-47e8-b929-50335eaf6178 | available | image-63e42d41-afc8-4c9a-a6c3-f2acf660b058 | 1    | -           | false    |                                      |
| 3602e295-fcfb-4146-b82f-32a42203824a | available | cirros                                     | 1    | -           | true     |  


Create a second volume
cinder create 1 --image cirros.raw --name cirros.raw

Volume created we also now have two images cached volumes.
cinder list
+--------------------------------------+-----------+--------------------------------------------+------+-------------+----------+--------------------------------------+
| ID                                   | Status    | Name                                       | Size | Volume Type | Bootable | Attached to                          |
+--------------------------------------+-----------+--------------------------------------------+------+-------------+----------+--------------------------------------+
| 20a7e726-cb65-47e8-b929-50335eaf6178 | available | image-63e42d41-afc8-4c9a-a6c3-f2acf660b058 | 1    | -           | false    |                                      |
| 3602e295-fcfb-4146-b82f-32a42203824a | available | cirros                                     | 1    | -           | true     |                                      |
| 6fa80756-4f40-461d-8b71-d47eafa30ce4 | available | image-52179e9d-e6ea-4d3d-a84f-ce04d45562f1 | 1    | -           | false    |                                      |
| 71a5897c-69d7-4c6b-a243-f1ba64017249 | available | cirros.raw                                 | 1    | -           | true     |    

Now the third volume
cinder create 1 --image dsl --name dsl

Notice 3 volumes and only two cached images, notice one of the cached images was replaced.
image-63e42d41.. was replaced with image-4210239e

+--------------------------------------+----------------------------------+-----------+--------------------------------------------+------+-------------+----------+--------------------------------------+
| ID                                   | Tenant ID                        | Status    | Name                                       | Size | Volume Type | Bootable | Attached to                          |
+--------------------------------------+----------------------------------+-----------+--------------------------------------------+------+-------------+----------+--------------------------------------+
| 1ffbfb1b-faed-4137-8dad-6146958c7d28 | a95cb0dd6fc7482292a46ea8a05d5d23 | available | image-4210239e-ef6c-4538-a5e5-c6b13611502f | 1    | -           | false    |                                      |
| 3602e295-fcfb-4146-b82f-32a42203824a | a95cb0dd6fc7482292a46ea8a05d5d23 | available | cirros                                     | 1    | -           | true     |                                      |
| 3609cf76-f715-4706-89b7-91ecc2e1d548 | a95cb0dd6fc7482292a46ea8a05d5d23 | available | dsl                                        | 1    | -           | true     |                                      |
| 6fa80756-4f40-461d-8b71-d47eafa30ce4 | a95cb0dd6fc7482292a46ea8a05d5d23 | available | image-52179e9d-e6ea-4d3d-a84f-ce04d45562f1 | 1    | -           | false    |                                      |
| 71a5897c-69d7-4c6b-a243-f1ba64017249 | a95cb0dd6fc7482292a46ea8a05d5d23 | available | cirros.raw                                 | 1    | -           | true     | 


C-vol log evict notice
d': u'20a7e726-cb65-47e8-b929-50335eaf6178', 'id': 5, 'size': 1}. evict /usr/lib/python2.7/site-packages/cinder/image/cache.py:45
2018-12-03 12:44:48.741 69686 DEBUG cinder.image.cache [req-c3a3b4a3-9a58-40fc-902f-a7347ebc3b44 d27672ee3f5546749333de4c1956aab2 a95cb0dd6fc7482292a46ea8a05d5d23 - - -] ImageVolumeCache notification: action=evict data={'image_id': u'63e42d41-afc8-4c9a-a6c3-f2acf660b058', 'host': u'hostgroup@tripleo_iscsi#tripleo_iscsi'}. _notify_cache_action /usr/lib/python2.7/site-packages/cinder/image/cache.py:192
2018-12-03 12:44:48.752 69686 DEBUG cinder.image.cache [req-c3a3b4a3-9a58-40fc-902f-a7347ebc3b44 d27672ee3f5546749333de4c1956aab2 a95cb0dd6fc7482292a46ea8a05d5d23 - - -] Image-volume cache for host hostgroup@tripleo_iscsi#tripleo_iscsi new size (GB) = 2, new count = 2. ensure_space /usr/lib/python2.7/site-packages/cinder/image/cache.py:163
2018-12-03 12:44:58.484 69686 DEBUG cinder.image.cache [req-c3a3b4a3-9a58-40fc-902f-a7347ebc3b44 d27672ee3f5546749333de4c1956aab2 a95cb0dd6fc7482292a46ea8a05d5d23 - - -] Creating new image-volume cache entry for image 4210239e


Looks great. 

Tip for reference:
DEFAULT cinder_internal_tenant_project_id  ...
DEFAULT cinder_internal_tenant_user_id ....

These two under are set under backend itself
tripleo_iscsi image_volume_cache_enabled True
tripleo_iscsi image_volume_cache_max_count 2

Restart service/docker

Related config bits
https://docs.openstack.org/cinder/latest/admin/blockstorage-image-volume-cache.html

Comment 19 errata-xmlrpc 2019-01-16 17:11:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0079


Note You need to log in before you can comment on or make changes to this bug.