You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by Ignacio de Córdoba <ic...@skios.es> on 2014/01/04 19:42:04 UTC

Some questions on JCloud...

Hello, as some of you know I'm pretty new to JClouds… let me please ask some questions I haven’t been able to solve with JavaDoc/online docs (I’m using Softlayer provider):

1) How can I specify that I want a new Node to use a specific IP address (in the subnet or address list that I have reserved/rented in the provider) when createNodesInGroup(...)? I can't find it in templateBuilder methods nor TemplateOptions class.

2) In a single node provision the correct way to specify the name for a node
TemplateOptions templateOptions =  nodeNames(new ArrayList<String>(){{add(nodeName);}})
(I don’t see some nodeName() option for a simple node creation)

3) To specify public key I’m using
templateOptions.authorizePublicKey(publicKey);
is there a way to specify the publicKey id or name stored in the provider service?

Thanks for any help/directions.


Ignacio de Córdoba
icordoba@skios.es
Red Skios S.A. - www.skios.es





Re: Some questions on JCloud...

Posted by Andrew Phillips <an...@apache.org>.
> I plan to use JClouds to access Softlayer’s CCI service. I’ve   
> checked SoftLayerTemplateOptions class but found not reference to   
> any of both options needed (specific IP and key pair id).

You're right, they don't seem to be supported via the options (yet -  
would make an excellent pull request candidate, if you're interested  
in contributing [1] ;-)).

You may be able to set the primary ID on the virtual guest [2] object  
when creating a new server via the virtual guest API. But that would  
indeed mean programming directly against the SoftLayer APIs, which  
we're trying to avoid here.

ap

[1] https://wiki.apache.org/jclouds/How%20to%20Contribute
[2]  
http://javadocs.jclouds.cloudbees.net/org/jclouds/softlayer/domain/VirtualGuest.html
[3]  
http://javadocs.jclouds.cloudbees.net/org/jclouds/softlayer/features/VirtualGuestApi.html

Re: Some questions on JCloud...

Posted by Ignacio de Córdoba <ic...@skios.es>.
Thanks Ignasi,
I plan to use JClouds to access Softlayer’s CCI service. I’ve checked SoftLayerTemplateOptions class but found not reference to any of both options needed (specific IP and key pair id). I’ll postpone it for a later stage of my app and will try to get a better overall understanding of JClouds. I’d like to avoid using direct REST API to Softlayer’s service.
Thanks for your help.

Ignacio de Córdoba
icordoba@skios.es
Red Skios S.A. - www.skios.es

On 4 Jan 2014, at 23:43, Ignasi Barrera <ig...@gmail.com> wrote:

> Hi Ignacio,
> 
> As fas as I know there is no direct way to force a concrete IP address
> using the portable TemplateOptions. Configuring a concrete IP address
> is something that not all providers support, and that's why is not
> part of the base TemplateOptions implementation. If you are using a
> concrete provider that supports that, you could use the provider
> specific template options. Something like:
> 
> TemplateOptions options =
> options(foo).as(ProviderSpecificOptions.class).publicIp(something);
> 
> But that would depend on each provider implementation. If there no
> such option, perhaps you could try sending a pull request? [1]. You
> may also want to keep an eye on JCLOUDS-416 [2], as it is tightly
> related to this.
> 
> Regarding the second question, yes, that's the way, although you could
> use a more readable approach by using the Guava Lists/Sets helpers:
> 
> TemplateOptions options = nodeNames(Lists.newArrayList("name1", "name2"));
> 
> Finally, when working with public keys, you depend again on a provider
> specific feature that is not supported in all them, so it is not part
> of the portable TempalteOptions. The EC2TemplateOptions [3] has, for
> example, a method to specify the name of the key pair to use. You
> could again use the provider specific options here.
> 
> 
> HTH!
> 
> Ignasi
> 
> 
> [1] http://wiki.apache.org/jclouds/How%20to%20Contribute
> [2] https://issues.apache.org/jira/browse/JCLOUDS-416
> [3] https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java/org/jclouds/ec2/compute/options/EC2TemplateOptions.java#L266
> 
> On 4 January 2014 19:42, Ignacio de Córdoba <ic...@skios.es> wrote:
>> Hello, as some of you know I'm pretty new to JClouds… let me please ask some
>> questions I haven’t been able to solve with JavaDoc/online docs (I’m using
>> Softlayer provider):
>> 
>> 1) How can I specify that I want a new Node to use a specific IP address (in
>> the subnet or address list that I have reserved/rented in the provider) when
>> createNodesInGroup(...)? I can't find it in templateBuilder methods nor
>> TemplateOptions class.
>> 
>> 2) In a single node provision the correct way to specify the name for a node
>> TemplateOptions templateOptions =  nodeNames(new
>> ArrayList<String>(){{add(nodeName);}})
>> (I don’t see some nodeName() option for a simple node creation)
>> 
>> 3) To specify public key I’m using
>> templateOptions.authorizePublicKey(publicKey);
>> is there a way to specify the publicKey id or name stored in the provider
>> service?
>> 
>> Thanks for any help/directions.
>> 
>> 
>> Ignacio de Córdoba
>> icordoba@skios.es
>> Red Skios S.A. - www.skios.es
>> 
>> 
>> 
>> 


Re: Some questions on JCloud...

Posted by Ignasi Barrera <ig...@gmail.com>.
Hi Ignacio,

As fas as I know there is no direct way to force a concrete IP address
using the portable TemplateOptions. Configuring a concrete IP address
is something that not all providers support, and that's why is not
part of the base TemplateOptions implementation. If you are using a
concrete provider that supports that, you could use the provider
specific template options. Something like:

TemplateOptions options =
options(foo).as(ProviderSpecificOptions.class).publicIp(something);

But that would depend on each provider implementation. If there no
such option, perhaps you could try sending a pull request? [1]. You
may also want to keep an eye on JCLOUDS-416 [2], as it is tightly
related to this.

Regarding the second question, yes, that's the way, although you could
use a more readable approach by using the Guava Lists/Sets helpers:

TemplateOptions options = nodeNames(Lists.newArrayList("name1", "name2"));

Finally, when working with public keys, you depend again on a provider
specific feature that is not supported in all them, so it is not part
of the portable TempalteOptions. The EC2TemplateOptions [3] has, for
example, a method to specify the name of the key pair to use. You
could again use the provider specific options here.


HTH!

Ignasi


[1] http://wiki.apache.org/jclouds/How%20to%20Contribute
[2] https://issues.apache.org/jira/browse/JCLOUDS-416
[3] https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java/org/jclouds/ec2/compute/options/EC2TemplateOptions.java#L266

On 4 January 2014 19:42, Ignacio de Córdoba <ic...@skios.es> wrote:
> Hello, as some of you know I'm pretty new to JClouds… let me please ask some
> questions I haven’t been able to solve with JavaDoc/online docs (I’m using
> Softlayer provider):
>
> 1) How can I specify that I want a new Node to use a specific IP address (in
> the subnet or address list that I have reserved/rented in the provider) when
> createNodesInGroup(...)? I can't find it in templateBuilder methods nor
> TemplateOptions class.
>
> 2) In a single node provision the correct way to specify the name for a node
> TemplateOptions templateOptions =  nodeNames(new
> ArrayList<String>(){{add(nodeName);}})
> (I don’t see some nodeName() option for a simple node creation)
>
> 3) To specify public key I’m using
> templateOptions.authorizePublicKey(publicKey);
> is there a way to specify the publicKey id or name stored in the provider
> service?
>
> Thanks for any help/directions.
>
>
> Ignacio de Córdoba
> icordoba@skios.es
> Red Skios S.A. - www.skios.es
>
>
>
>