when start vm times out, check VM status, if it is running , return succeed.

change XAPI timeout to 60 second.
This commit is contained in:
Anthony Xu 2014-03-24 17:15:08 -07:00
parent 726dd16daa
commit d14f66f58d
2 changed files with 10 additions and 2 deletions

View File

@ -3493,10 +3493,18 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
checkForSuccess(conn, task);
} catch (Types.HandleInvalid e) {
if (vm.getPowerState(conn) == Types.VmPowerState.RUNNING) {
s_logger.debug("VM " + vmName + " is in Running status");
task = null;
return;
}
throw new CloudRuntimeException("Shutdown VM catch HandleInvalid and VM is not in RUNNING state");
throw new CloudRuntimeException("Start VM " + vmName + " catch HandleInvalid and VM is not in RUNNING state");
} catch (Types.BadAsyncResult e) {
if (vm.getPowerState(conn) == Types.VmPowerState.RUNNING) {
s_logger.debug("VM " + vmName + " is in Running status");
task = null;
return;
}
throw new CloudRuntimeException("Start VM " + vmName + " catch BadAsyncResult and VM is not in RUNNING state");
}
} catch (XenAPIException e) {
String msg = "Unable to start VM(" + vmName + ") on host(" + _host.uuid + ") due to " + e.toString();

View File

@ -683,7 +683,7 @@ public enum Config {
null),
StorageCleanupEnabled("Advanced", StorageManager.class, Boolean.class, "storage.cleanup.enabled", "true", "Enables/disables the storage cleanup thread.", null),
UpdateWait("Advanced", AgentManager.class, Integer.class, "update.wait", "600", "Time to wait (in seconds) before alerting on a updating agent", null),
XapiWait("Advanced", AgentManager.class, Integer.class, "xapiwait", "600", "Time (in seconds) to wait for XAPI to return", null),
XapiWait("Advanced", AgentManager.class, Integer.class, "xapiwait", "60", "Time (in seconds) to wait for XAPI to return", null),
MigrateWait("Advanced", AgentManager.class, Integer.class, "migratewait", "3600", "Time (in seconds) to wait for VM migrate finish", null),
HAWorkers("Advanced", AgentManager.class, Integer.class, "ha.workers", "5", "Number of ha worker threads.", null),
MountParent(