jclouds on openstack

39 views
Skip to first unread message

Christos Tranoris

unread,
Mar 19, 2012, 9:40:24 AM3/19/12
to jcl...@googlegroups.com
Hi all

I have the following exception using jclouds 1.4.0-rc.3 against an openstack Diablo based private cloud:
>> initialized provider {provider=nova, endpoint=memoizeWithExpiration(ExpiringMemoizingSupplier{delegate=RetryOnTimeOutExceptionSupplier(RetryOnTimeOutButNotOnAuthorizationExceptionSupplier(org.jclouds.location.suppliers.fromconfig.ProviderURIFromConfiguration@111bfbc)), durationNanos=60000000000}, seconds=60), apiVersion=1.1, buildVersion=, identity=novaadmin, iso3166Codes=[]}
Exception in thread "user thread 1" java.lang.IllegalStateException: interrupted calling get() on [[method=NovaAsyncClient.listImages, request=GET http://xxxxxxxxxxxxxxxxxxxxxx/v1.1/novaadmin/images?format=json&offset=200&limit=100 HTTP/1.1]], so could not run listeners
    at org.jclouds.concurrent.Futures$CallGetAndRunExecutionList.run(Futures.java:66)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(Unknown Source)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at org.jclouds.concurrent.config.ExecutorServiceModule$DescribedFuture.get(ExecutorServiceModule.java:239)
    at org.jclouds.concurrent.Futures$CallGetAndRunExecutionList.run(Futures.java:59)
    ... 3 more
Caused by: java.util.concurrent.ExecutionException: task submitted from the following trace
    at org.jclouds.concurrent.config.ExecutorServiceModule$DescribedFuture.ensureCauseHasSubmissionTrace(ExecutorServiceModule.java:272)
    at org.jclouds.concurrent.config.ExecutorServiceModule$DescribedFuture.get(ExecutorServiceModule.java:243)
    ... 4 more
Exception in thread "user thread 0" java.lang.IllegalStateException: interrupted calling get() on [[method=NovaAsyncClient.listServers, request=GET http://xxxxxxxxxxxxxxx/v1.1/novaadmin/servers?format=json HTTP/1.1]], so could not run listeners
    at org.jclouds.concurrent.Futures$CallGetAndRunExecutionList.run(Futures.java:66)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InterruptedException
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(Unknown Source)
    at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
    at java.util.concurrent.FutureTask.get(Unknown Source)
    at org.jclouds.concurrent.config.ExecutorServiceModule$DescribedFuture.get(ExecutorServiceModule.java:239)
    at org.jclouds.concurrent.Futures$CallGetAndRunExecutionList.run(Futures.java:59)
    ... 3 more
Caused by: java.util.concurrent.ExecutionException: task submitted from the following trace
    at org.jclouds.concurrent.config.ExecutorServiceModule$DescribedFuture.ensureCauseHasSubmissionTrace(ExecutorServiceModule.java:272)
    at org.jclouds.concurrent.config.ExecutorServiceModule$DescribedFuture.get(ExecutorServiceModule.java:243)
    ... 4 more


The code follows:

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



        String user = "novaadm";
        String apiKey = "df9332c5-f247-40e1-a24b-b04344234f15" ;
       
        ComputeServiceContext context = new ComputeServiceContextFactory().createContext("nova", user, apiKey,
                ImmutableSet.<Module> of( /*new Log4JLoggingModule() /*new JschSshClientModule() */),
                     overrides);

         System.out.printf(">> initialized provider %s%n", context.getProviderSpecificContext());


        // when you need access to nova-specific features, use the provider-specific context
        NovaClient novaClient = NovaClient.class.cast(context.getProviderSpecificContext().getApi());

            Set<Server> servers = novaClient.listServers(withDetails());
            for (Iterator<Server> iterator = servers.iterator(); iterator.hasNext();) {
                Server s = (Server) iterator.next();
                System.out.printf(">> Node: %s, %s, %s, %s, %s, %s, %s, %s, %s, %s",
                        s.getId(), // how does jclouds address this in a global scope
                        s.getAccessIPv4() , // how does the provider api address this in a specific scope
                        s.getName(), // if the node is named, what is it?
                        s.getAddresses(),
                        s.getAdminPass(),
                        s.getFlavor(),
                        s.getHostId(),
                        s.getKeyName(),
                        s.getURI(),
                        s.getUuid()// where in the world is the node
                            );
               
            }

//        // list the id and name of my servers that were modified since yesterday
        servers = novaClient.listServers();
//
//        // list the id and name of images I have access to, starting at index 200 limited to 100 results.
        Set<Image> images = novaClient.listImages(startAt(200).maxResults(100));



            context.close();



Moreover I could not enable log4j due to missing dependencies to com.google.code.guice:guice:jar:2.1-r1201.
btw, I'm trying to find out what is happening with my maven installation.

I would appreciate any ideas..


thanks
Christos


Adrian Cole

unread,
Mar 19, 2012, 11:38:54 AM3/19/12
to jcl...@googlegroups.com, jclou...@googlegroups.com

Hi, Christos.

Sorry you are having trouble.  In 1.4.0 (this is out, just not announced), you are best using the eucalyptus api to talk to recent versions of nova. 

1.5.0-SNAPSHOT, which will be alpha soon, has a rewritten api: 'openstack-nova' where the endpoint is a keystone v2 url.  You can try this if you like.

Either way, we haven't used guice 2 in a long time.  You will need to remove that jar from your classpath as jclouds uses guice 3.

I hope this helps.
-A

--
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/-/bgdCu4q1wPwJ.
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.
Reply all
Reply to author
Forward
0 new messages