incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Lutterkort <lut...@redhat.com>
Subject Re: [PATCH core] Allow setting the provider on the server side, and implement region overriding in the ec2 driver based off of the provider (rev 2).
Date Thu, 16 Dec 2010 00:44:06 GMT
On Tue, 2010-12-14 at 23:06 -0500, Toby Crawley wrote:
> On 12/14/2010 08:00 PM, David Lutterkort wrote:
> > On Fri, 2010-12-10 at 08:06 -0500, tcrawley@redhat.com wrote:
> >> From: Tobias Crawley<tcrawley@redhat.com>
> >>
> >> The provider can now be set on the commandline to deltacloudd via -P/--provider
> >> (putting it in ENV['API_PROVIDER']), and also from the client via a header
> >> (putting it in Thread.current[:provider]).
> >>
> >> The ec2 driver is currently the only driver that understands providers, and
> >> looks in Thread.current[:provider], then ENV['API_PROVIDER'], then falls back
> >> to a default (currently 'us-east-1', the AWS default).
> >
> > Sorry for being late to the party; the word 'provider' seems very
> > unclear to me. In addition, the driver does some scary URL surgery that
> > seems less than robust to me.
> >
> > I'd prefer if we rename this mechanism into 'endpoint' (and
> > ENV['API_ENDPOINT']) with the expectation that the entire URL that we
> > should talk to is passed in. With that, it also becomes possible to use
> > the EC2 driver against a private Eucalyptus instance.
> 
> I'm not attached to 'provider', and would be fine calling it 'endpoint'.

The main thing I wanted to convey with the name change is that the value
of the parameter is the URL for the backend cloud - I don't think that
using a keyword will work for other backends (like RAX and OpenStack)

But you are right - AWS has made quite a mess of this, and for AWS we
will need to use a keyword rather than an actual URL, and map that
keyword to the actual endpoint URL for EC2, S3 and ELB.

So, for naming: the name should remain API_PROVIDER; we'll have to
document the right values for it for each driver separately.

> If we do keep the endpoint as simply the region name (or allow it to be a url or region
name), then maybe this would be better implemented 
> as a simple lookup table:
> 
> EC2_ENDPOINTS = {
>    :ec2 => {
>      'us-east-1' => 'ec2.us-east-1.amazonaws.com',
>      ...
>    },
>    :s3 => {
>      'us-east-1' => 's3.amazonaws.com',
>      'eu-west-1' => 's3.amazonaws.com',
>      'ap-southeast-1' => 's3-ap-southeast-1.amazonaws.com',
>      ...
>    },
>    ...
> }

That seems to me the best solution - with a proper error message when
nonsense is passed in for API_PROVIDER (like API_PROVIDER=eu-east-1)

For S3, there's a few gotchas: (1) there's no us-east-1; we should just
map the US Standard zone to us-east-1 (2) the request to S3 must set the
location constraint corresponding to the endpoint.

David



Mime
View raw message