Issue using jclouds openstack-nova provider

236 views
Skip to first unread message

Charles Moulliard

unread,
Feb 4, 2013, 1:31:28 PM2/4/13
to jcl...@googlegroups.com
Hi,

I'm currently facing the following issue using Openstack (installed using this vagrant - devstack procedure : https://gist.github.com/2144122 ) and openstack-nova provider of jclouds.

The following commands (glance) works fine :

vagrant@ubuntu-oneiric:/vagrant$ export OS_USERNAME=admin
vagrant@ubuntu-oneiric:/vagrant$ export OS_PASSWORD=b5559b6469a85179b655
vagrant@ubuntu-oneiric:/vagrant$ export OS_TENANT_ID=f690c88921ba43e7835bd9c5a79a0dad
vagrant@ubuntu-oneiric:/vagrant$ export OS_TENANT_NAME=admin
vagrant@ubuntu-oneiric:/vagrant$ export OS_AUTH_URL=http://localhost:5000/v2.0
vagrant@ubuntu-oneiric:/vagrant$ glance image-list
+--------------------------------------+---------------------------------+-------------+------------------+-----------+--------+
| ID                                   | Name                            | Disk Format | Container Format | Size      | Status |
+--------------------------------------+---------------------------------+-------------+------------------+-----------+--------+
| e4a9d520-d72e-41dd-9a3a-25ddbd69fb92 | cirros-0.3.0-x86_64-uec         | ami         | ami              | 25165824  | active |
| 9f2a5eac-7aa2-40ed-bc68-b0a9c8432544 | cirros-0.3.0-x86_64-uec-kernel  | aki         | aki              | 4731440   | active |
| fac01eb5-7756-4dd0-af4f-1f1f9c66136e | cirros-0.3.0-x86_64-uec-ramdisk | ari         | ari              | 2254249   | active |
| b58b503c-2d24-4a79-9428-93caf5b1c559 | Ubuntu 12.04 cloudimg amd64     | qcow2       | ovf              | 250019840 | active |
+--------------------------------------+---------------------------------+-------------+------------------+-----------+--------+

But when I run it in jclouds-karaf client (1.5.3 or 1.6.0-SNAPSHOT), I get this error :

jclouds> jclouds:image-list --provider openstack-nova --identity f690c88921ba43e7835bd9c5a79a0dad:admin --credential b5559b6469a85179b655 --endpoint http://localhost:5000/v2


What is the issue ?

Regards,

Charles

Paul C. Bryan

unread,
Feb 4, 2013, 1:51:01 PM2/4/13
to jcl...@googlegroups.com
Your endpoint on the second call seems to be different than the one in OS_AUTH_URL...

Paul

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jclouds+u...@googlegroups.com.
To post to this group, send email to jcl...@googlegroups.com.
Visit this group at http://groups.google.com/group/jclouds?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Charles Moulliard

unread,
Feb 4, 2013, 2:12:38 PM2/4/13
to jcl...@googlegroups.com
Good remark ;-)

Nevertheless, I get authorization error

jclouds> jclouds:image-list --provider openstack-nova --identity f690c88921ba43e7835bd9c5a79a0dad:admin --credential b5559b6469a85179b655 --endpoint http://localhost:5000/v2.0
Authorization error: POST http://localhost:5000/v2.0/tokens HTTP/1.1 -> HTTP/1.1 401 Not Authorized
jclouds> ld
2013-02-04 19:11:12,834 | DEBUG | l Console Thread | wire                             | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> "{"auth":{"passwordCredentials":{"username":"admin","password":"b5559b6469a85179b655"},"tenantName":"f690c88921ba43e7835bd9c5a79a0dad"}}"
2013-02-04 19:11:12,834 | DEBUG | l Console Thread | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> POST http://localhost:5000/v2.0/tokens HTTP/1.1
2013-02-04 19:11:12,834 | DEBUG | l Console Thread | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> Accept: application/json
2013-02-04 19:11:12,834 | DEBUG | l Console Thread | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> Content-Type: application/json
2013-02-04 19:11:12,834 | DEBUG | l Console Thread | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> Content-Length: 135
2013-02-04 19:11:12,842 | DEBUG | l Console Thread | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << HTTP/1.1 401 Not Authorized
2013-02-04 19:11:12,842 | DEBUG | l Console Thread | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << Vary: X-Auth-Token
2013-02-04 19:11:12,842 | DEBUG | l Console Thread | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << Date: Mon, 04 Feb 2013 19:11:12 GMT
2013-02-04 19:11:12,842 | DEBUG | l Console Thread | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << Transfer-Encoding: chunked
2013-02-04 19:11:12,842 | DEBUG | l Console Thread | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << Connection: keep-alive

Ioannis Canellos

unread,
Feb 4, 2013, 2:22:04 PM2/4/13
to jcl...@googlegroups.com
Hi Charles,

I notice that the url is http://localhost:5000/v2.0 but you are passing to the command http://localhost:5000/v2 .
Also in the logs it appears that you are trying to access the last instead of the first.

Cheers!
--
Ioannis Canellos

Twitter: iocanel

Charles Moulliard

unread,
Feb 4, 2013, 2:23:57 PM2/4/13
to jcl...@googlegroups.com
Corrected Ioannis but I get now : Authorization error: POST http://localhost:5000/v2.0/tokens HTTP/1.1 -> HTTP/1.1 401 Not Authorized

Charles Moulliard

unread,
Feb 4, 2013, 2:25:11 PM2/4/13
to jcl...@googlegroups.com
Here is the stack trace :

2013-02-04 19:22:11,659 | DEBUG | pool-3-thread-1  | wire                             | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> "{"auth":{"passwordCredentials":{"username":"demo","password":"b5559b6469a85179b655"},"tenantName":"f690c88921ba43e7835bd9c5a79a0dad"}}"
2013-02-04 19:22:11,659 | DEBUG | pool-3-thread-1  | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> POST http://localhost:5000/v2.0/tokens HTTP/1.1
2013-02-04 19:22:11,659 | DEBUG | pool-3-thread-1  | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> Accept: application/json
2013-02-04 19:22:11,660 | DEBUG | pool-3-thread-1  | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> Content-Type: application/json
2013-02-04 19:22:11,660 | DEBUG | pool-3-thread-1  | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | >> Content-Length: 134
2013-02-04 19:22:11,678 | DEBUG | pool-3-thread-1  | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << HTTP/1.1 401 Not Authorized
2013-02-04 19:22:11,678 | DEBUG | pool-3-thread-1  | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << Vary: X-Auth-Token
2013-02-04 19:22:11,678 | DEBUG | pool-3-thread-1  | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << Date: Mon, 04 Feb 2013 19:22:11 GMT
2013-02-04 19:22:11,678 | DEBUG | pool-3-thread-1  | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << Transfer-Encoding: chunked
2013-02-04 19:22:11,678 | DEBUG | pool-3-thread-1  | headers                          | 33 - jclouds-log4j - 1.6.0.SNAPSHOT | << Connection: keep-alive
2013-02-04 19:22:11,679 | WARN  | pool-3-thread-1  | UpdateCachesTask                 | 46 - org.jclouds.karaf.cache - 1.6.0.SNAPSHOT | Error while updating cache:POST http://localhost:5000/v2.0/tokens HTTP/1.1 -> HTTP/1.1 401 Not Authorized
2013-02-04 19:22:11,679 | WARN  | pool-3-thread-1  | UpdateCachesTask
2013-02-04 19:22:11,679 | WARN  | pool-3-thread-1  | UpdateCachesTask                 | 46 - org.jclouds.karaf.cache - 1.6.0.SNAPSHOT | Error while updating cache:POST http://localhost:5000/v2.0/tokens HTTP/1.1 -> HTTP/1.1 401 Not Authorized
2013-02-04 19:22:11,679 | WARN  | pool-3-thread-1  | UpdateCachesTask  
2013-02-04 19:22:11,679 | WARN  | pool-3-thread-1  | UpdateCachesTask                 | 46 - org.jclouds.karaf.cache - 1.6.0.SNAPSHOT | Error while updating cache:POST http://localhost:5000/v2.0/tokens HTTP/1.1 -> HTTP/1.1 401 Not Authorized
2013-02-04 19:22:11,679 | WARN  | pool-3-thread-1  | UpdateCachesTask  

Ioannis Canellos

unread,
Feb 4, 2013, 2:28:35 PM2/4/13
to jcl...@googlegroups.com
I am not sure if that helps, but I also used to specify the tenant id, using something like:

jclouds:image-list --provider openstack-nova --identity f690c88921ba43e7835bd9c5a79a0dad:admin --credential b5559b6469a85179b655 --endpoint http://localhost:5000/v2.0 --add-option jclouds.keystone.tenant-id=f690c88921ba43e7835bd9c5a79a0dad 

Charles Moulliard

unread,
Feb 4, 2013, 5:51:50 PM2/4/13
to jcl...@googlegroups.com
Great. That works better with option that you proposes :

 jclouds:compute-service-create --api openstack-nova --endpoint http://localhost:5000/v2.0/ --identity 366bf994c7ff4082a5f422f0f69357e6:admin --credential b5559b6469a85179b655  --add-option jclouds.keystone.tenant-id=f690c88921ba43e7835bd9c5a79a0dad


--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jclouds+u...@googlegroups.com.
To post to this group, send email to jcl...@googlegroups.com.
Visit this group at http://groups.google.com/group/jclouds?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Charles Moulliard

unread,
Feb 4, 2013, 6:24:30 PM2/4/13
to jcl...@googlegroups.com
Anyway. There is still an issue as I must always add the identity/credential for any command used :

2013-02-04 23:17:55,524 | WARN  | pool-14-thread-1 | UpdateCachesTask                 | ?                                   ? | 272 - org.jclouds.karaf.cache - 1.5.3.1 | Error while updating cache:POST http://localhost:5000/v2.0/tokens HTTP/1.1 -> HTTP/1.1 401 Not Authorized

2013-02-04 23:21:59,498 | INFO  | l Console Thread | FabricServiceImpl                | ?                                   ? | 56 - org.fusesource.fabric.fabric-core - 7.1.0.fuse-047 | The creation of the container null has failed
java.lang.IllegalArgumentException: Cannot create compute service. A registered cloud provider or the provider name, identity and credential options are required
at org.fusesource.fabric.service.jclouds.JcloudsContainerProvider.getOrCreateComputeService(JcloudsContainerProvider.java:407)
at org.fusesource.fabric.service.jclouds.JcloudsContainerProvider.create(JcloudsContainerProvider.java:120)
at org.fusesource.fabric.service.jclouds.JcloudsContainerProvider.create(JcloudsContainerProvider.java:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_24]

Is it related to the WARNING message ?

On Monday, February 4, 2013 11:51:50 PM UTC+1, Charles Moulliard wrote:
Great. That works better with option that you proposes :

 jclouds:compute-service-create --api openstack-nova --endpoint http://localhost:5000/v2.0/ --identity 366bf994c7ff4082a5f422f0f69357e6:admin --credential b5559b6469a85179b655  --add-option jclouds.keystone.tenant-id=f690c88921ba43e7835bd9c5a79a0dad
On Mon, Feb 4, 2013 at 8:28 PM, Ioannis Canellos <ioc...@gmail.com> wrote:
I am not sure if that helps, but I also used to specify the tenant id, using something like:

jclouds:image-list --provider openstack-nova --identity f690c88921ba43e7835bd9c5a79a0dad:admin --credential b5559b6469a85179b655 --endpoint http://localhost:5000/v2.0 --add-option jclouds.keystone.tenant-id=f690c88921ba43e7835bd9c5a79a0dad 


--
Ioannis Canellos

Twitter: iocanel

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jclouds+unsubscribe@googlegroups.com.

To post to this group, send email to jcl...@googlegroups.com.
Visit this group at http://groups.google.com/group/jclouds?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Paul C. Bryan

unread,
Feb 4, 2013, 7:11:24 PM2/4/13
to jcl...@googlegroups.com
Ah, I remember Nova needing for the credential to be a combination of tenant:username.

Paul
To unsubscribe from this group and stop receiving emails from it, send an email to jclouds+u...@googlegroups.com.

Ioannis Canellos

unread,
Feb 5, 2013, 6:38:39 AM2/5/13
to jcl...@googlegroups.com
On Tue, Feb 5, 2013 at 1:24 AM, Charles Moulliard <ch0...@gmail.com> wrote:
Anyway. There is still an issue as I must always add the identity/credential for any command used :

Since you are using jclouds-karaf or jclouds-cli in interactive mode, you can create the service once with all the options and then just use the commands without the need to copy all these options all over.
For example you can use:

jclouds:compute-service-create --api openstack-nova --endpoint http://172.16.0.1:5000/v2.0/ --identity 3fbc2a61572e4c69b80f88896a277df6:admin --credential openstack --add-option jclouds.trust-all-certs=true --add-option jclouds.keystone.credential-type=passwordCredentials --add-option jclouds.keystone.tenant-id=3fbc2a61572e4c69b80f88896a277df6 --add-option jclouds.openstack-nova.auto-allocate-floating-ips=true --add-option jclouds.openstack-nova.auto-generate-keypairs=true 

And then just go with:

jclouds:image-list
jclouds:location-list
jclouds:node-create --imageId myimage mygroup

and so on.

If for any reason you have created a service for more than one provider or api, you can choose which one you want to use for each command with something like:

//For an api say openstack-nove:
jclouds:image-list --api openstack-nova
jclouds:location-list --api openstack-nova
jclouds:node-create --api openstack-nova --imageId myimage mygroup

//For a provider say aws-ec2
jclouds:image-list --provider aws-ec2
jclouds:location-list --provider aws-ec2
jclouds:node-create --provider aws-ec2 --imageId myimage mygroup

Now if you have installed multiple service for each provider or api, you can add names to them and later choose by name. For example

jclouds:compute-service-create --name openstack1 <tons of options here>
jclouds:compute-service-create --name openstack2 <tons of options here>

and then select them by:

jclouds:node-list --name openstack1 

the same also applies to providers.
Reply all
Reply to author
Forward
0 new messages