]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Implement clone_image caching on SolidFire
authorJohn Griffith <john.griffith8@gmail.com>
Thu, 18 Dec 2014 17:55:05 +0000 (10:55 -0700)
committerJohn Griffith <john.griffith@solidfire.com>
Mon, 12 Jan 2015 23:09:07 +0000 (16:09 -0700)
commitee653ad1389e38f32faddf9dabb79a0c0e9a4770
treea1aa2d647d49dc02f2b4d99cd433fad1d35ea7d6
parent9742b7d3611aa6eece0abc3c6479290a825b5c40
Implement clone_image caching on SolidFire

When performing boot from Volume on none FS based devices or devices
that aren't also acting as Glance Image stores, the current process goes
like this:
1. Fetch the image from Glance Store to a temp file on the Cinder Node
2. Perform a qemu-img convert on that file (convert to raw)
3. Transfer the contents of that file to the newly created Volume using dd

This process can take a while and is pretty inefficient. This BP introduces
the option for Operators to enable image-caching on the SolidFire backend device.

When enabled this option will use the existing Cinder clone_image method,
and will create a "Template Volume" of minimum required size on the SolidFire
backend. This Volume will be created with a backend SolidFire account that can
be shared among OpenStack Tenants.

When a request is received we first do a number of checks before proceeding:
1. Is Image/Template caching enabled
2. Inspect the image-metadata and verify that the image is public,
   or that the tenant making the request is the owner
3. Verify that the image-metadata includes the properties['virtual_size']
   parameter

If the preconditions are met, create a minimal sized Volume with the requested
image; then use SolidFires clone operation to create the requested bootable
Volume. During the process we also check and make sure that the image hasn't
been updated since we created our cached copy, if it has we then delete the
copy we have on the system and create a new one.

Also updated those drivers with docstrings duplicating the params info.  I did
not rewrite or modify those that didn't include changed info.  I'm not sure we
should duplicate docstring info for base methods like this anyway, but that's
irrelevant for this work.

Change-Id: I2fac9410f504dff1aaa9fe0b9a274db7b074fa50
Implements: blueprint implement-solidfire-cloneimage
13 files changed:
cinder/tests/test_gpfs.py
cinder/tests/test_netapp_nfs.py
cinder/tests/test_rbd.py
cinder/tests/test_solidfire.py
cinder/tests/test_volume.py
cinder/volume/driver.py
cinder/volume/drivers/ibm/gpfs.py
cinder/volume/drivers/lvm.py
cinder/volume/drivers/netapp/dataontap/nfs_base.py
cinder/volume/drivers/rbd.py
cinder/volume/drivers/scality.py
cinder/volume/drivers/solidfire.py
cinder/volume/flows/manager/create_volume.py