Question

In AWS console, in the EC2 panel, when you reboot an instance (through the console), the state column changes from "running" to "rebooting" and then back to "running" after reboot finishes.

In Amazon EC2 API, there is not such state "rebooting". The only available options are "running", "pending", "stopped", "stopping", "shutting-down" and "terminated". The API to check instance's status retunrs "status:ok" while rebooting as well.

How can I know, using the API, that an instance that started the rebooting finished and is running normally again? There must be some information that I can check during reboot state knowing that a reboot was launched.

Thanks in advance,

Was it helpful?

Solution 2

Thanks everybody for the suggestions. I finally "reversed engineered" AWS console javascript code and he it is:

> AWS.ioc.Configuration.getInstance("/ec2/instances/rebootInstances#controller").subscribe("changed",
> function() { var o =
> m.dataTable.getRecords(m.dataTable.getSelectedRows());
> m.dataTable.setColumn(o, "instanceState", "rebooting");
> i.rebooting.fire(o); YAHOO.lang.later(60000, m.dataTable, function(p,
> q, r) {
>                  m.dataTable.setColumn(p, q, r);
>                  i.rebooted.fire(p)
>                  }, [o, "instanceState", "running"], false) });

As can be seen, it's just a timeout of 60 seconds (60000 ms)...

OTHER TIPS

I think the general gist you are getting from the comments is that just because an instance has rebooted, doesn't mean it booted in a clean state such that it is ready to perform work.

So, you really should have some sort of health monitor or sanity check that occurs on start-up that would indicate that your application is actually running properly (or ready to run). You could then query this monitor to determine if things are running as expected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top