Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What are the differences, if any, between invoking reboot on an EC2 instance's command line and issuing the ec2-reboot-instances command from the AWS Command Line Tools on another machine?

Does ec2-reboot-instances do anything that sending reboot over an SSH session won't do, such as handling environmental things specific to AWS?

Is there a preference between the two commands?

In my specific case, I'm using the Java library to access the AWS API rather than the command line tool, but it still invokes the same command on AWS. The Java library is more verbose than the command line tool, so it would be easier to send the reboot command over SSH, but I'd like to understand if there are any other considerations that would make it worth using the AWS API approach.

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

Differences in use:

  • No SSH access required (can be run from any computer, or even the AWS console)
  • ec2-reboot-instances requires AWS credentials
  • Can easily script for multiple instances (easier to integrate with other AWS services)

Difference in functionality:

  • ec2-reboot-instances will force a hard reboot after 4 minutes if the instance hasn't cleanly shutdown. (See Documentation)
  • The command does not confirm success - the reboot request is queued but you are not informed if it worked or if a hard start is required, etc (you are informed of outright failed commands - e.g. permissions problems, etc)
  • There is a slight delay in execution of command - usually not noticable

In cases where the instance is responsive and can be accessed via SSH reboot (via SSH) will perform the same task as ec2-reboot-instances.


As an additional point of mention, reboots from SSH will suffice for scheduled maintenance (i.e. you do not need to use ec2-reboot-instances). As per the documentation:

Instance reboots are reboots of your virtual instance, and are equivalent to an operating system reboot.

Managing your own instance reboots is very straightforward. ...you can also reboot your instance from the operating system of your instance.

share|improve this answer
    
Will a non-EC2 reboot command trigger scheduled maintenance events? –  ceejayoz Jan 18 '12 at 2:38
    
@ceejayoz: Yes it will - updated the answer to mention it. –  cyberx86 Jan 18 '12 at 2:48
    
Neat, thanks, I'd wondered about that. –  ceejayoz Jan 18 '12 at 3:58
    
Thanks for the answer, sorry for the long delay between posting and following up –  chrisbunney Nov 18 '12 at 15:51
add comment

Your Answer

 
discard

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.