Skip to content

Commit 7f5a52b

Browse files
storage: allow VM snapshots without memory for KVM when global setting allows (apache#8062)
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]> (cherry picked from commit 8350ce5) Signed-off-by: Rohit Yadav <[email protected]> (cherry picked from commit 349f046) Signed-off-by: Rohit Yadav <[email protected]>
1 parent a4faaae commit 7f5a52b

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
import com.cloud.storage.GuestOSVO;
6060
import com.cloud.storage.Snapshot;
6161
import com.cloud.storage.SnapshotVO;
62-
import com.cloud.storage.Storage;
6362
import com.cloud.storage.VolumeApiService;
6463
import com.cloud.storage.VolumeVO;
6564
import com.cloud.storage.dao.SnapshotDao;
@@ -360,10 +359,6 @@ public StrategyPriority canHandle(VMSnapshot vmSnapshot) {
360359

361360
@Override
362361
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-
}
367362
if (SnapshotManager.VmStorageSnapshotKvm.value() && !snapshotMemory) {
368363
UserVmVO vm = userVmDao.findById(vmId);
369364
if (vm.getState() == VirtualMachine.State.Running) {
@@ -465,17 +460,4 @@ protected CreateSnapshotPayload setPayload(VolumeInfo vol, SnapshotVO snapshotCr
465460
payload.setQuiescevm(false);
466461
return payload;
467462
}
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-
}
481463
}

0 commit comments

Comments
 (0)