You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by Duncan Grant <du...@cloudsoftcorp.com> on 2015/03/25 14:19:16 UTC

How do I give imageNameRegex an actual regular expression?

I'm trying to use a specific AMI on AWS using it's name.

It works if I set the imageNameRegex = region/image_name
but fails if I try any of the follwoing:
imageNameRegex = image_name
imageNameRegex = .*/image_name
imageNameRegex = .*image_name
imageNameRegex = /.*image_name/

The aim here is that I can copy an AMI across a number of regions and have
brooklyn pick up the correct one without my having to specify a specific
image id for that region.

Looking at the brooklyn tests then I shouldn't even need a regex - as long
as the name is a substring of the full name it should work.

I'm setting this in the brooklyn.properties not the yaml all though I can't
imagine that makes any difference.

thanks

Duncan

Re: How do I give imageNameRegex an actual regular expression?

Posted by Andrew Kennedy <an...@cloudsoftcorp.com>.
Done, see
http://stackoverflow.com/questions/29319093/how-do-i-give-imagenameregex-an-actual-regular-expression

Andrew.
--
-- andrew kennedy ; clocker.io project founder ; @grkvlt ;

On 25 March 2015 at 23:19, Alex Heneveld <al...@cloudsoftcorp.com>
wrote:

> Repost to stack overflow?
> On 25 Mar 2015 09:09, "Duncan Grant" <du...@cloudsoftcorp.com>
> wrote:
>
> > Aled,
> >
> > That fixed it!
> >
> > thanks
> >
> > Duncan
> >
> > On 25 March 2015 at 13:31, Aled Sage <al...@gmail.com> wrote:
> >
> > > Hi Duncan,
> > >
> > > You may also need to specify the image owner.
> > >
> > > As I recall, jclouds does something a little surprising with image
> > owners:
> > > if you specify an image name regex, it will only look in a small number
> > of
> > > image owner (rather than across all 20,000+ images, which can take 60+
> > > seconds to retrieve from AWS on some home networks).
> > >
> > > If you specify the image owner, then it should find it, such as:
> > >
> > >    imageOwner = 411009282317
> > >
> > > Aled
> > >
> > >
> > >
> > > On 25/03/2015 13:19, Duncan Grant wrote:
> > >
> > >> I'm trying to use a specific AMI on AWS using it's name.
> > >>
> > >> It works if I set the imageNameRegex = region/image_name
> > >> but fails if I try any of the follwoing:
> > >> imageNameRegex = image_name
> > >> imageNameRegex = .*/image_name
> > >> imageNameRegex = .*image_name
> > >> imageNameRegex = /.*image_name/
> > >>
> > >> The aim here is that I can copy an AMI across a number of regions and
> > have
> > >> brooklyn pick up the correct one without my having to specify a
> specific
> > >> image id for that region.
> > >>
> > >> Looking at the brooklyn tests then I shouldn't even need a regex - as
> > long
> > >> as the name is a substring of the full name it should work.
> > >>
> > >> I'm setting this in the brooklyn.properties not the yaml all though I
> > >> can't
> > >> imagine that makes any difference.
> > >>
> > >> thanks
> > >>
> > >> Duncan
> > >>
> > >>
> > >
> >
>

Re: How do I give imageNameRegex an actual regular expression?

Posted by Alex Heneveld <al...@cloudsoftcorp.com>.
Repost to stack overflow?
On 25 Mar 2015 09:09, "Duncan Grant" <du...@cloudsoftcorp.com> wrote:

> Aled,
>
> That fixed it!
>
> thanks
>
> Duncan
>
> On 25 March 2015 at 13:31, Aled Sage <al...@gmail.com> wrote:
>
> > Hi Duncan,
> >
> > You may also need to specify the image owner.
> >
> > As I recall, jclouds does something a little surprising with image
> owners:
> > if you specify an image name regex, it will only look in a small number
> of
> > image owner (rather than across all 20,000+ images, which can take 60+
> > seconds to retrieve from AWS on some home networks).
> >
> > If you specify the image owner, then it should find it, such as:
> >
> >    imageOwner = 411009282317
> >
> > Aled
> >
> >
> >
> > On 25/03/2015 13:19, Duncan Grant wrote:
> >
> >> I'm trying to use a specific AMI on AWS using it's name.
> >>
> >> It works if I set the imageNameRegex = region/image_name
> >> but fails if I try any of the follwoing:
> >> imageNameRegex = image_name
> >> imageNameRegex = .*/image_name
> >> imageNameRegex = .*image_name
> >> imageNameRegex = /.*image_name/
> >>
> >> The aim here is that I can copy an AMI across a number of regions and
> have
> >> brooklyn pick up the correct one without my having to specify a specific
> >> image id for that region.
> >>
> >> Looking at the brooklyn tests then I shouldn't even need a regex - as
> long
> >> as the name is a substring of the full name it should work.
> >>
> >> I'm setting this in the brooklyn.properties not the yaml all though I
> >> can't
> >> imagine that makes any difference.
> >>
> >> thanks
> >>
> >> Duncan
> >>
> >>
> >
>

Re: How do I give imageNameRegex an actual regular expression?

Posted by Duncan Grant <du...@cloudsoftcorp.com>.
Aled,

That fixed it!

thanks

Duncan

On 25 March 2015 at 13:31, Aled Sage <al...@gmail.com> wrote:

> Hi Duncan,
>
> You may also need to specify the image owner.
>
> As I recall, jclouds does something a little surprising with image owners:
> if you specify an image name regex, it will only look in a small number of
> image owner (rather than across all 20,000+ images, which can take 60+
> seconds to retrieve from AWS on some home networks).
>
> If you specify the image owner, then it should find it, such as:
>
>    imageOwner = 411009282317
>
> Aled
>
>
>
> On 25/03/2015 13:19, Duncan Grant wrote:
>
>> I'm trying to use a specific AMI on AWS using it's name.
>>
>> It works if I set the imageNameRegex = region/image_name
>> but fails if I try any of the follwoing:
>> imageNameRegex = image_name
>> imageNameRegex = .*/image_name
>> imageNameRegex = .*image_name
>> imageNameRegex = /.*image_name/
>>
>> The aim here is that I can copy an AMI across a number of regions and have
>> brooklyn pick up the correct one without my having to specify a specific
>> image id for that region.
>>
>> Looking at the brooklyn tests then I shouldn't even need a regex - as long
>> as the name is a substring of the full name it should work.
>>
>> I'm setting this in the brooklyn.properties not the yaml all though I
>> can't
>> imagine that makes any difference.
>>
>> thanks
>>
>> Duncan
>>
>>
>

Re: How do I give imageNameRegex an actual regular expression?

Posted by Aled Sage <al...@gmail.com>.
Hi Duncan,

You may also need to specify the image owner.

As I recall, jclouds does something a little surprising with image 
owners: if you specify an image name regex, it will only look in a small 
number of image owner (rather than across all 20,000+ images, which can 
take 60+ seconds to retrieve from AWS on some home networks).

If you specify the image owner, then it should find it, such as:

    imageOwner = 411009282317

Aled


On 25/03/2015 13:19, Duncan Grant wrote:
> I'm trying to use a specific AMI on AWS using it's name.
>
> It works if I set the imageNameRegex = region/image_name
> but fails if I try any of the follwoing:
> imageNameRegex = image_name
> imageNameRegex = .*/image_name
> imageNameRegex = .*image_name
> imageNameRegex = /.*image_name/
>
> The aim here is that I can copy an AMI across a number of regions and have
> brooklyn pick up the correct one without my having to specify a specific
> image id for that region.
>
> Looking at the brooklyn tests then I shouldn't even need a regex - as long
> as the name is a substring of the full name it should work.
>
> I'm setting this in the brooklyn.properties not the yaml all though I can't
> imagine that makes any difference.
>
> thanks
>
> Duncan
>