Skip to content

Commit 7cb7042

Browse files
change vmsnapshotmax config scope
1 parent 4cdcde2 commit 7cb7042

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

engine/components-api/src/main/java/com/cloud/vm/snapshot/VMSnapshotManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public interface VMSnapshotManager extends VMSnapshotService, Manager {
3131
static final ConfigKey<Integer> VMSnapshotExpireInterval = new ConfigKey<Integer>("Advanced", Integer.class, "vmsnapshot.expire.interval", "-1",
3232
"VM Snapshot expire interval in hours", true, ConfigKey.Scope.Account);
3333

34-
ConfigKey<Integer> VMSnapshotMax = new ConfigKey<Integer>("Advanced", Integer.class, "vmsnapshot.max", "10", "Maximum vm snapshots for a single vm", true, ConfigKey.Scope.Global);
34+
ConfigKey<Integer> VMSnapshotMax = new ConfigKey<Integer>("Advanced", Integer.class, "vmsnapshot.max", "10", "Maximum vm snapshots for a single vm", true, ConfigKey.Scope.Account);
3535

3636
/**
3737
* Delete all VM snapshots belonging to one VM

server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ public VMSnapshot allocVMSnapshot(Long vmId, String vsDisplayName, String vsDesc
400400
_accountMgr.checkAccess(caller, null, true, userVmVo);
401401

402402
// check max snapshot limit for per VM
403-
int vmSnapshotMax = VMSnapshotManager.VMSnapshotMax.value();
403+
int vmSnapshotMax = VMSnapshotManager.VMSnapshotMax.valueIn(userVmVo.getAccountId());
404404

405405
if (_vmSnapshotDao.findByVm(vmId).size() >= vmSnapshotMax) {
406406
throw new CloudRuntimeException("Creating vm snapshot failed due to a VM can just have : " + vmSnapshotMax + " VM snapshots. Please delete old ones");

0 commit comments

Comments
 (0)