FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

storage: allow VM snapshots without memory for KVM when global setting allows by yadvr · Pull Request #8062 · apache/cloudstack · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import com.cloud.storage.GuestOSVO;
import com.cloud.storage.Snapshot;
import com.cloud.storage.SnapshotVO;
import com.cloud.storage.Storage;
import com.cloud.storage.VolumeApiService;
import com.cloud.storage.VolumeVO;
import com.cloud.storage.dao.SnapshotDao;
Expand Down Expand Up @@ -360,10 +359,6 @@ public StrategyPriority canHandle(VMSnapshot vmSnapshot) {

@Override
public StrategyPriority canHandle(Long vmId, Long rootPoolId, boolean snapshotMemory) {
//This check could be removed when PR #5297 is merged
if (vmHasNFSOrLocalVolumes(vmId)) {
return StrategyPriority.CANT_HANDLE;
}
if (SnapshotManager.VmStorageSnapshotKvm.value() && !snapshotMemory) {
UserVmVO vm = userVmDao.findById(vmId);
if (vm.getState() == VirtualMachine.State.Running) {
Expand Down Expand Up @@ -465,17 +460,4 @@ protected CreateSnapshotPayload setPayload(VolumeInfo vol, SnapshotVO snapshotCr
payload.setQuiescevm(false);
return payload;
}

private boolean vmHasNFSOrLocalVolumes(long vmId) {
List<VolumeObjectTO> volumeTOs = vmSnapshotHelper.getVolumeTOList(vmId);

for (VolumeObjectTO volumeTO : volumeTOs) {
Long poolId = volumeTO.getPoolId();
Storage.StoragePoolType poolType = vmSnapshotHelper.getStoragePoolType(poolId);
if (poolType == Storage.StoragePoolType.NetworkFilesystem || poolType == Storage.StoragePoolType.Filesystem) {
return true;
}
}
return false;
}
}

Back | FazBrowse Home | New Git URL