mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 6188: incremental checkin
This commit is contained in:
parent
fe5d825d33
commit
5720ac0e44
@ -47,7 +47,7 @@ public enum Config {
|
||||
|
||||
StorageOverprovisioningFactor("Storage", StoragePoolAllocator.class, String.class, "storage.overprovisioning.factor", "2", "Used for storage overprovisioning calculation; available storage will be (actualStorageSize * storage.overprovisioning.factor)", null),
|
||||
StorageStatsInterval("Storage", ManagementServer.class, String.class, "storage.stats.interval", "60000", "The interval in milliseconds when storage stats (per host) are retrieved from agents.", null),
|
||||
MaxVolumeSize("Storage", ManagementServer.class, Integer.class, "max.volume.size.gb", "2097152000", "The maximum size for a volume in Gb.", null),
|
||||
MaxVolumeSize("Storage", ManagementServer.class, Integer.class, "max.volume.size.gb", "2199023255552", "The maximum size for a volume in bytes (2TB).", null),
|
||||
TotalRetries("Storage", AgentManager.class, Integer.class, "total.retries", "4", "The number of times each command sent to a host should be retried in case of failure.", null),
|
||||
|
||||
// Network
|
||||
|
||||
@ -366,7 +366,7 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
private final int _proxyRamSize;
|
||||
private final int _ssRamSize;
|
||||
|
||||
private final int _maxVolumeSizeInGb;
|
||||
private final long _maxVolumeSizeInTb;
|
||||
private final Map<String, Boolean> _availableIdsMap;
|
||||
|
||||
private boolean _networkGroupsEnabled = false;
|
||||
@ -462,10 +462,10 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
// Parse the max number of UserVMs and public IPs from server-setup.xml,
|
||||
// and set them in the right places
|
||||
|
||||
String maxVolumeSizeInGbString = _configs.get("max.volume.size.gb");
|
||||
int maxVolumeSizeGb = NumbersUtil.parseInt(maxVolumeSizeInGbString, 2097152000);
|
||||
String maxVolumeSizeInTbString = _configs.get("max.volume.size.gb");
|
||||
long maxVolumeSizeTb = NumbersUtil.parseLong(maxVolumeSizeInTbString, new Long("2199023255552"));
|
||||
|
||||
_maxVolumeSizeInGb = maxVolumeSizeGb;
|
||||
_maxVolumeSizeInTb = maxVolumeSizeTb;
|
||||
|
||||
_routerRamSize = NumbersUtil.parseInt(_configs.get("router.ram.size"),NetworkManager.DEFAULT_ROUTER_VM_RAMSIZE);
|
||||
_proxyRamSize = NumbersUtil.parseInt(_configs.get("consoleproxy.ram.size"), ConsoleProxyManager.DEFAULT_PROXY_VM_RAMSIZE);
|
||||
@ -7068,8 +7068,8 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
public DiskOfferingVO createDiskOffering(long userId, long domainId, String name, String description, int numGibibytes, String tags) throws InvalidParameterValueException {
|
||||
if (numGibibytes!=0 && numGibibytes < 1) {
|
||||
throw new InvalidParameterValueException("Please specify a disk size of at least 1 Gb.");
|
||||
} else if (numGibibytes > _maxVolumeSizeInGb) {
|
||||
throw new InvalidParameterValueException("The maximum size for a disk is " + _maxVolumeSizeInGb + " Gb.");
|
||||
} else if (numGibibytes > _maxVolumeSizeInTb) {
|
||||
throw new InvalidParameterValueException("The maximum size for a disk is " + _maxVolumeSizeInTb + " Gb.");
|
||||
}
|
||||
|
||||
return _configMgr.createDiskOffering(userId, domainId, name, description, numGibibytes, tags);
|
||||
@ -8792,10 +8792,10 @@ public class ManagementServerImpl implements ManagementServer {
|
||||
|
||||
@Override
|
||||
public boolean validateCustomVolumeSizeRange(long size) throws InvalidParameterValueException {
|
||||
if (size<0 || (size>0 && size < 1)) {
|
||||
throw new InvalidParameterValueException("Please specify a size of at least 1 Gb.");
|
||||
} else if (size > _maxVolumeSizeInGb) {
|
||||
throw new InvalidParameterValueException("The maximum size allowed is " + _maxVolumeSizeInGb + " Gb.");
|
||||
if (size<0 || (size>0 && size < 2097152)) {
|
||||
throw new InvalidParameterValueException("Please specify a size (in bytes) of at least 2 MB or above.");
|
||||
} else if (size > _maxVolumeSizeInTb) {
|
||||
throw new InvalidParameterValueException("The maximum size allowed is 2 TB");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user