scaleway / juju-scaleway

:cloud: Scaleway driver for Juju
https://www.scaleway.com/docs/deploying-web-applications-using-juju-on-scaleway
Other
26 stars 4 forks source link

Provider API error #8

Open abemedia opened 8 years ago

abemedia commented 8 years ago

Running juju scaleway bootstrap returns the following error:

Provider interaction error: <ProviderAPIError message:Image 'cb7d7bb5-54b8-45f4-bee4-164b2aedc69c' arch is not 'arm'. response:400>
moul commented 8 years ago

@bchatelard, this plugin is probably outdated and does not support multiarch yet, can you give a look and fix it or explain the needed changes ?

bchatelard commented 8 years ago

Yeah, i think you should add a commercial_type param to server creation dict here https://github.com/scaleway/juju-scaleway/blob/5eefae729591a17f88c3d256bd084ba1a73ffd87/juju_scaleway/client.py#L65-L70

There is a mismatch between the image arch and the server arch (which is C1 by default).

Something like this should do the trick:

    def create_server(self, name, image):
        commercial_type = <read from config> or 'VC1'
        params = dict(
            name=name,
            image=image,
            commercial_type=commercial_type,
            organization=self.access_key)

        data = self.request('/servers', method='POST', params=params)
bchatelard commented 8 years ago

Also a rework is needed for the image selection, the current implementation is based on a text matching over the /images endpoint.

We need to expose the wanted arch to the config, and to query the marketplace api based on the location and the arch.

abemedia commented 8 years ago

Does this mean deploying on C2 or VPS will be possible using the --constraints flag? So building the state server on a C2 would be something like the following.

juju scaleway bootstrap --constraints "arch=amd64 mem=8G"
bchatelard commented 8 years ago

Yes, we can implement this using constraints https://jujucharms.com/docs/stable/reference-constraints

sheerun commented 8 years ago

Still an issue. Any plans to fix it?