Allow multiple Volumes to be migrated with migrateVirtualMachineWithVolume API

This commit is contained in:
Harikrishna Patnala 2023-05-31 17:09:21 +05:30
parent 0b30884e37
commit 2443a17b00
1 changed files with 0 additions and 10 deletions

View File

@ -6270,16 +6270,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
+ " hypervisors: [%s].", hypervisorType, HYPERVISORS_THAT_CAN_DO_STORAGE_MIGRATION_ON_NON_USER_VMS));
}
List<VolumeVO> vols = _volsDao.findByInstance(vm.getId());
if (vols.size() > 1) {
// OffLineVmwareMigration: data disks are not permitted, here!
if (vols.size() > 1 &&
// OffLineVmwareMigration: allow multiple disks for vmware
!HypervisorType.VMware.equals(hypervisorType)) {
throw new InvalidParameterValueException("Data disks attached to the vm, can not migrate. Need to detach data disks first");
}
}
// Check that Vm does not have VM Snapshots
if (_vmSnapshotDao.findByVm(vmId).size() > 0) {
throw new InvalidParameterValueException("VM's disk cannot be migrated, please remove all the VM Snapshots for this VM");