diff --git a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java index 10dcc2683de8..6fcf124a961d 100644 --- a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java +++ b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManager.java @@ -56,7 +56,7 @@ public interface SnapshotManager extends Configurable { public static final ConfigKey VmStorageSnapshotKvm = new ConfigKey<>(Boolean.class, "kvm.vmstoragesnapshot.enabled", "Snapshots", "true", "For live snapshot of virtual machine instance on KVM hypervisor without memory. Requires qemu version 1.6+ (on NFS or Local file system) and qemu-guest-agent installed on guest VM", true, ConfigKey.Scope.Global, null); ConfigKey KVMSnapshotEnabled = new ConfigKey<>(Boolean.class, "kvm.snapshot.enabled", "Snapshots", "true", "Whether volume snapshot is enabled on running instances " + - "on a KVM hosts", false, ConfigKey.Scope.Global, null); + "on KVM hosts", false, ConfigKey.Scope.Global, null); ConfigKey kvmIncrementalSnapshot = new ConfigKey<>(Boolean.class, "kvm.incremental.snapshot", "Snapshots", "false", "Whether differential snapshots are enabled for" + " KVM or not. When this is enabled, all KVM snapshots will be incremental. Bear in mind that it will generate a new full snapshot when the snapshot chain reaches the limit defined in snapshot.delta.max.", true, ConfigKey.Scope.Cluster, null); diff --git a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java index dc33a4442a33..2d23e22a0152 100755 --- a/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -1528,13 +1528,13 @@ private Type getSnapshotType(IntervalType intvType) { return null; } - private boolean hostSupportsSnapsthotForVolume(HostVO host, VolumeInfo volume, boolean isFromVmSnapshot) { + private boolean hostSupportsSnapshotForVolume(HostVO host, VolumeInfo volume, boolean isFromVmSnapshot) { if (host.getHypervisorType() != HypervisorType.KVM) { return true; } - //Turn off snapshot by default for KVM if the volume attached to vm that is not in the Stopped/Destroyed state, - //unless it is set in the global flag + // For KVM, snapshots of a volume attached to a vm that is not in the Stopped/Destroyed state are allowed + // unless the global flag kvm.snapshot.enabled is turned off (it is enabled by default since 4.22.0.0) Long vmId = volume.getInstanceId(); if (vmId != null) { VMInstanceVO vm = _vmDao.findById(vmId); @@ -1585,9 +1585,12 @@ private boolean supportedByHypervisor(VolumeInfo volume, boolean isFromVmSnapsho } if (hosts != null && !hosts.isEmpty()) { HostVO host = hosts.get(0); - if (!hostSupportsSnapsthotForVolume(host, volume, isFromVmSnapshot)) { + if (!hostSupportsSnapshotForVolume(host, volume, isFromVmSnapshot)) { throw new CloudRuntimeException( - "KVM Snapshot is not supported for Running VMs. It is disabled by default due to a possible volume corruption in certain cases. To enable it set global settings kvm.snapshot.enabled to True. See the documentation for more details."); + "KVM Snapshot is not supported for Running VMs because the global setting " + + "kvm.snapshot.enabled is set to false for this deployment. It can be disabled to " + + "avoid a possible volume corruption in certain cases. To allow snapshots of running " + + "VMs, set kvm.snapshot.enabled to true. See the documentation for more details."); } } }