[openstack-dev] [glance] Replication on image create

Flavio Percoco flavio at redhat.com
Wed Jan 14 08:38:54 UTC 2015

On 13/01/15 21:24 -0500, Jay Pipes wrote:
>On 01/13/2015 04:55 PM, Boden Russell wrote:
>>Looking for some feedback from the glance dev team on a potential BP…
>>The use case I’m trying to solve is —>
>>"As an admin, I want my glance image bits replicated to multiple store
>>locations (of the same store type) during a glance create operation."
>>For example, I have 3 HTTP based backend locations I want to store my
>>glance image bits on. When I create / upload a new glance image, I want
>>those bits put onto all 3 HTTP based locations and have the image's
>>'locations' metadata properly reflect all stored locations.
>>There are obviously multiple approaches to getting this done.
>>[1] Allow per glance store drivers the ability to manage config and
>>"connectivity" to multiple backends. For example in the glance-api.conf:
>>store_backends = http1,http2,http3
>># http 1 backend props
>># http 2 backend props
>># http 2 backend props
>>And then in the HTTP store driver use a configuration approach like
>>cinder multi-backend does (e.g.:
>>Here, the store driver handles all the logic w/r/t pushing the image
>>bits to all backends, etc..
>The problem with this solution is that the HTTP Glance storage backend 
>is readonly. You cannot upload an image to Glance using the http 
>>[2] A separate (3rd party) "process" which handles the image replication
>>and location metadata updates... For example listens for the glance
>>notification on create and then takes the steps necessary to replicate
>>the bits elsewhere and update the image metadata (locations).
>This is the solution that I would recommend. Frankly, this kind of 
>replication should be an async out-of-band process similar to 
>bittorrent. Just have bittorrent or rsync or whatever replicate the 
>image bits to a set of target locations and then call the 
>glanceclient.v2.client.images.add_location() method:
>to add the URI of the replicated image bits.

It recently landed in Glance an async workers engine (?) that allows
for this kind of things to exists. For instance, it'll be used for
image introspection to extract information from images after they have
been *imported* into glance.

The right hooks that trigger this async workers maybe need to be
defined better but the infrastructure is there. Once that's more
solid, you'll be able to write your own plugin that will do that job
on every glance image import.

That said, I'd suggest you to follow Jay's advice for now.


>>[3] etc...
>>In a prototype I implemented #1 which can be done with no impact outside
>>of the store driver code itself.
>I'm not entirely sure how you did that considering the http storage 
>backend is readonly. Are you saying you implemented the add() method 
>for the glance_store._drivers.http.Store class?
>> I prefer #1 over #2 given approach #2
>>may need pull the image bits back down from the initial location in
>>order to push for replication; additional processing.
>>Is the dev team adverse to option #1 for the store driver's who wish to
>>implement it and / or what are the other (preferred) options here?
>>Thank you,
>>- boden
>>OpenStack Development Mailing List (not for usage questions)
>>Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
>OpenStack Development Mailing List (not for usage questions)
>Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe

Flavio Percoco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150114/a10d9056/attachment.pgp>

More information about the OpenStack-dev mailing list