About remote access openstack nova using jclouds

266 views
Skip to first unread message

Yong Tang

unread,
Jan 23, 2013, 10:15:26 PM1/23/13
to jcl...@googlegroups.com
Hi Adrian

Yesterday, I tried Quick Start Sample for openstack[1],
[1]: http://www.jclouds.org/documentation/quickstart/openstack/

And, my client and openstack are not the same machine.

If I put sample into the machine of my openstack, then anything is ok.

However, if I put sample into my client, then, while executing the
sample, firstly, an exception happened as following:

...
Connection refused: connect connecting to GET
http://localhost:8774/v1.1/e3cbe760ea2a413a900a749c9cf42b6b/servers/detail
HTTP/1.1
...

Then, I modified the sample and added the following,

Properties overrides = new Properties();
overrides.setProperty(Constants.PROPERTY_ENDPOINT,
"http://10.167.133.44:8774/v1.1/");

ComputeServiceContext context =
ContextBuilder.newBuilder(provider).overrides(overrides)
	            .endpoint("http://10.167.133.44:5000/v2.0/")
...

While executing the sample again, although the previous exception did
not happen, another exception happened,

...
com.google.common.util.concurrent.UncheckedExecutionException:
org.jclouds.http.HttpResponseException: Server rejected operation
connecting to POST http://10.167.133.44:8774/v1.1/tokens HTTP/1.1
        at
com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2258)
        at com.google.common.cache.LocalCache.get(LocalCache.java:3990)
        at
com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3994)
        at
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4878)
        at
org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:206)
        at
org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule$2.get(KeystoneAuthenticationModule.java:202)
...

So, I want to ask whether I need to use SSH way not simply using
user/pwd to access openstack or not? And if yes, could you please give
me some advice how to modify the sample?

Thanks
--Tang

Everett Toews

unread,
Jan 24, 2013, 10:21:47 AM1/24/13
to jcl...@googlegroups.com
Hi Yong,

I think all you should need to do is completely remove those overrides. You really only need to change the endpoint of the ContextBuilder in this scenario.

      ComputeServiceContext context = ContextBuilder.newBuilder(provider)
            .endpoint("http://10.167.133.44:5000/v2.0/")
            .credentials(identity, password)
            .modules(modules)
            .buildView(ComputeServiceContext.class);

HTH,
Everett


--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jclouds/-/YrRmEtH06fIJ.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Yong Tang

unread,
Jan 25, 2013, 12:36:28 AM1/25/13
to jcl...@googlegroups.com
Hi Everett,

Thanks your reply very much!
I have resolved the issue. You are right  and in my openstack env, there is a problem of endpoint which url uses "localhost:xxxx", so, once from my client to access openstack, the result will be failed.

Thanks again!
--Tang

2013/1/25 Everett Toews <everet...@rackspace.com>

Yong Tang

unread,
Jan 25, 2013, 1:23:11 AM1/25/13
to jcl...@googlegroups.com
Deeply, in this secne(remote client access), if using default_catalog.templates, you must change endpoints's url from localhost into real ip(eg. in my env, it is 10.167.133.44) in /etc/keystone/default_catalog.templates. Otherwize, jclouds sample can not work normally.

Thanks
--Tang

2013/1/25 Yong Tang <www.tan...@gmail.com>
Reply all
Reply to author
Forward
0 new messages