Skip to content

Commit 48c23be

Browse files
committed
server: allow migration of vm with snapshots for vmware
Fixes #9061 Signed-off-by: Abhishek Kumar <[email protected]>
1 parent 3a0c312 commit 48c23be

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,9 @@ public void setKubernetesServiceHelpers(final List<KubernetesServiceHelper> kube
682682
HypervisorType.XenServer,
683683
HypervisorType.Simulator
684684
));
685+
public static final List<HypervisorType> VM_STORAGE_MIGRATION_WITH_SUPPORTING_SUPPORTING_HYPERVISORS = new ArrayList<>(Arrays.asList(
686+
HypervisorType.VMware
687+
));
685688

686689
protected static final List<HypervisorType> ROOT_DISK_SIZE_OVERRIDE_SUPPORTING_HYPERVISORS = Arrays.asList(
687690
HypervisorType.KVM,
@@ -7221,7 +7224,8 @@ public VirtualMachine migrateVirtualMachineWithVolume(Long vmId, Host destinatio
72217224
throw new InvalidParameterValueException(String.format("Unsupported hypervisor: %s for VM migration, we support XenServer/VMware/KVM only", vm.getHypervisorType()));
72227225
}
72237226

7224-
if (_vmSnapshotDao.findByVm(vmId).size() > 0) {
7227+
if (!VM_STORAGE_MIGRATION_WITH_SUPPORTING_SUPPORTING_HYPERVISORS.contains(vm.getHypervisorType()) &&
7228+
CollectionUtils.isNotEmpty(_vmSnapshotDao.findByVm(vmId))) {
72257229
throw new InvalidParameterValueException("VM with VM Snapshots cannot be migrated with storage, please remove all VM snapshots");
72267230
}
72277231

0 commit comments

Comments
 (0)