[chef] Re: Re: Re: Re: Attach an ec2 instance on the existing ELB


Chronological Thread 
  • From: Chandan Maheshwari < >
  • To: chef < >
  • Subject: [chef] Re: Re: Re: Re: Attach an ec2 instance on the existing ELB
  • Date: Tue, 28 May 2013 21:44:39 +0530

Ohai,

What is the goal here? Are you trying to set up something for autoscaling? Or are you just looking to register new nodes with an ELB?

                               I wanted to set up for autoscaling only. What is the difference b/w , "register a newly created node to ELB" vs setup for autoscaling.

If you're doing autoscaling, I'd consider building a custom AMI for the nodes that need to autoscale. I'd make that with the validation.pem and JSON with the run list for the nodes you want, and also sets up chef-client to run at launch or as a service.

                                 Sorry but I didn't get actually the way to create AMI, also does it make any difference if every time I trigger to use basic AMI and then apply my cookbooks on them and then register them again to the ELB vs just use the AMI with runlist set as JSON and chef-client to run as a service [except it would be a faster way]

If you just want to add nodes to an ELB, Opscode's "aws" cookbook has an elastic_lb resource, which you could use in your own cookbook. I'd assign the ELB name as an attribute in the role for the node's in the role you want to use, and then reference that attribute in the resource.

    aws_elastic_lb 'my-load-balancer' do
      name node['aws']['load_balancer']
      aws_access_key aws['aws_access_key_id']
      aws_secret_access_key aws['aws_secret_access_key']
    end

                                I used that but it gives me below error:
                   " Suppose my ELB is NAME
                      cookbook having recipe to register instance is cookbook_name

FATAL: RightAws::AwsError: aws_elastic_lb[NAME] (cookbook_name::register line 3) had an error: RightAws::AwsError: ValidationError: ELB in VPC is not supported in this version of API. Please try 2011-11-15 or newer."




On Tue, May 28, 2013 at 9:34 PM, Mike < " target="_blank"> > wrote:
Chandan,

That looks to be a bug with the right_aws gem that the aws cookbook
depends on, and there is an open issue here:
https://github.com/rightscale/right_aws/issues/146

I suspect is has to do with the case of ELB and VPC combination, and
hopefully sometime that will get merged in and released, irrespective
of Chef.

-M


On Tue, May 28, 2013 at 11:57 AM, Chandan Maheshwari
< "> > wrote:
> Thanks Mike for your prompt response.
>
> I was just looking on the same cookbook and wrote once recipe(to register my
> ec2 instance), but it gave me error
> Suppose,
>
> my ELB is NAME
> cookbook having recipe to register instance is cookbook_name
>
> FATAL: RightAws::AwsError: aws_elastic_lb[NAME] (cookbook_name::register
> line 3) had an error: RightAws::AwsError: ValidationError: ELB in VPC is not
> supported in this version of API. Please try 2011-11-15 or newer.
>
>
> On Tue, May 28, 2013 at 9:24 PM, Mike < "> > wrote:
>>
>> Chandan,
>>
>> You might want to look at the aws cookbook:
>> http://community.opscode.com/cookbooks/aws
>>
>> For example, to register the node in the 'QA' ELB:
>>
>> aws_elastic_lb "elb_qa" do
>>   aws_access_key aws['aws_access_key_id']
>>   aws_secret_access_key aws['aws_secret_access_key']
>>   name "QA"
>>   action :register
>> end
>>
>> -M
>>
>> On Tue, May 28, 2013 at 9:27 AM, Chandan Maheshwari
>> < "> > wrote:
>> > Hi All,
>> >
>> > I want to attach an ec2 instance, once it is created using knife ec2
>> > plugin
>> > and after applying my runlist to it, to the existing ELB I have.
>> >
>> > How can I do this, is there any ready cookbook/LWRP for this. I have one
>> > very good solution to this, thanks to Ivan [which is working fine and
>> > creating the instances, attaching them to the ELB I provide] :
>> >
>> > http://ivan-site.com/2013/02/auto-scaling-on-amazon-ec2-with-opscode-chef/
>> >
>> > but I don't want to create instance without using knife (and manually
>> > install chef-client and dependencies)
>> >
>> > --
>> > Thanks and Regards,
>> > Chandan
>
>
>
>
> --
> Regards,
> Chandan



--
Regards,
Chandan



Archive powered by MHonArc 2.6.16.

§