fix unwanted kvm root volume migration (#8908)

This commit is contained in:
João Jandre 2024-06-12 07:41:09 -03:00 committed by GitHub
parent 3fe2b46dd0
commit 3b8d2202dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}
/**