incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toby Crawley <tcraw...@redhat.com>
Subject Re: Dynamic selection of driver
Date Fri, 12 Nov 2010 14:51:48 GMT
On 11/11/2010 08:21 PM, David Lutterkort wrote:
> Hi,
>
> Toby Crawley is really the one who brought this up - here's a summary of
> a discussion we had a couple days ago.
>
> Right now, the deltacloud server only ever uses one driver; that means
> that if you want to talk to multiple clouds, you need to have one
> deltacloud server running for each of them. Clearly, not very admin
> friendly.
>
> Toby actually experimented with this (wanna share your patch, Toby ?).
> To me, the cleanest way to enable dynamic selection of the driver is to
> select the driver through add'l HTTP headers. For example, by sending
>
>          X-Deltacloud-Driver: ec2
>          X-Deltacloud-Endpoint: https://eu-west-1.ec2.amazonaws.com/
>
> you'd be using the eu-west region of EC2.
>
> We would maintain the current behavior of the driver as the default when
> these headers are absent; so if you start 'deltacloudd -i mock', clients
> that don't set the Deltacloud headers will talk to the mock driver.
>
> David

The 'patch' I have is really just a hack - it monkey patches client/deltacloud to send the
ec2 endpoint as a header, and provides an 
alternate rackup file for the server that inserts rack middleware to turn headers in to ENV
vars. I had not yet added changes to override 
the driver, but that would be fairly straightforward. I took this approach to see if it could
be done without altering the -client and -core 
gems. The code is at https://gist.github.com/664838. If we bake this functionality in to the
client, it should probably baked in to the 
server as well, instead of using the middleware approach.

Toby

Mime
View raw message