ARM (aarch64) image doesn't seem to respond to EC2 ACPI power button event
When you terminate an EC2 instance, AWS sends an ACPI power button press (see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#what-happens-terminate) to allow system services etc to shutdown cleanly, and then forcibly powers off if the EC2 hasn't shutdown within a period of time - from testing this appears to be ~2 minutes.
This can be demonstrated by running a very simple Python script
import time
while True:
print(time.time())
time.sleep(1)
and then terminating the instance in EC2.
With the x86_64
image, this appears to respect the ACPI events and disconnects almost immediately (within ~1s), but with the aarch64
image, the instance appears to ignore the event and continues until it is forcibly shutdown by EC2 ~240 seconds later.
This was tested with the following AMIs:
aarch64
: ami-06abc8943f1f974cf
x86_64
: ami-0de2f96ad3b546179