Skip to content

Commit c7a5186

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

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
@@ -684,6 +684,9 @@ public void setKubernetesServiceHelpers(final List<KubernetesServiceHelper> kube
684684
HypervisorType.XenServer,
685685
HypervisorType.Simulator
686686
));
687+
public static final List<HypervisorType> VM_STORAGE_MIGRATION_WITH_SUPPORTING_SUPPORTING_HYPERVISORS = new ArrayList<>(Arrays.asList(
688+
HypervisorType.VMware
689+
));
687690

688691
protected static final List<HypervisorType> ROOT_DISK_SIZE_OVERRIDE_SUPPORTING_HYPERVISORS = Arrays.asList(
689692
HypervisorType.KVM,
@@ -7259,7 +7262,8 @@ public VirtualMachine migrateVirtualMachineWithVolume(Long vmId, Host destinatio
72597262
throw new InvalidParameterValueException(String.format("Unsupported hypervisor: %s for VM migration, we support XenServer/VMware/KVM only", vm.getHypervisorType()));
72607263
}
72617264

7262-
if (_vmSnapshotDao.findByVm(vmId).size() > 0) {
7265+
if (!VM_STORAGE_MIGRATION_WITH_SUPPORTING_SUPPORTING_HYPERVISORS.contains(vm.getHypervisorType()) &&
7266+
CollectionUtils.isNotEmpty(_vmSnapshotDao.findByVm(vmId))) {
72637267
throw new InvalidParameterValueException("VM with VM Snapshots cannot be migrated with storage, please remove all VM snapshots");
72647268
}
72657269

0 commit comments

Comments
 (0)