Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

support setting default data center as conf option #81

Open
bodenr opened this issue Mar 31, 2014 · 6 comments
Open

support setting default data center as conf option #81

bodenr opened this issue Mar 31, 2014 · 6 comments

Comments

@bodenr
Copy link
Contributor

bodenr commented Mar 31, 2014

Jumpgate's current implementation from a compute server create perspective determines the SL DC to use by pulling the availability_zone value out of the body of a server create request. If this property is not set it appears a default of None is passed down to the SL py client and from there the San Jose DC is used by default.

Although I believe the best approach is to pull a dynamic value from a request (albeit a SL DC is really a region in my mind), it would be useful to allow the Jumgpate admin to specify a default DC to use if none is specified in server create request bodies.

For example in the jumpgate.conf we might have something like:

[compute]
driver=jumpgate.compute.drivers.sl
default_availability_zone=wdc01

which indicates to use the Washing DC data center is none is specified in server create request body.

@beittenc
Copy link
Contributor

If no availability zone is specified, the API defaults to "first available". Currently that's set to sjc01 for most folks, but that could change in the future as new zones come online or sjc01 reaches capacity. My concern with setting a default in the jumpgate.conf like that is that there's no guarantee the specified data center is going to be available in the future. The "first available" will always correspond to an available data center since it's controlled by SoftLayer.

@bodenr
Copy link
Contributor Author

bodenr commented Mar 31, 2014

@beittenc valid argument... however I can still see scenarios where providers want to default the DC at the jumpgate layer for whatever reason and I'm not seeing why we'd want to prevent them from doing assuming backwards compatibility with 'first avail' (i.e. in the proposed approach here the default_availability_zone just not specified)... If the DC is not avail in the future I would assert it's up to the jumpgate admin to update the conf accordingly... It would be interesting to see whole DCs just go away without significant warning / preparation.

@sudorandom
Copy link
Contributor

I'll +1 this. This seems like a pretty harmless feature.

@Neetuj
Copy link
Member

Neetuj commented Jun 13, 2014

am working on it

@bodenr
Copy link
Contributor Author

bodenr commented Jul 7, 2014

@sudorandom @Neetuj -- looking at the code for this one in servers.py (https://github.com/softlayer/jumpgate/blob/master/jumpgate/compute/drivers/sl/servers.py#L213) which currently looks like this:

        datacenter = (utils.lookup(body, 'server', 'availability_zone')
                      or config.CONF['compute']['default_availability_zone'])
        if not datacenter:
            return error_handling.bad_request(resp,
                                              'availability_zone missing')

        cci = SoftLayer.CCIManager(client)

based on the chat above with @beittenc the intention was still to allow backwards compatibility for not specifying a default AZ and thus not passing one down to the SL python client.. The result of such would be the "1st avail DC".. See discussion in this item above.

However the current code throws a bad request error if no AZ is in the body and no AZ is in the conf... This is not backwards compatible.

This seems like a bug to me, or am I missing something?

@sudorandom
Copy link
Contributor

@bodenr this is a result of a stealth change that made the first available datacenter option is not available and an explicit datacenter choice required on the SoftLayer API side.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants