Bobcares

EC2 instance stuck in the stopping state – How to fix

by | Jul 11, 2021

Wondering how to fix an EC2 instance stuck in the stopping state? We can help you!

Often EC2 users report to us that their instance appears to be “stuck” in the stopping state.

This generally, happens when there is a problem with the underlying hardware hosting the instance. Also, this issue can occur when hibernating a hibernation-enabled instance.

Here at Bobcares, we handle requests from our customers to fix similar issues as a part of our Server Management Services.

Today let’s see how our Support Engineers fix this for our customers.

How to fix EC2 instance stuck in the stopping state

We can check the most recent state of the instance with the refresh icon in the Amazon EC2 console.

Also, we can run the following describe-instances command in the AWS Command Line Interface (AWS CLI):

aws ec2 describe-instances --instance-ids your-instance-id --output json

From the result we can check the State Code and Name in the JSON response:

"State": {
                        "Code": 64, 
                        "Name": "stopping"
                    },

Steps to fix this error

Following are the methods that our Support Engineers follow to fix this issue:

1. Force stop the instance

We can force the instance to stop either using the console or the AWS CLI.

To force stop the instance using the console we can use the following steps:

1. Firstly, we have to open the Amazon EC2 console (https://console.aws.amazon.com/ec2/).

2. Then go to instances and select the stuck instance.

3. After that go to Instance state and take Force stop instance.

4. Finally Stop the instance.

2. Create a replacement instance

We can create a replacement instance using two of the following methods:

Method1:

Following are the steps to create a replacement instance:

1. Firstly, we have to open the Amazon EC2 console.

2. Then go to Instances and select the stuck instance.

3. After that we must choose Actions then go to Image and templates

4. And select Create Image, do the following steps:

  1. Enter a name and description for the AMI.
  2. And select No reboot.
  3. After that select Create image.

5. Now we can launch a new instance from the AMI and verify that the new instance is working.

6. Then we can select the stuck instance, and go to Actions.

7. From there go to Instance state and  Terminate instance.

If the instance also gets stuck terminating, Amazon EC2 automatically forces it to terminate within a few hours.

Method 2:

The alternate method to create a replacement instance using the console is given below.

Following are the steps:

1. Firstly, we have to select the instance and go to Description.

2. Then select Block devices.

3. After that, we can select each volume and note down the volume ID.

4. Also, we must note which volume is the root volume.

5. Now from the navigation pane, select Volumes.

6. And select each volume for the instance, and click on Actions, Create Snapshot.

7. After that, we have to select the snapshot that we just created, and click on Actions, Create Volume.

8. Next, we have to launch an instance with the same operating system as the stuck instance.

9. Here also we must ensure to note the volume ID and device name of its root volume.

10. Now, we have to select the instance that we just launched, and click on Instance state, Stop the instance.

11. After that go to Volumes, select the root volume of the stopped instance, and click on Actions, Detach Volume.

12. Then we have to select the root volume that we created from the stuck instance and attach it to the new instance as its root volume

13. We can also attach additional non-root volumes to the instance, if any.

14. From the Instances we must select the replacement instance and click on Instance state, Start the instance.

6. To verify we can select the stuck instance, and go to Actions.

7. From there select Instance state and Terminate instance.

If the instance also gets stuck terminating, Amazon EC2 automatically forces it to terminate within a few hours.

[Need assistance? We can help you]

Conclusion

To conclude, we saw the steps that our Support Techs follow to fix the EC2 instance stuck in the stopping state.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF