Technical FAQ

8.1. Why can't I "talk" to my instances?
8.2. Why did my instance terminate immediately after launch?
8.3. I ran shutdown from within an ssh session but my instance still shows up as running when I query it with DescribeInstances and I can't shell into it. What's happening?
8.4. What username do I use for the various Amazon EC2 tools?
8.5. What happens to my running instances if the machines they are running on go down?
8.6. Why are my instances stuck in a pending state (or a shutting-down state)?
8.7. Why do I get an "AuthFailure: User is not AMI creator" error when I try to register an image?
8.8. Why do I get an "InsufficientInstanceCapacity" error when I try to launch an instance?
8.9. Why do I get an "InstanceLimitExceeded" error when I try to launch an instance?
8.10. How many instances can I launch?
8.11. Can I use a static IP in my instances?
8.12. How do I host a public domain if I have to DHCP an IP address?
8.13. How do I handle time synchronization between instances?
8.14. Can I use my own kernel?
8.15. Can I get a bigger/smaller/differently optimized virtual machine?
8.16. Is there a REST interface to Amazon EC2?
8.17. How does Amazon EC2 handle load balancing?
8.18. How do I monitor my systems?
8.19. Is there any way for an instance to discover its own instance ID?
8.20. Can I pass arbitrary configuration values to an instance at launch time?
8.21. Why can't I retrieve my instance-specific data from within a running instance when querying http://169.254.169.254/2007-01-19/?
8.22. Is there a way to run a script on instance termination?
8.23. Why do I get keep getting "Request has expired" errors?
8.24. How can I allow other people to launch my AMIs?
8.25. Can I charge other people for using my AMI?
8.26. Why do I need to reregister a rebundled AMI? Can't I keep the same AMI ID?
8.27. Can I pass JVM properties to the command line tools?
8.28. Can I use a proxy with the command line tools?
8.1.

Why can't I "talk" to my instances?

Here are a few common reasons for broken connectivity to your instance.

An instance's state is changed to running as soon as we start to boot your OS. This means there will be some delay (possibly a few minutes depending on your configuration) during which your instance will not have been fully set-up. After this period, it should be fully functional.

Additionally, you will need to make sure you have authorized the appropriate access to your host through the Amazon EC2 firewall. If you have launched your instances without specifying a security group, the default group is used. Permissions on the default group are very strict by default and disallow all access from the Internet and other groups. You will need to add permissions to your default group or you will have to set up a new group with appropriate permissions. See the developer guide for more information on the “Securing the Network”.

Assuming you have authorized port 22, a useful debugging tool is to try to open an ssh connection with verbose output. You should use the man page to get the exact syntax for your system, but the command is likely to look like ssh -vv root@[hostname]. This output would be very useful if posting to the forum.

8.2.

Why did my instance terminate immediately after launch?

Launch errors may be the result of an internal error during launch or a corrupt Amazon EC2 image. The former should be rare, and we actively test for and isolate suspect hosts. You should use the “DescribeInstances” API to look for more details on why your instance failed to launch.

NB: the ec2-describe-instances command line tool does not conveniently print out this information yet! You can use the -v flag to read the SOAP response from this tool and get the information discussed above.

You can always feel free to attempt to launch the image again, but if you run into a persistent problem (especially with a shared image), you should post to the Amazon EC2 forum.

8.3.

I ran shutdown from within an ssh session but my instance still shows up as running when I query it with DescribeInstances and I can't shell into it. What's happening?

This is a "feature" of the shutdown command. If you issue shutdown without a -h (halt) flag it shuts down the network and switches to single user mode. The instance is still running but without a network. You should always use shutdown -h when working inside an Amazon EC2 instance.

You can shut the instance down using the TerminateInstances call (ec2-terminate on the command line).

8.4.

What username do I use for the various Amazon EC2 tools?

When you sign up with Amazon Web Services, you are given an AWS Account ID. This is your username. More detail is provided in the Getting Started Guide.

8.5.

What happens to my running instances if the machines they are running on go down?

The instances themselves will be terminated and will have to be relaunched. The data on the instances' hard drives will be lost.

Always replicate important data or store it in Amazon S3.

8.6.

Why are my instances stuck in a pending state (or a shutting-down state)?

This situation should be rare and is the result of a software error or misconfiguration. We actively monitor for it, but please let us know if you do encounter this.

8.7.

Why do I get an "AuthFailure: User is not AMI creator" error when I try to register an image?

Make sure that you are using the correct user ID and certificate to create and upload the image. You need to use the same ID and certificate to register the image with Amazon EC2.

8.8.

Why do I get an "InsufficientInstanceCapacity" error when I try to launch an instance?

This error indicates that we don’t currently have enough available capacity to service your request. During our beta, capacity is limited.

If you are requesting a large number of instances, there may not be enough server capacity to host them. You could try again at a different time or specify a smaller number of instances to launch.

8.9.

Why do I get an "InstanceLimitExceeded" error when I try to launch an instance?

This error indicates that you have reached your concurrent running instance limit. For new users during the public beta, this limit is 20.

If you need additional capacity, please contact us at aws@amazon.com.

8.10.

How many instances can I launch?

Each user has a concurrent running instance limit. For new users during the public beta, this limit is 20.

8.11.

Can I use a static IP in my instances?

Not at present. Your image must be configured as a DHCP client and it will be assigned an IP. Currently, all instances come with internet addressable IP addresses. If you enable access through the firewall from the "world", you can address them from anywhere.

8.12.

How do I host a public domain if I have to DHCP an IP address?

You can use a dynamic DNS service, such as DynDNS or ZoneEdit.

8.13.

How do I handle time synchronization between instances?

You can set up NTP (the Network Time Protocol) which does this for you. You can find more information at http://www.ntp.org/. This is particularly important if you plan on using any of Amazon's web services (such as Amazon S3 or Amazon EC2) from within an instance, since requests to these services need to be timestamped.

8.14.

Can I use my own kernel?

Not at present.

8.15.

Can I get a bigger/smaller/differently optimized virtual machine?

Not at present. For now, if you need more capacity launch more instances.

8.16.

Is there a REST interface to Amazon EC2?

Not at present. For now, you will have to use the SOAP or Query API, or the provided API command line tools.

8.17.

How does Amazon EC2 handle load balancing?

With a service as flexible as Amazon EC2, customers can launch any number of load balancing systems within Amazon EC2. The load balancing instances can forward traffic to other systems. There are several open source solutions that are in wide use.

8.18.

How do I monitor my systems?

Amazon EC2 currently only provides the most basic monitoring. You can tell from DescribeInstances whether we believe your instance is running or not. However, you may regard your systems running in Amazon EC2 as your data center, and so any monitoring instrumentation that you wish to include on the systems – be it SNMP or some other mechanism – is entirely up to you.

8.19.

Is there any way for an instance to discover its own instance ID?

From within your instance you can use REST-like queries to http://169.254.169.254/2007-01-19/ to retrieve various instance specific meta-data, including the instance ID. Refer to the Developer's Guide (section 'Using Instance Data') for the details.

8.20.

Can I pass arbitrary configuration values to an instance at launch time?

Yes, although the size of the data is limited to 16K at the moment. Refer to the Developer's Guide for the details: section 'Using Instance Data' tells you how to retrieve data and the sections on the command-line tools and APIs tell you how to supply the data when launching an instance.

8.21.

Why can't I retrieve my instance-specific data from within a running instance when querying http://169.254.169.254/2007-01-19/?

The Parameterized Launches feature is only available to instances that were launched after the feature was released. Therefore if you launched your instance before then, this data will not be available. We suggest you relaunch your instances if you want to use this functionality.

If after relaunching your instance you still experience problems retrieving the data, you should check:

  • Are you using the correct base URI (http://169.254.169.254/2007-01-19/)
  • Are you using the correct URI for the data you're trying to retrieve? Remember that trailing '/' may be required, depending on the data you're trying to retrieve.
  • Did you specify any launch data when launching your instances? If not you will get a HTTP error response (404) when trying to retrieve the user data. Note that the instance's meta-data is always available, even if you do not specify data at instance launch.

8.22.

Is there a way to run a script on instance termination?

Not with any reliability. Amazon EC2 tries to shut an instance down cleanly (in which case normal system shutdown scripts will run), but there is only a short time available for things to happen and in some cases (hardware failure, for example) this does not happen. Since there is no entirely reliable way to ensure shutdown scripts run, it is best to have a strategy in place to deal with abnormal terminations.

8.23.

Why do I get keep getting "Request has expired" errors?

To reduce the risk of replay attacks our requests include a timestamp. This, along with the most important parts of the request, is signed to ensure the message (including the timestamp) can't be modified without detection.

If the difference between the timestamp in the request and the time on our servers is larger than 5 minutes the request is deemed too old (or too new) and an error is returned.

You need to ensure that your system clock is accurate and configured to use the correct timezone. NTP is a good way to do this.

8.24.

How can I allow other people to launch my AMIs?

You can allow other users to launch your AMIs by modifying the AMI's launchPermission attribute. It is possible to either grant public launch permissions, which gives all users permission to launch the AMI, or to only grant launch permissions to specific users.

To grant public launch permissions:

PROMPT> ec2matt ami-5bae4b32 -t launchPermission -a -i group=all

To grant a specific user launch permissions:

PROMPT> ec2matt ami-5bae4b32 -t launchPermission -a -i userId=495219933132

To clear additional launch permissions for an AMI:

PROMPT> ec2ratt ami-5bae4b32 -t launchPermission

8.25.

Can I charge other people for using my AMI?

Not at present.

8.26.

Why do I need to reregister a rebundled AMI? Can't I keep the same AMI ID?

An AMI ID is associated with the physical bits in an image. To protect users from images being modified we require you to reregister AMIs when rebundling.

8.27.

Can I pass JVM properties to the command line tools?

Yes. By setting the environment variable EC2_JVM_ARGS arbitrary JVM properties can be passed to the command line tools.

8.28.

Can I use a proxy with the command line tools?

Yes. By passing in JVM properties via the EC2_JVM_ARGS environment variable, proxy settings can be specified for the command line tools. For example in Linux:

export EC2_JVM_ARGS="-Dhttp.proxyHost=http://my.proxy.com -Dhttp.proxyPort=8080"

The following properties are supported for configuring a proxy:

SettingDescription
https.proxyHostHTTPS proxy host
https.proxyPortHTTPS proxy port
http.proxyHostHTTPS proxy host
http.proxyPortHTTPS proxy port
http.proxyRealmProxy realm (https and http)
http.proxyUserProxy username (https and http)
http.proxyPassProxy password (https and http)

Note:

https.proxyHost should be used when EC2_URL points to an https host, and http.proxyHost when EC2_URL points to an http host.