Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public interface SnapshotManager extends Configurable {
public static final ConfigKey<Boolean> 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<Boolean> 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<Boolean> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment thread
sudo87 marked this conversation as resolved.
Long vmId = volume.getInstanceId();
if (vmId != null) {
VMInstanceVO vm = _vmDao.findById(vmId);
Expand Down Expand Up @@ -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.");
}
}
}
Expand Down
Loading