public function getInstanceIsRunning()
{
// what are we doing?
$log = usingLog()->startAction("determine if EC2 VM '{$this->instanceName}' is running");
// does the instance exist?
if (!$this->instance) {
$log->endAction("no: instance does not exist");
return false;
}
// is the instance running?
if ($this->instance['State']['Code'] == 16) {
// yes, it is
$log->endAction("yes");
return true;
} else {
// no, it is not
$log->endAction("no: state is '{$this->instance['State']['Name']}'");
return false;
}
}