- Newest
- Most votes
- Most comments
Based on your description, it appears there's a discrepancy between when Windows completes its shutdown process (about 40 seconds) and when AWS EC2 actually transitions the instance state from "stopping" to "stopped" (5-6 minutes).
This behavior is not necessarily abnormal. When you initiate a shutdown from within the Windows operating system, the instance enters the "stopping" state while EC2 completes various backend processes. During this time, even though Windows has completed its shutdown procedures, EC2 might still be handling tasks like detaching network interfaces, preparing the EBS volumes, or managing other AWS-specific resources.
For G4 instances specifically, which have NVIDIA GPUs, there might be additional cleanup processes related to the GPU resources that need to complete before the instance fully stops.
While you're in the "stopping" state, you won't be charged for instance usage (you're only charged when the instance is in the "running" state), though you'll still be charged for any attached EBS volumes.
If you need to speed up the shutdown process in the future, you could try using the force stop option through the AWS CLI:
aws ec2 stop-instances --instance-ids your-instance-id --force
You can also add the --skip-os-shutdown
parameter if you want to bypass the graceful OS shutdown process, though this should be used cautiously as it might lead to data loss if there are unsaved changes.
If this issue is causing significant problems for your workflow and persists across fresh instances, it might be worth creating a support case with AWS to investigate if there's an underlying issue specific to Windows 2025 on G4 instances.
Sources
Troubleshoot Amazon EC2 instance stop issues - Amazon Elastic Compute Cloud
My Ec2 instance stops completely and does not stop. | AWS re:Post
Change instance initiated shutdown behavior - Amazon Elastic Compute Cloud
Based on the suggestion above, I think this answers some part of the issue:
I tried to launch a new instance using t3.medium with Windows2025 and it managed to shutdown in less than 1.5min.
I need a solution to this problem because we need to use G4 instances for the GPU, and we're using AutoScaling + Warmup pool. We can't really use
--force
parameter or--skip-os-shutdown
as that may corrupt the data, plus autoscaling does the shutting down.Please suggest a workaround or fix the issue as we need many instances starting & shutting down fast to be in the warm up pool to cater to many users.
Regards JSashi