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.
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 miketheman@gmail.com 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:
Update to support 'InstanceProtocol' in the ELB API 2012-06-01 · Issue #146 · flexera-public/right_aws · GitHub
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
cmaheshwari16@gmail.com 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 miketheman@gmail.com 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
cmaheshwari16@gmail.com 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] :
Auto-scaling on Amazon EC2 with Opscode Chef - Ivan-Site.com
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