Enable CPU cap for SSVMs and CPVMs (#6420)

* Enable CPU cap for SSVMs and CPVMs

* Resolve conflicts

Co-authored-by: Joao <JoaoJandre@gitlab.com>
This commit is contained in:
João Jandre 2022-06-24 16:56:29 -03:00 committed by GitHub
parent 6ac14fad1b
commit 8448fe27a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -17,4 +17,9 @@
--;
-- Schema upgrade from 4.17.1.0 to 4.18.0.0
--;
--;
-- Enable CPU cap for default system offerings;
UPDATE `cloud`.`service_offering` so
SET so.limit_cpu_use = 1
WHERE so.default_use = 1 AND so.vm_type IN ('domainrouter', 'secondarystoragevm', 'consoleproxy', 'internalloadbalancervm', 'elasticloadbalancervm');

View File

@ -695,6 +695,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
new ConsoleProxyVO(id, serviceOffering.getId(), name, template.getId(), template.getHypervisorType(), template.getGuestOSId(), dataCenterId,
systemAcct.getDomainId(), systemAcct.getId(), accountManager.getSystemUser().getId(), 0, serviceOffering.isOfferHA());
proxy.setDynamicallyScalable(template.isDynamicallyScalable());
proxy.setLimitCpuUse(serviceOffering.getLimitCpuUse());
proxy = consoleProxyDao.persist(proxy);
try {
virtualMachineManager.allocate(name, template, serviceOffering, networks, plan, null);

View File

@ -631,6 +631,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
new SecondaryStorageVmVO(id, serviceOffering.getId(), name, template.getId(), template.getHypervisorType(), template.getGuestOSId(), dataCenterId,
systemAcct.getDomainId(), systemAcct.getId(), _accountMgr.getSystemUser().getId(), role, serviceOffering.isOfferHA());
secStorageVm.setDynamicallyScalable(template.isDynamicallyScalable());
secStorageVm.setLimitCpuUse(serviceOffering.getLimitCpuUse());
secStorageVm = _secStorageVmDao.persist(secStorageVm);
try {
_itMgr.allocate(name, template, serviceOffering, networks, plan, null);