Where id node go?

Once upon a time I had a script that did the following:
$!/bin/bash
knife exec -E "search(:node, 'name:$1) { |h| puts h[:ec2][:instance_id] } "

and it worked, that it, it returned the EC2 instance ID of the node in $1.

I hadn’t used the script in a while, and when I when to use it today, instance_id was gone. Further investigation revealed that it isn’t in the node at all (knife node edit nodename -a, then search for nstance_d, ec2, or i-* all turned up nil).

Did it go away in the latest iteration of chef? If so, why? And is there a way I can get it back?

Thanks!

Vincent Jorgensen

IIRC, the ec2 plugin was disabled by default due to causing excessive
delays on other systems.

You can turn it on with an ohai hint: $(touch /etc/chef/ohai/hints/ec2.json)

Cheers,

AJ

On 18 January 2013 13:27, Vincent Jorgensen <
vincent.jorgensen@incentivenetworks.com> wrote:

Once upon a time I had a script that did the following:
$!/bin/bash
knife exec -E "search(:node, 'name:$1) { |h| puts h[:ec2][:instance_id] } "

and it worked, that it, it returned the EC2 instance ID of the node in $1.

I hadn't used the script in a while, and when I when to use it today,
instance_id was gone. Further investigation revealed that it isn't in the
node at all (knife node edit nodename -a, then search for nstance_d, ec2,
or i-* all turned up nil).

Did it go away in the latest iteration of chef? If so, why? And is there a
way I can get it back?

Thanks!

Vincent Jorgensen

That did it! Thank you! I'm going to add it to the bootstrap script.

Cheers!

Vincent Jorgensen
On Jan 17, 2013, at 4:39 PM, AJ Christensen wrote:

$(touch /etc/chef/ohai/hints/ec2.json)

FWIW, EC2 detection should work where it worked in the past. It was based on finding a mac address "fe:ff:ff:ff:ff:ff" in the arp cache or something, which is not the case for VPC nodes (IIRC). Hint system is much more reliable.

--
Daniel DeLeo

On Thursday, January 17, 2013 at 4:51 PM, Vincent Jorgensen wrote:

That did it! Thank you! I'm going to add it to the bootstrap script.

Cheers!

Vincent Jorgensen
On Jan 17, 2013, at 4:39 PM, AJ Christensen wrote:

$(touch /etc/chef/ohai/hints/ec2.json)

exactly,
are you using the script inside vpc?

On Thu, Jan 17, 2013 at 5:09 PM, Daniel DeLeo dan@kallistec.com wrote:

FWIW, EC2 detection should work where it worked in the past. It was based
on finding a mac address "fe:ff:ff:ff:ff:ff" in the arp cache or something,
which is not the case for VPC nodes (IIRC). Hint system is much more
reliable.

--
Daniel DeLeo

On Thursday, January 17, 2013 at 4:51 PM, Vincent Jorgensen wrote:

That did it! Thank you! I'm going to add it to the bootstrap script.

Cheers!

Vincent Jorgensen
On Jan 17, 2013, at 4:39 PM, AJ Christensen wrote:

$(touch /etc/chef/ohai/hints/ec2.json)

Yes. All the instances in question are inside our VPC.


Vincent Jorgensen
Operations Engineer @ Incentive Networks
650.226.4917 PST (GMT-0800)

On Jan 17, 2013, at 5:11 PM, Ranjib Dey wrote:

exactly,
are you using the script inside vpc?

On Thu, Jan 17, 2013 at 5:09 PM, Daniel DeLeo dan@kallistec.com wrote:
FWIW, EC2 detection should work where it worked in the past. It was based on finding a mac address "fe:ff:ff:ff:ff:ff" in the arp cache or something, which is not the case for VPC nodes (IIRC). Hint system is much more reliable.

--
Daniel DeLeo

On Thursday, January 17, 2013 at 4:51 PM, Vincent Jorgensen wrote:

That did it! Thank you! I'm going to add it to the bootstrap script.

Cheers!

Vincent Jorgensen
On Jan 17, 2013, at 4:39 PM, AJ Christensen wrote:

$(touch /etc/chef/ohai/hints/ec2.json)