From 12a013798aae2d9e4ddb2c3d40570f2568d4cc64 Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Wed, 12 Feb 2014 10:41:14 -0700 Subject: [PATCH] CLOUDSTACK-6087: Read max custom disk offering size from database, rather than hard-coded max value of 1024 --- server/src/com/cloud/storage/VolumeManagerImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/storage/VolumeManagerImpl.java b/server/src/com/cloud/storage/VolumeManagerImpl.java index 729539153b8..10d42396be6 100644 --- a/server/src/com/cloud/storage/VolumeManagerImpl.java +++ b/server/src/com/cloud/storage/VolumeManagerImpl.java @@ -328,7 +328,7 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager { @Inject StorageManager storageMgr; private int _customDiskOfferingMinSize = 1; - private final int _customDiskOfferingMaxSize = 1024; + private int _customDiskOfferingMaxSize = 1024; private long _maxVolumeSizeInGb; private boolean _recreateSystemVmEnabled; private boolean _storageHAMigrationEnabled; @@ -2705,6 +2705,10 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager { .parseInt(Config.CustomDiskOfferingMinSize .getDefaultValue())); + String _customDiskOfferingMaxSizeStr = _configDao.getValue(Config.CustomDiskOfferingMaxSize.toString()); + Integer defaultCustomDiskOfferingMaxSize = Integer.parseInt(Config.CustomDiskOfferingMaxSize.getDefaultValue()); + _customDiskOfferingMaxSize = NumbersUtil.parseInt(_customDiskOfferingMaxSizeStr, defaultCustomDiskOfferingMaxSize); + String maxVolumeSizeInGbString = _configDao .getValue("storage.max.volume.size"); _maxVolumeSizeInGb = NumbersUtil.parseLong(maxVolumeSizeInGbString,