Proper way to stop/reboot a Windows EC2 instance

amazon ec2amazon-ebsamazon-web-services

I recently started with AWS and I need to stop/reboot some EC2 Windows instances. The instances are with EBS volumes.

Is there any difference if I use the Shutdown/Reboot Windows option vs Stop/Reboot from the AWS Console?

Best Answer

You have the following options:

Stop and Restart the instance from AWS commands

  • This will safely stop and restart your EC2 instance.
  • The instance will be in a "stopped" state until you restart it.
  • It may move your EC2 instance to different hardware.
  • It will allocate a new public IP address if you have not assigned an Elastic IP address.

Stop the instance from Windows "Start Menu" commands (or shutdown -h command in Linux) and restart the instance from AWS commands

  • This will safely stop and restart your EC2 instance.
  • The instance will be in a "stopped" state until you restart it.
  • It may move your EC2 instance to different hardware.
  • It will allocate a new public IP address if you have not assigned an Elastic IP address.

Reboot the instance from AWS commands

  • This will safely restart your EC2 instance.
  • The instance will remain in a "running" state.
  • The EC2 instance will remain on the same hardware.
  • The EC2 instance will maintain it's existing public IP address.

Reboot the instance from Windows "Start Menu" (or shutdown -r command in Linux)

  • This will safely restart your EC2 instance.
  • The instance will remain in a "running" state.
  • The EC2 instance will remain on the same hardware.
  • The EC2 instance will maintain it's existing public IP address.

Additional Notes

Whenever possible, AWS will gracefully shutdown the OS for both stops and reboots.

If you use AWS commands to stop or restart your EC2 instances, you may face "unexpected shutdown" alerts in your Windows instances. Mostly, these are harmless questions by the OS to the admin, not notifications of errors.

When using AWS commands to stop your EC2 instance, if it does not stop, you can retry with the "force" option. Using this option does not gracefully shutdown the OS and your filesystem should be checked on next start.