Wednesday, December 7, 2011

Don't reboot me, bro!

If you are an AWS user with EC2 instances running, you may have already gotten an email from AWS informing you that your instance(s) will be rebooted in the near future.  I'm not exactly sure what is prompting this massive rebooting binge but the good folks at AWS have actually provided a new EC2 API request just so you can find out about upcoming maintenance events planned for your instances.

We just committed code to boto that adds support for the new DescribeInstanceStatus request.  Using this, you can programmatically query the status of any or all of your EC2 instances and find out if there is a reboot in their future and, if so, when to expect it.

Here's an example of using the new method and accessing the data returned by it.


  1. My theory is someone found a security bug that let a VM user to read/write/donastystuff on the host itself of other VM in the same server.
    This bug had not been made public yet.
    Maybe who discovered that bug received a good reward from AWS :)

  2. I put together a simple CLI script that will list the scheduled events for one or all regions and can include instance tags as well.

  3. Nice little script. I just tweeted about it. Thanks for sharing it!

  4. Hi, I'm having a bit of a problem. Using boto and querying AWS for these reboot things, we seem to get less results back than Amazon'sown tools give us back. The result is that for the last week we've been working off a very long list of server whereby we're almost at the end and new ones are suddenly appearing.

    AWS support say this is boto faults. Any thoughts? I've just been testing for example and using boto I have 54 outstanding events of instance-reboot not in a "Completed" state. When I use the ec2 tools from Amazon I have 64?

  5. In fact, one other thing I've noticed is that I always get a round 1000 as the length of the list back and I have more than that number of instances.

  6. EC2 is paging the results, providing a max of 1000 in each request. Boto is not currently exporting a way to retrieve the next page of results. I have created an issue for this ( and will try to have a fix out today. Thanks!