Skip to content

Commit 878350e

Browse files
João JandreJoaoJandre
authored andcommitted
add verification
1 parent 7d2e48a commit 878350e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6641,6 +6641,7 @@ public VirtualMachine vmStorageMigration(Long vmId, StoragePool destPool) {
66416641
Long destPoolPodId = ScopeType.CLUSTER.equals(destinationPoolVo.getScope()) || ScopeType.HOST.equals(destinationPoolVo.getScope()) ?
66426642
destinationPoolVo.getPodId() : null;
66436643
for (VolumeVO volume : volumes) {
6644+
snapshotHelper.checkKvmVolumeSnapshotsOnlyInPrimaryStorage(volume, vm.getHypervisorType());
66446645
if (!VirtualMachine.Type.User.equals(vm.getType())) {
66456646
// Migrate within same pod as source storage and same cluster for all disks only. Hypervisor check already done
66466647
StoragePoolVO pool = _storagePoolDao.findById(volume.getPoolId());
@@ -6662,7 +6663,8 @@ public VirtualMachine vmStorageMigration(Long vmId, Map<String, String> volumeTo
66626663
Map<Long, Long> volumeToPoolIds = new HashMap<>();
66636664
Long poolClusterId = null;
66646665
for (Map.Entry<String, String> entry : volumeToPool.entrySet()) {
6665-
Volume volume = _volsDao.findByUuid(entry.getKey());
6666+
VolumeVO volume = _volsDao.findByUuid(entry.getKey());
6667+
snapshotHelper.checkKvmVolumeSnapshotsOnlyInPrimaryStorage(volume, vm.getHypervisorType());
66666668
StoragePoolVO pool = _storagePoolDao.findPoolByUUID(entry.getValue());
66676669
if (poolClusterId != null &&
66686670
(ScopeType.CLUSTER.equals(pool.getScope()) || ScopeType.HOST.equals(pool.getScope())) &&

0 commit comments

Comments
 (0)