Bug 1267943

Summary: [RFE][cinder] Generic image cache functionality
Product: Red Hat OpenStack Reporter: Sean Cohen <scohen>
Component: openstack-cinderAssignee: Eric Harney <eharney>
Status: CLOSED ERRATA QA Contact: lkuchlan <lkuchlan>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: ddomingo, eharney, jschluet, sgotliv, yeylon
Target Milestone: betaKeywords: FutureFeature, OtherQA
Target Release: 8.0 (Liberty)   
Hardware: Unspecified   
OS: Unspecified   
URL: https://blueprints.launchpad.net/cinder/+spec/image-volume-cache
Whiteboard:
Fixed In Version: openstack-cinder-7.0.0-2.el7ost Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 1297249 (view as bug list) Environment:
Last Closed: 2016-04-07 21:10:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1297249    

Description Sean Cohen 2015-10-01 12:36:19 UTC
This introduces a new feature for backends to be able to use cached
glance images when creating volumes from images.

If enabled, and the cinder internal tenant is configured, it will
create a minimal sized clone of a volume the first time it is
downloaded from glance. A new db table ‘image_volume_cache’ tracks
these volumes, which are owned by the Cinder internal tenant. The
original will then be extended to full size. Any subsequent requests to
create a volume from an image will be able to do a volume clone from
the image-volume cache entry instead of downloading the image data from
glance again.

Comment 4 lkuchlan 2016-02-03 08:52:08 UTC
Tested using:
python-cinder-7.0.1-5.el7ost.noarch
openstack-cinder-7.0.1-5.el7ost.noarch
python-cinderclient-1.4.0-1.el7ost.noarch

[stack@instack ~]$ cinder create 1 --image 18234a00-1493-44b6-b6aa-5d78a500a752

From cinder db:

MariaDB [cinder]> select * from image_volume_cache_entries;
+---------------------+----+---------------------------------------------------------+--------------------------------------+--------------------------------------+------+---------------------+
| image_updated_at    | id | host                                                    | image_id                             | volume_id                            | size | last_used           |
+---------------------+----+---------------------------------------------------------+--------------------------------------+--------------------------------------+------+---------------------+
| 2016-01-27 20:45:08 |  1 | overcloud-controller-0.localdomain@Netapp1#vol_rhos_nfs | 2bc9560b-6e7c-4614-a332-3f263ed5fdc8 | c75409d8-dea2-401f-996e-e13cd6c98747 |    1 | 2016-02-03 08:43:27 |
+---------------------+----+---------------------------------------------------------+--------------------------------------+--------------------------------------+------+-------------------

Comment 6 errata-xmlrpc 2016-04-07 21:10:09 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://rhn.redhat.com/errata/RHEA-2016-0603.html