I just set up a new Chef environment as I'm currently expanding my knowledge of Chef. I have a Key Pair set up on EC2, I have my Knife configuration set up. When I attempt to spawn a server, the node is created but Knife can't ssh into it.
knife.rb (which is outside of the repo):
current_dir = File.dirname(__FILE__) log_level :info log_location STDOUT node_name "mynode" client_key "/Users/me/.chef/my.pem" validation_client_name "my-validator" validation_key "/Users/me/.chef/my-validator.pem" chef_server_url "https://api.opscode.com/organizations/myorg" cache_type 'BasicFile' cache_options( :path => "/Users/me/.chef/checksums" ) cookbook_path ["/Users/me/git/chef/cookbooks"] knife[:aws_access_key_id] = "yadayadyada" knife[:aws_secret_access_key] = "blahblahblah" knife[:identity_file] = "/Users/me/.ssh/knife.pem" knife[:aws_ssh_key_id] = "knife"
Here's my knife command:
knife ec2 server create -r "role[whatever]" -I ami-09470539 --subnet subnet-03e44866 -f t2.micro --ssh-user ubuntu --region us-west-2 -Z us-west-2a
I also tried it by specifying the
knife ec2 server create -r "role[whatever]" -I ami-09470539 --subnet subnet-03e44866 -f t2.micro -S knife -i ~/.ssh/knife.pem --ssh-user ubuntu --region us-west-2 -Z us-west-2a
This is a HVM instance inside a VPC group.
What I've tried and checked...
- Yes, the
pemhas the right permissions (400).
- Yes, the EC2 security group ("default") is world-accessible on port 22.
- Yes, I can ssh into it directly using the
knife.pemkey on the command line.
- Yes, I've Googled this exhaustively and read three different tutorials. I seem to have done everything correctly.
Is there anything else that I'm missing?
In verbose mode, this is what I am seeing...
Waiting for sshd .DEBUG: ssh timed out: 172.nnn.nnn.nnn .DEBUG: ssh timed out: 172.nnn.nnn.nnn