mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-1966: Primary Storage Limits are not validated while deploying the VM
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
parent
fad55c5bea
commit
0ddeb65fdf
|
|
@ -2264,9 +2264,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use
|
|||
|
||||
// check if account/domain is with in resource limits to create a new vm
|
||||
boolean isIso = Storage.ImageFormat.ISO == template.getFormat();
|
||||
long size = _templateHostDao.findByTemplateId(template.getId()).getSize();
|
||||
if (diskOfferingId != null) {
|
||||
size += _diskOfferingDao.findById(diskOfferingId).getDiskSize();
|
||||
}
|
||||
resourceLimitCheck(owner, new Long(offering.getCpu()), new Long(offering.getRamSize()));
|
||||
_resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume, (isIso
|
||||
|| diskOfferingId == null ? 1 : 2));
|
||||
_resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, new Long (size));
|
||||
|
||||
// verify security group ids
|
||||
if (securityGroupIdList != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue