diff --git a/core/src/com/cloud/agent/AgentManager.java b/core/src/com/cloud/agent/AgentManager.java index c87c193b2df..d6c40f541d2 100755 --- a/core/src/com/cloud/agent/AgentManager.java +++ b/core/src/com/cloud/agent/AgentManager.java @@ -210,4 +210,6 @@ public interface AgentManager extends Manager { public boolean reconnect(final long hostId) throws AgentUnavailableException; public List discoverHosts(long dcId, Long podId, Long clusterId, URI url, String username, String password) throws DiscoveryException; + + Answer easySend(Long hostId, Command cmd, int timeout); } diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 55495c60daf..2aeeb1cfbfc 100644 --- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -5744,7 +5744,7 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR checksum = ""; } - String result = callHostPluginWithTimeOut("post_create_private_template", 1800, "remoteTemplateMountPath", remoteTemplateMountPath, "templateDownloadFolder", templateDownloadFolder, + String result = callHostPluginWithTimeOut("post_create_private_template", 110*60, "remoteTemplateMountPath", remoteTemplateMountPath, "templateDownloadFolder", templateDownloadFolder, "templateInstallFolder", templateInstallFolder, "templateFilename", templateFilename, "templateName", templateName, "templateDescription", templateDescription, "checksum", checksum, "virtualSize", String.valueOf(virtualSize), "templateId", String.valueOf(templateId)); @@ -5782,7 +5782,7 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR // Each argument is put in a separate line for readability. // Using more lines does not harm the environment. - String results = callHostPluginWithTimeOut("backupSnapshot", 1800, "primaryStorageSRUuid", primaryStorageSRUuid, "dcId", dcId.toString(), "accountId", accountId.toString(), "volumeId", + String results = callHostPluginWithTimeOut("backupSnapshot", 110*60, "primaryStorageSRUuid", primaryStorageSRUuid, "dcId", dcId.toString(), "accountId", accountId.toString(), "volumeId", volumeId.toString(), "secondaryStorageMountPath", secondaryStorageMountPath, "snapshotUuid", snapshotUuid, "prevSnapshotUuid", prevSnapshotUuid, "prevBackupUuid", prevBackupUuid, "isFirstSnapshotOfRootVolume", isFirstSnapshotOfRootVolume.toString(), "isISCSI", isISCSI.toString()); @@ -5885,7 +5885,7 @@ public abstract class CitrixResourceBase implements StoragePoolResource, ServerR String failureString = "Could not create volume from " + backedUpSnapshotUuid; templatePath = (templatePath == null) ? "" : templatePath; - String results = callHostPluginWithTimeOut("createVolumeFromSnapshot", 1800, "dcId", dcId.toString(), "accountId", accountId.toString(), "volumeId", volumeId.toString(), + String results = callHostPluginWithTimeOut("createVolumeFromSnapshot", 110*60, "dcId", dcId.toString(), "accountId", accountId.toString(), "volumeId", volumeId.toString(), "secondaryStorageMountPath", secondaryStorageMountPath, "backedUpSnapshotUuid", backedUpSnapshotUuid, "templatePath", templatePath, "templateDownloadFolder", templateDownloadFolder, "isISCSI", isISCSI.toString()); diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index 67bedf671e5..075ffa45d2d 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -1114,11 +1114,16 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory { } } } + + @Override + public Answer easySend(final Long hostId, final Command cmd) { + return easySend(hostId, cmd, _wait); + } @Override - public Answer easySend(final Long hostId, final Command cmd) { + public Answer easySend(final Long hostId, final Command cmd, int timeout) { try { - final Answer answer = send(hostId, cmd, _wait); + final Answer answer = send(hostId, cmd, timeout); if (answer == null) { s_logger.warn("send returns null answer"); return null; diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 10cd836b310..0e7b48450aa 100644 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -1654,7 +1654,8 @@ public class StorageManagerImpl implements StorageManager { } } s_logger.debug("Trying to execute Command: " + cmd + " on host: " + hostId + " try: " + tryCount); - answer = _agentMgr.send(hostId, cmd); + // set 120 min timeout for storage related command + answer = _agentMgr.send(hostId, cmd, 120*60*1000); if (answer != null && answer.getResult()) { return answer; diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index 10517880140..f4ec7d530e7 100644 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -231,7 +231,8 @@ public class TemplateManagerImpl implements TemplateManager { s_logger.debug("Downloading " + templateId + " via " + vo.getHostId()); } dcmd.setLocalPath(vo.getLocalPath()); - DownloadAnswer answer = (DownloadAnswer)_agentMgr.easySend(vo.getHostId(), dcmd); + // set 120 min timeout for this command + DownloadAnswer answer = (DownloadAnswer)_agentMgr.easySend(vo.getHostId(), dcmd, 120*60*1000); if (answer != null) { templateStoragePoolRef.setDownloadPercent(templateStoragePoolRef.getDownloadPercent()); templateStoragePoolRef.setDownloadState(answer.getDownloadStatus());