Skip to content

Commit efe47b0

Browse files
anshulgangwarrajesh-battala
authored andcommitted
CLOUDSTACK-7541: Added restriction to not allow custom disk offering with disksize UI doesn't allow but with API we were able to create custom disk offering with disk size which was causing this issue
This closes #28
1 parent e8a4759 commit efe47b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/src/com/cloud/configuration/ConfigurationManagerImpl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
import javax.inject.Inject;
3838
import javax.naming.ConfigurationException;
3939

40+
import org.apache.log4j.Logger;
41+
4042
import org.apache.cloudstack.acl.SecurityChecker;
4143
import org.apache.cloudstack.affinity.AffinityGroup;
4244
import org.apache.cloudstack.affinity.AffinityGroupService;
@@ -84,7 +86,6 @@
8486
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
8587
import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao;
8688
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
87-
import org.apache.log4j.Logger;
8889

8990
import com.cloud.alert.AlertManager;
9091
import com.cloud.api.ApiDBUtils;
@@ -2347,6 +2348,10 @@ public DiskOffering createDiskOffering(CreateDiskOfferingCmd cmd) {
23472348
throw new InvalidParameterValueException("Disksize is required for a non-customized disk offering");
23482349
}
23492350

2351+
if (isCustomized && numGibibytes != null) {
2352+
throw new InvalidParameterValueException("Disksize is not allowed for a customized disk offering");
2353+
}
2354+
23502355
boolean localStorageRequired = false;
23512356
String storageType = cmd.getStorageType();
23522357
if (storageType != null) {

0 commit comments

Comments
 (0)