mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
fix unwanted kvm root volume migration (#8908)
This commit is contained in:
parent
3fe2b46dd0
commit
3b8d2202dc
@ -3007,7 +3007,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
||||
executeManagedStorageChecksWhenTargetStoragePoolNotProvided(targetHost, currentPool, volume);
|
||||
if (ScopeType.HOST.equals(currentPool.getScope()) || isStorageCrossClusterMigration(plan.getClusterId(), currentPool)) {
|
||||
createVolumeToStoragePoolMappingIfPossible(profile, plan, volumeToPoolObjectMap, volume, currentPool);
|
||||
} else if (shouldMapVolume(profile, volume, currentPool)){
|
||||
} else if (shouldMapVolume(profile, currentPool)){
|
||||
volumeToPoolObjectMap.put(volume, currentPool);
|
||||
}
|
||||
}
|
||||
@ -3019,11 +3019,10 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
||||
* Some context: VMware migration workflow requires all volumes to be mapped (even if volume stays on its current pool);
|
||||
* however, this is not necessary/desirable for the KVM flow.
|
||||
*/
|
||||
protected boolean shouldMapVolume(VirtualMachineProfile profile, Volume volume, StoragePoolVO currentPool) {
|
||||
protected boolean shouldMapVolume(VirtualMachineProfile profile, StoragePoolVO currentPool) {
|
||||
boolean isManaged = currentPool.isManaged();
|
||||
boolean isNotKvm = HypervisorType.KVM != profile.getHypervisorType();
|
||||
boolean isNotDatadisk = Type.DATADISK != volume.getVolumeType();
|
||||
return isNotKvm || isNotDatadisk || isManaged;
|
||||
return isNotKvm || isManaged;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user