diff --git a/core/src/com/cloud/agent/api/storage/MigrateVolumeCommand.java b/core/src/com/cloud/agent/api/storage/MigrateVolumeCommand.java index 85f0bf4b023..e5ba2117810 100644 --- a/core/src/com/cloud/agent/api/storage/MigrateVolumeCommand.java +++ b/core/src/com/cloud/agent/api/storage/MigrateVolumeCommand.java @@ -30,17 +30,19 @@ public class MigrateVolumeCommand extends Command { StorageFilerTO pool; String attachedVmName; - public MigrateVolumeCommand(long volumeId, String volumePath, StoragePool pool) { + public MigrateVolumeCommand(long volumeId, String volumePath, StoragePool pool, int timeout) { this.volumeId = volumeId; this.volumePath = volumePath; this.pool = new StorageFilerTO(pool); + this.setWait(timeout); } - public MigrateVolumeCommand(long volumeId, String volumePath, StoragePool pool, String attachedVmName) { + public MigrateVolumeCommand(long volumeId, String volumePath, StoragePool pool, String attachedVmName, int timeout) { this.volumeId = volumeId; this.volumePath = volumePath; this.pool = new StorageFilerTO(pool); this.attachedVmName = attachedVmName; + this.setWait(timeout); } @Override diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java index 415a0772df1..5b01f95eef1 100644 --- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java +++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java @@ -370,9 +370,12 @@ public class AncientDataMotionStrategy implements DataMotionStrategy { } protected Answer migrateVolumeToPool(DataObject srcData, DataObject destData) { + String value = configDao.getValue(Config.MigrateWait.key()); + int waitInterval = NumbersUtil.parseInt(value, Integer.parseInt(Config.MigrateWait.getDefaultValue())); + VolumeInfo volume = (VolumeInfo)srcData; StoragePool destPool = (StoragePool)dataStoreMgr.getDataStore(destData.getDataStore().getId(), DataStoreRole.Primary); - MigrateVolumeCommand command = new MigrateVolumeCommand(volume.getId(), volume.getPath(), destPool, volume.getAttachedVmName()); + MigrateVolumeCommand command = new MigrateVolumeCommand(volume.getId(), volume.getPath(), destPool, volume.getAttachedVmName(), waitInterval); EndPoint ep = selector.select(srcData, StorageAction.MIGRATEVOLUME); Answer answer = null; if (ep == null) {