Search in sources :

Example 1 with QuotaSanityParameter

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;
}
Also used : QuotaClusterConsumptionParameter(org.ovirt.engine.core.bll.quota.QuotaClusterConsumptionParameter) QuotaSanityParameter(org.ovirt.engine.core.bll.quota.QuotaSanityParameter) ArrayList(java.util.ArrayList) QuotaConsumptionParameter(org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter)

Example 2 with QuotaSanityParameter

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;
}
Also used : QuotaSanityParameter(org.ovirt.engine.core.bll.quota.QuotaSanityParameter) ArrayList(java.util.ArrayList) QuotaConsumptionParameter(org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter)

Example 3 with QuotaSanityParameter

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;
}
Also used : QuotaSanityParameter(org.ovirt.engine.core.bll.quota.QuotaSanityParameter) ArrayList(java.util.ArrayList) QuotaConsumptionParameter(org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter)

Example 4 with QuotaSanityParameter

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;
}
Also used : QuotaSanityParameter(org.ovirt.engine.core.bll.quota.QuotaSanityParameter) ArrayList(java.util.ArrayList) Guid(org.ovirt.engine.core.compat.Guid) QuotaConsumptionParameter(org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter)

Aggregations

ArrayList (java.util.ArrayList)4 QuotaConsumptionParameter (org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter)4 QuotaSanityParameter (org.ovirt.engine.core.bll.quota.QuotaSanityParameter)4 QuotaClusterConsumptionParameter (org.ovirt.engine.core.bll.quota.QuotaClusterConsumptionParameter)1 Guid (org.ovirt.engine.core.compat.Guid)1