Is there a way to stop and AWS ec2 instance from the VM itself? If i start a ec2 linux based instance, is there a way for me to stop that instance by giving some linux command like "shutdown now"?
It's working with
shutdown -h now
or
shutdown -h +10
If you don't use "-h" parameter to halt, the instance will keep on running state.
Yes, with a couple of caveats.
If you are using an instance store backed instance, your only option will be to terminate. Without EBS volumes, the instance cannot exist in a stopped state.
There is also a flag that can be set on the instance as to how instance initiated shutdown is handled. This can be stop or terminate. If you want to stop your instance, make sure that this flag is configured correctly.
Other than that, you would use the normal Linux shutdown commands. shutdown now
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With