Closed GoogleCodeExporter closed 9 years ago
Well, you never actually fetch the instance state again. You'll keep looking at
the
same state value, which will never change.
Try this;
while (!runInst.getInstances().get(0).isRunning()) {
List<ReservationDescription> tmp = ec2.describeInstances(new String
[] {instanceId});
if (tmp.size() > 0) {
runInst = tmp.get(0);
logger.info("instance state:
"+runInst.getInstances().get(0).getState());
logger.info("public IP =
"+runInst.getInstances().get(0).getIpAddress());
try { Thread.sleep(5000); } catch (InterruptedException ex) {}
}
}
Though, I'd suggest passing your instance ID into the getInstances() call, so
you get
status on only the instance in question.
Original comment by dkavan...@gmail.com
on 23 Mar 2010 at 3:57
Original issue reported on code.google.com by
rufinida...@gmail.com
on 8 Jan 2010 at 9:38Attachments: