Running createNodesInGroup asynchronously

99 views
Skip to first unread message

eyal

unread,
Apr 11, 2013, 12:04:25 PM4/11/13
to jcl...@googlegroups.com
I'm trying to find a way to start the nodes creation and immediately get some information (ip address etc) on the nodes that will be created.
Thereafter I'll start polling the provider to get the status of each node.
I'm currently using EC2 and I need a behaviour similar to the EC2 API runInstances

Any help will be appreciated
 -Eyal

Andrew Phillips

unread,
Apr 13, 2013, 12:48:58 PM4/13/13
to jcl...@googlegroups.com
Hi Eyal

I think InstanceClient.runInstancesInRegion [1] is what you might be
looking for ;-) Have a look at createlamp [2] for an example of how to
get at the provider-specific EC2 client you need for this.

Hope this helps!

ap

[1]
http://javadocs.jclouds.cloudbees.net/org/jclouds/ec2/services/InstanceClient.html#runInstancesInRegion(java.lang.String, java.lang.String, java.lang.String, int, int,
org.jclouds.ec2.options.RunInstancesOptions...)
[2]
https://github.com/jclouds/jclouds-examples/blob/master/ec2-createlamp/src/main/java/org/jclouds/examples/ec2/createlamp/MainApp.java#L76

eyal

unread,
Apr 14, 2013, 3:23:46 AM4/14/13
to jcl...@googlegroups.com, aphi...@qrmedia.com
Hi Andrew,
Thanks for your reply
Isn't there a generic jclouds API?
The reason I ask this is that I need this part of code to be generic and provider independent.


בתאריך יום שבת, 13 באפריל 2013 19:48:58 UTC+3, מאת Andrew Phillips:

Andrew Phillips

unread,
Apr 15, 2013, 11:23:29 AM4/15/13
to jcl...@googlegroups.com
> Thanks for your reply
> Isn't there a generic jclouds API?

There is - ComputeService [1] - but this does not provide a method
that returns as soon as the "create images" *request* has been made,
which seems to be what you're looking for.

I don't know the exact details of *why* such a generic call is not
provided, but would guess that it may not be sufficiently portable
across multiple providers. Hopefully someone on the list can provide
more details.

Regards

ap

[1]
https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/ComputeService.java

eyal

unread,
May 13, 2013, 6:57:04 AM5/13/13
to jcl...@googlegroups.com, aphi...@qrmedia.com
 Hello again
I have found that TemplateOptions.blockUntilRunning makes the ComputeService asynchronic (when using createNodesInGroup).
It works as expected with EC2 provider but when using HP Cloud I see that the createNodesInGroup is blocked regardless of the value of blockUntilRunning.
Is this a correct behaviour of the ComputeService API? 


בתאריך יום שני, 15 באפריל 2013 18:23:29 UTC+3, מאת Andrew Phillips:

Andrew Phillips

unread,
May 13, 2013, 1:15:03 PM5/13/13
to jcl...@googlegroups.com
Hi eyal

> I have found that *TemplateOptions.blockUntilRunning *makes
> the ComputeService asynchronic (when using createNodesInGroup).
> It works as expected with EC2 provider but when using HP Cloud I see that
> the createNodesInGroup is blocked regardless of the value of
> blockUntilRunning.
> Is this a correct behaviour of the ComputeService API?

Would you mind subscribing the new Apache jclouds user group and
resubmitting the question?

See
https://groups.google.com/forum/?fromgroups=#!topic/jclouds/vZctAP6kQ2A for
details.

Thanks!

ap

eyal

unread,
May 23, 2013, 2:26:33 AM5/23/13
to jcl...@googlegroups.com, aphi...@qrmedia.com
Sorry, I can't find where/how to submit my question
:/



בתאריך יום שני, 13 במאי 2013 20:15:03 UTC+3, מאת Andrew Phillips:
Reply all
Reply to author
Forward
0 new messages