Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been thrown into the deep end of Chef this past week, and I'm stuck on one thing at the moment. I've created an instance in AWS (many times at this point) and when chef kicks in to do its thing I get an compilation error. Fine, I'll figure out what's up and then reapply.

My question: How can I update an existing instance? I can use $ knife ec2 server create [coptions] but is there a corresponding update command? My brain wants to execute something like $ knife ec2 server update [AWS instance ID] -x userXXX -r 'recipe[yyy::zzzz]' I don't see update as an option so is there anything similar?

I don't want to keep creating and terminating instances while I troubleshoot what is going on with the recipe, I would rather apply changes to an existing instance.

share|improve this question
You can use knife to modify the run_list for the node (e.g. 'knife node edit <node_name>', and then run the chef-client from the system. Alternatively if you've got the client running as a daemon or automatically driven by cron, you just update the run_list and then wait and let the chef client do it for you. – Joshua Miller Oct 8 '13 at 20:27
up vote 3 down vote accepted

Try knife solo which allows you to update remote server with chef-solo (not chef-client) like:

knife solo cook ec2-user@your-node-fqdn -o "your-run-list"

In the context of chef server, you're not update the remote ec2 server, instead, you just update the node object of your ec2 server, and chef-client will sync your changes when it starts. So you just need to update your node/role/environment via knife.

share|improve this answer

If Chef is bootstrapped successfully on the server, run

knife ssh -m [server-id] chef-client

With EC2, the server-id is the instance id assigned by AWS.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.