Notes on using OpenStack with Juju

Dražen Lučanin drazen.lucanin at gmail.com
Tue Dec 4 15:01:45 UTC 2012


On Tue, Dec 4, 2012 at 3:45 PM, Thomas Leonard
<tal at it-innovation.soton.ac.uk> wrote:
>
> On 2012-11-23 16:38, Thomas Leonard wrote:
>>
>> Hi,
>>
>> We decided to set up an OpenStack system on a hosted machine to run Juju
>> services. I'm new to OpenStack and found it fairly difficult/confusing. I'm
>> sending a (slightly sanitised) version of the notes I made during the
>> process in case it's useful for others or inspires someone to make it easier
>> in future...
>
> [...]
>>
>> Swift
>
> [...]
>
>> The provider must be "openstack_s3", not "openstack". Otherwise, it fails to download the metadata
>> (Authentication failure).
>
>
> I'd like to find out what's causing this. Could someone explain how it's supposed to work?
>
> Currently, "juju bootstrap" with the plain "openstack" provider does
>
> cloud_init.set_instance_id_accessor("$(%s %s)" % (
>                 curl, filestorage.get_url(id_name),))
>
> which creates a command of the form:
>
> curl -k https://myhost:8443/v1/AUTH_7ed23fe65dd24434838cef60cff37c75/juju-tal/juju_master_id
>
> This command doesn't work however:
>
> $ curl -k https://myhost:8443/v1/AUTH_7ed23fe65dd24434838cef60cff37c75/juju-tal/juju_master_id
> <html>
>
>  <head>
>   <title>401 Unauthorized</title>
>  </head>
>  <body>
>   <h1>401 Unauthorized</h1>
>   This server could not verify that you are authorized to access the document you requested. Either you supplied the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.<br /><br />
> Authentication required
>
> The 7ed23f... bit is simply the (public) project ID, not any kind of access token. So how is Swift supposed to authorise the request?
>
> Thanks,
>
>
>
> --
> Dr Thomas Leonard
> IT Innovation Centre
> Gamma House, Enterprise Road,
> Southampton SO16 7NS, UK
>
>
> tel: +44 23 8059 8866
>
> mailto:tal at it-innovation.soton.ac.uk
> http://www.it-innovation.soton.ac.uk/
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju

Hi Thomas,

you can take a look at the API docs quickstart here:

http://docs.openstack.org/api/quick-start/content/

>From what I understand, you first have to request a token by posting a
username&password

    curl -k -X 'POST' -v
https://nova-api.trystack.org:5443/v2.0/tokens -d
'{"auth":{"passwordCredentials":{"username": "joecool",
"password":"coolword"}, "tenantId":"5"}}' -H 'Content-type:
application/json'

and you use the token from the response in the following commands
until it expires (which gives you a 401).

    curl -k -D - -H "X-Auth-Token:
7d2f63fd-4dcc-4752-8e9b-1d08f989cc00" -X 'GET' -v
https://nova-api.trystack.org:9774/v1.1/296/extensions  -H
'Content-type: application/json'

(the example is for nova, but I think the same drill applies to swift)

Cheers,
Dražen



More information about the Juju mailing list