Skip to content

Commit f59b699

Browse files
storage: allow VM snapshots without disk for KVM when global setting allows
This removes the conditional logic where comment notest to remove it after PR apache#5297 is merged that is applicable for ACS 4.18+. Only when the global setting is enabled and memory isn't selected, VM snapshot could be allowed for VMs on KVM that have qemu-guest-agent running. Signed-off-by: Rohit Yadav <[email protected]>
1 parent c0128e2 commit f59b699

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/StorageVMSnapshotStrategy.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,6 @@ public StrategyPriority canHandle(VMSnapshot vmSnapshot) {
360360

361361
@Override
362362
public StrategyPriority canHandle(Long vmId, Long rootPoolId, boolean snapshotMemory) {
363-
//This check could be removed when PR #5297 is merged
364-
if (vmHasNFSOrLocalVolumes(vmId)) {
365-
return StrategyPriority.CANT_HANDLE;
366-
}
367363
if (SnapshotManager.VmStorageSnapshotKvm.value() && !snapshotMemory) {
368364
UserVmVO vm = userVmDao.findById(vmId);
369365
if (vm.getState() == VirtualMachine.State.Running) {
@@ -465,17 +461,4 @@ protected CreateSnapshotPayload setPayload(VolumeInfo vol, SnapshotVO snapshotCr
465461
payload.setQuiescevm(false);
466462
return payload;
467463
}
468-
469-
private boolean vmHasNFSOrLocalVolumes(long vmId) {
470-
List<VolumeObjectTO> volumeTOs = vmSnapshotHelper.getVolumeTOList(vmId);
471-
472-
for (VolumeObjectTO volumeTO : volumeTOs) {
473-
Long poolId = volumeTO.getPoolId();
474-
Storage.StoragePoolType poolType = vmSnapshotHelper.getStoragePoolType(poolId);
475-
if (poolType == Storage.StoragePoolType.NetworkFilesystem || poolType == Storage.StoragePoolType.Filesystem) {
476-
return true;
477-
}
478-
}
479-
return false;
480-
}
481464
}

0 commit comments

Comments
 (0)