use of org.ovirt.engine.core.bll.quota.QuotaSanityParameter in project ovirt-engine by oVirt.
the class UpdateVmCommand method getQuotaVdsConsumptionParameters.
@Override
public List<QuotaConsumptionParameter> getQuotaVdsConsumptionParameters() {
List<QuotaConsumptionParameter> list = new ArrayList<>();
// The cases must be persistent with the create_functions_sp
if (!getQuotaManager().isVmStatusQuotaCountable(getVm().getStatus())) {
list.add(new QuotaSanityParameter(getQuotaId(), null));
quotaSanityOnly = true;
} else {
if (!getQuotaId().equals(getVm().getQuotaId())) {
list.add(new QuotaClusterConsumptionParameter(getVm().getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.RELEASE, getClusterId(), getVm().getNumOfCpus(), getVm().getMemSizeMb()));
list.add(new QuotaClusterConsumptionParameter(getQuotaId(), null, QuotaConsumptionParameter.QuotaAction.CONSUME, getParameters().getVmStaticData().getClusterId(), getParameters().getVmStaticData().getNumOfCpus(), getParameters().getVmStaticData().getMemSizeMb()));
}
}
return list;
}
use of org.ovirt.engine.core.bll.quota.QuotaSanityParameter in project ovirt-engine by oVirt.
the class UpdateVmTemplateCommand method getQuotaVdsConsumptionParameters.
@Override
public List<QuotaConsumptionParameter> getQuotaVdsConsumptionParameters() {
List<QuotaConsumptionParameter> list = new ArrayList<>();
list.add(new QuotaSanityParameter(getParameters().getVmTemplateData().getQuotaId(), null));
return list;
}
use of org.ovirt.engine.core.bll.quota.QuotaSanityParameter in project ovirt-engine by oVirt.
the class AddVmCommand method getQuotaVdsConsumptionParameters.
@Override
public List<QuotaConsumptionParameter> getQuotaVdsConsumptionParameters() {
List<QuotaConsumptionParameter> list = new ArrayList<>();
list.add(new QuotaSanityParameter(getQuotaId(), null));
return list;
}
use of org.ovirt.engine.core.bll.quota.QuotaSanityParameter in project ovirt-engine by oVirt.
the class AddVmTemplateCommand method getQuotaVdsConsumptionParameters.
@Override
public List<QuotaConsumptionParameter> getQuotaVdsConsumptionParameters() {
Guid quotaId = getQuotaManager().getDefaultQuotaIfNull(getParameters().getMasterVm().getQuotaId(), getStoragePoolId());
List<QuotaConsumptionParameter> list = new ArrayList<>();
list.add(new QuotaSanityParameter(quotaId, null));
return list;
}
Aggregations