mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-7359. Make sure timeout value is set for the MigrateVolumeCommand. This will
make sure the agent waits for the resource to complete (success/failure) migration of volume on the hypervisor.
This commit is contained in:
parent
1c688f40e1
commit
f099732be7
@ -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
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user