Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7873021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:23:27+00:00 2026-06-03T02:23:27+00:00

When starting an instance on Amazon EC2, how would I detect a failure, for

  • 0

When starting an instance on Amazon EC2, how would I detect a failure, for instance, if there’s no machine available to fulfill my request? I’m using one of the less-common machine types and am concerned it won’t start up, but am having trouble finding out what message to look for to detect this.

I’m using the EC2 commandline tools to do this. I know I can look for ‘running’ when I do ec2-describe-instance to see if the machine is up, but don’t know what to look for to see if the startup failed.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:23:28+00:00Added an answer on June 3, 2026 at 2:23 am

    The output from ec2-start-instances only returns you stopped pending, and as you say you need to use ec2-describe-instances to retrieve the state.

    For that, you have a couple of choices; you can either use a loop to check for instance-state-name, looking for a result of running or stopped; alternatively you could look at either the reason or state-reason-code fields; unfortunately you’ll need to trigger the failure you’re worried about, to obtain the values that indicate failure.

    The batch file I use to wait for a successful startup (fill in the underscores):

    @echo off
    set EC2_HOME=C:\tools\ec2-api-tools
    set EC2_PRIVATE_KEY=C:\_\pk-_.pem
    set EC2_CERT=C:\_\cert-_.pem
    set JAVA_HOME=C:\Program Files (x86)\Java\jre6
    %EC2_HOME%\bin\ec2-start-instances i-_
    :docheck
    %EC2_HOME%\bin\ec2-describe-instances | C:\tools\gnuwin32\bin\grep.exe -c stopped > %EC2_HOME%\temp.txt
    findstr /m "1" %EC2_HOME%\temp.txt > nul
    if %errorlevel%==0 (c:\tools\gnuwin32\bin\echo -n "."
    goto docheck)
    del temp.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to start a Amazon EC2 cloud machine with [startInstance][2] method using aws-sdk
I am facing a certain behavior using Amazon EC2 and Java that it's being
How would I delete the 6 lines starting from every instance of a word
I have a website running on an Amazon EC2 Instance, and I'm trying to
I've just starting using the Amazon Web Services (AWS) and I'm still learning about
Starting a new big C multiplatform project, what rules should one follow to avoid
Starting with no cache on server or client FIRST REQUEST GET /post/1 HTTP/1.1 HTTP/1.1
Starting a new project using EJB 3 / JPA, mainly stateless session beans and
I'm getting the following exception when starting a Tomcat instance with my web app
I have a neo4j instance on a ubuntu machine that shut down while the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.