Adding a store driver to allow Cinder as a block storage backend for Glance

Registered by Zhi Yan Liu

We have a driver for swift as an object storage back-end in Glance, so make a block storage back-end is make sense to me, that is Cinder.

**Note**: Currently Cinder store is a partial implementation. After Cinder expose 'brick' library, and Readonly-volume-attaching', 'volume-multiple-attaching' enhancement ready, the store will support 'Upload' and 'Download' interface finally.

Interfacing to cinderclient and creating a read only volume specifically for image store.
1. Create an image-store volume (special type volume that's R/O).
2. Store the glance image, and update glance to have a record of the image and it's location (specifically provider_location).
3. Copy can use the clone functionality which is especially great for back-ends with advanced cloning capability.

Blueprint information

John Griffith
Zhi Yan Liu
Zhi Yan Liu
Series goal:
Accepted for havana
Milestone target:
milestone icon 2013.2
Started by
Zhi Yan Liu
Completed by
Mark Washenberger

Related branches



I'd still really like to see us move away from exposing efficient volume behaviors in glance, and instead focus on figuring out how to get nova to use cinder more effectively. But I think registering cinder volumes as images could be an acceptable way to deliver some good features more quickly.

After more thought, this seems like a perfect fit, as expressing the full block device mapping for an instance seems like the direction Glance should go.

For now the implementation for this blueprint has following dependencies:
Sort team (H2):
1. image-multiple-location:
Long team (H3-):
1. cinder brick:
2. volume-host-attaching:
3. multiple-attaching:
for #3 we need concurrent control for the volume attaching and detaching code/behavior, because under multiple glance-api runtime, volume access under concurrent status, such as glance-api #A get volumeX size, and glance-api #B download (read) it, #A maybe finish early then #B read, so if #A detach the volume (iscsi session logout) on that time, #B will be failed.
  And more, the concurrent control for attaching and detaching logic is needed also to maintain the attached device status between the nova and glance when those components running on the same host.
  For example, a iscsi volume could be attached two times, one from glance-api process and one from nova-compute, but there is only one attached device in whole system ('/dev/sdc' file), and if glance-api detach and remove the attached device before nova-compute then nova will meet I/O error since the attached device been removed prematurely.

  Addressed by:
      Adding Cinder backend storage driver to Glance

  Have you considered a path where glance does not have to attach and detach but instead call cinder API that would take an image glance url. Cinder should be the one with knowledge to move image they can get from glance like nova does and then stream into a pre-created volume. This could require a change in API for volume post in cinder. I found that cinder driver supports copy of glance images to volumes and see this in API so it could just work

This looks like something you could use for add implementation:


Work Items

Dependency tree

* Blueprints in grey have been implemented.