bug CS-15859: put a check on volume limit

Author: Abhinandan Prateek <aprateek@apache.org>
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
Abhinandan Prateek 2012-08-07 10:47:54 +05:30
parent d968193c80
commit 0a2b6436dd

View File

@ -3367,6 +3367,9 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
//VV 2: check if account/domain is with in resource limits to create a new vm
_resourceLimitMgr.checkResourceLimit(newAccount, ResourceType.user_vm);
//VV 3: check if volumes are with in resource limits
_resourceLimitMgr.checkResourceLimit(newAccount, ResourceType.volume, _volsDao.findByInstance(cmd.getVmId()).size());
// VV 4: Check if new owner can use the vm template
VirtualMachineTemplate template = _templateDao.findById(vm.getTemplateId());
if (!template.isPublicTemplate()) {