You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jclouds.apache.org by liang cheng <li...@gmail.com> on 2014/12/01 21:06:33 UTC

ec2 image for jclouds

Hi,

I'm experimenting the jclouds ec2 example:

https://github.com/jclouds/jclouds-examples/tree/master/compute-basics

I works perfectly fine with the AWS EC2 default ami like ami-4b6f650e.

However, it has ssl issue with my own ami. It can create ami but can't do
the bootstrap script injection.

Now my question is what conditions I need to satisfy for my own ami to work
with jclouds on ec2 ? Do I need to have a default user name like ec2-user ?

Thanks,
-Liang

Re: ec2 image for jclouds

Posted by liang cheng <li...@gmail.com>.
Thank you Ignasi. That works like a charm.

-Liang

On Mon, Dec 1, 2014 at 3:35 PM, Ignasi Barrera <na...@apache.org> wrote:

> Something like this should work:
>
> TemplateOptions options = compute.templateOptions();
> Template template = compute.templateBuilder()
>    .options(options.overrideLoginUser("user")
>                             .overrideLoginPassword("password"))
>    (...)
>    .build();
>
>
> On 2 December 2014 at 00:13, liang cheng <li...@gmail.com> wrote:
> > Hi Ignasi,
> >
> > Thanks for the reply. Can you please provide some code snippet from a
> > working example how to use overrideLoginCredentials to overwrite the
> > password for the root ?
> >
> > Thanks,
> > -Liang
> >
> >
> >
> > On Mon, Dec 1, 2014 at 1:28 PM, Ignasi Barrera <na...@apache.org> wrote:
> >>
> >> Hi Liang,
> >>
> >> The AWS api does not provide a way to get the default username of the
> >> AMIs, so jclouds can only do its best to guess them. We also provide
> >> the usernames for AMIs from well-known owners, but if you are using a
> >> custom AMI, jclouds will probably try to login as "root".
> >>
> >> You can provide the right credentials by using the
> >> "overrideLoginCredentials" in the TemplateOptions object.
> >>
> >> Let us know if this helps!
> >>
> >> I.
> >>
> >> On 1 December 2014 at 21:06, liang cheng <li...@gmail.com> wrote:
> >> > Hi,
> >> >
> >> > I'm experimenting the jclouds ec2 example:
> >> >
> >> >
> https://github.com/jclouds/jclouds-examples/tree/master/compute-basics
> >> >
> >> > I works perfectly fine with the AWS EC2 default ami like ami-4b6f650e.
> >> >
> >> > However, it has ssl issue with my own ami. It can create ami but can't
> >> > do
> >> > the bootstrap script injection.
> >> >
> >> > Now my question is what conditions I need to satisfy for my own ami to
> >> > work
> >> > with jclouds on ec2 ? Do I need to have a default user name like
> >> > ec2-user ?
> >> >
> >> > Thanks,
> >> > -Liang
> >
> >
>

Re: ec2 image for jclouds

Posted by Ignasi Barrera <na...@apache.org>.
Something like this should work:

TemplateOptions options = compute.templateOptions();
Template template = compute.templateBuilder()
   .options(options.overrideLoginUser("user")
                            .overrideLoginPassword("password"))
   (...)
   .build();


On 2 December 2014 at 00:13, liang cheng <li...@gmail.com> wrote:
> Hi Ignasi,
>
> Thanks for the reply. Can you please provide some code snippet from a
> working example how to use overrideLoginCredentials to overwrite the
> password for the root ?
>
> Thanks,
> -Liang
>
>
>
> On Mon, Dec 1, 2014 at 1:28 PM, Ignasi Barrera <na...@apache.org> wrote:
>>
>> Hi Liang,
>>
>> The AWS api does not provide a way to get the default username of the
>> AMIs, so jclouds can only do its best to guess them. We also provide
>> the usernames for AMIs from well-known owners, but if you are using a
>> custom AMI, jclouds will probably try to login as "root".
>>
>> You can provide the right credentials by using the
>> "overrideLoginCredentials" in the TemplateOptions object.
>>
>> Let us know if this helps!
>>
>> I.
>>
>> On 1 December 2014 at 21:06, liang cheng <li...@gmail.com> wrote:
>> > Hi,
>> >
>> > I'm experimenting the jclouds ec2 example:
>> >
>> > https://github.com/jclouds/jclouds-examples/tree/master/compute-basics
>> >
>> > I works perfectly fine with the AWS EC2 default ami like ami-4b6f650e.
>> >
>> > However, it has ssl issue with my own ami. It can create ami but can't
>> > do
>> > the bootstrap script injection.
>> >
>> > Now my question is what conditions I need to satisfy for my own ami to
>> > work
>> > with jclouds on ec2 ? Do I need to have a default user name like
>> > ec2-user ?
>> >
>> > Thanks,
>> > -Liang
>
>

Re: ec2 image for jclouds

Posted by liang cheng <li...@gmail.com>.
Hi Ignasi,

Thanks for the reply. Can you please provide some code snippet from a
working example how to use overrideLoginCredentials to overwrite the
password for the root ?

Thanks,
-Liang



On Mon, Dec 1, 2014 at 1:28 PM, Ignasi Barrera <na...@apache.org> wrote:

> Hi Liang,
>
> The AWS api does not provide a way to get the default username of the
> AMIs, so jclouds can only do its best to guess them. We also provide
> the usernames for AMIs from well-known owners, but if you are using a
> custom AMI, jclouds will probably try to login as "root".
>
> You can provide the right credentials by using the
> "overrideLoginCredentials" in the TemplateOptions object.
>
> Let us know if this helps!
>
> I.
>
> On 1 December 2014 at 21:06, liang cheng <li...@gmail.com> wrote:
> > Hi,
> >
> > I'm experimenting the jclouds ec2 example:
> >
> > https://github.com/jclouds/jclouds-examples/tree/master/compute-basics
> >
> > I works perfectly fine with the AWS EC2 default ami like ami-4b6f650e.
> >
> > However, it has ssl issue with my own ami. It can create ami but can't do
> > the bootstrap script injection.
> >
> > Now my question is what conditions I need to satisfy for my own ami to
> work
> > with jclouds on ec2 ? Do I need to have a default user name like
> ec2-user ?
> >
> > Thanks,
> > -Liang
>

Re: ec2 image for jclouds

Posted by Ignasi Barrera <na...@apache.org>.
Hi Liang,

The AWS api does not provide a way to get the default username of the
AMIs, so jclouds can only do its best to guess them. We also provide
the usernames for AMIs from well-known owners, but if you are using a
custom AMI, jclouds will probably try to login as "root".

You can provide the right credentials by using the
"overrideLoginCredentials" in the TemplateOptions object.

Let us know if this helps!

I.

On 1 December 2014 at 21:06, liang cheng <li...@gmail.com> wrote:
> Hi,
>
> I'm experimenting the jclouds ec2 example:
>
> https://github.com/jclouds/jclouds-examples/tree/master/compute-basics
>
> I works perfectly fine with the AWS EC2 default ami like ami-4b6f650e.
>
> However, it has ssl issue with my own ami. It can create ami but can't do
> the bootstrap script injection.
>
> Now my question is what conditions I need to satisfy for my own ami to work
> with jclouds on ec2 ? Do I need to have a default user name like ec2-user ?
>
> Thanks,
> -Liang