You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (CollectionUtils.isNotEmpty(vmSnapshotDao.findByVmAndByType(volumeVO.getInstanceId(), VMSnapshot.Type.DiskAndMemory))) {
676
+
logger.debug("DefaultSnapshotStrategy cannot handle snapshot [{}] for volume [{}] as the volume is attached to a VM with disk-and-memory VM snapshots." +
677
+
"Restoring the volume snapshot will corrupt any newer disk-and-memory VM snapshots.", snapshot);
Copy file name to clipboardExpand all lines: engine/storage/snapshot/src/main/java/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java
StringcantHandleLog = String.format("Default VM snapshot cannot handle VM snapshot for [%s]", vm);
482
494
if (State.Running.equals(vm.getState()) && !snapshotMemory) {
483
-
logger.debug("Default VM snapshot strategy cannot handle VM snapshot for [{}] as it is running and its memory will not be affected.", vm);
495
+
logger.debug("{} as it is running and its memory will not be affected.", cantHandleLog, vm);
484
496
returnStrategyPriority.CANT_HANDLE;
485
497
}
486
498
487
499
if (vmHasKvmDiskOnlySnapshot(vm)) {
488
-
logger.debug("Default VM snapshot strategy cannot handle VM snapshot for [{}] as it has a disk-only VM snapshot using kvmFileBasedStorageSnapshot strategy." +
489
-
"These two strategies are not compatible, as reverting a disk-only VM snapshot will erase newer disk-and-memory VM snapshots.", vm);
500
+
logger.debug("{} as it is not compatible with disk-only VM snapshot on KVM. As disk-and-memory snapshots use internal snapshots and disk-only VM snapshots use" +
501
+
" external snapshots. When restoring external snapshots, any newer internal snapshots are lost.", cantHandleLog);
logger.debug("Default VM snapshot strategy cannot handle VM snapshot for [{}] as it has a volume [{}] that is not in the QCOW2 format.", vm, volume);
508
+
logger.debug("{} as it has a volume [{}] that is not in the QCOW2 format.", cantHandleLog, vm, volume);
509
+
returnStrategyPriority.CANT_HANDLE;
510
+
}
511
+
512
+
if (CollectionUtils.isNotEmpty(snapshotDao.listByVolumeIdAndTypeNotInAndStateNotRemoved(volume.getId(), Snapshot.Type.GROUP))) {
513
+
logger.debug("{} as it has a volume [{}] with volume snapshots. As disk-and-memory snapshots use internal snapshots and volume snapshots use external" +
514
+
" snapshots. When restoring external snapshots, any newer internal snapshots are lost.", cantHandleLog, volume);
Copy file name to clipboardExpand all lines: engine/storage/snapshot/src/test/java/org/apache/cloudstack/storage/vmsnapshot/VMSnapshotStrategyKVMTest.java
Copy file name to clipboardExpand all lines: engine/storage/snapshot/src/test/java/org/apache/cloudstack/storage/vmsnapshot/VMSnapshotStrategyTest.java
thrownewCloudRuntimeException("No valid backup repository found for the VM, please check the attached backup offering");
166
167
}
167
168
169
+
if (CollectionUtils.isNotEmpty(vmSnapshotDao.findByVmAndByType(vm.getId(), VMSnapshot.Type.DiskAndMemory))) {
170
+
logger.debug("NAS backup provider cannot take backups of a VM [{}] with disk-and-memory VM snapshots. Restoring the backup will corrupt any newer disk-and-memory " +
171
+
"VM snapshots.", vm);
172
+
thrownewCloudRuntimeException(String.format("Cannot take backup of VM [%s] as it has disk-and-memory VM snapshots.", vm.getUuid()));
0 commit comments