Search in sources :

Example 6 with RunVmParams

use of org.ovirt.engine.core.common.action.RunVmParams in project ovirt-engine by oVirt.

the class VmPoolHandler method canRunPoolVm.

private boolean canRunPoolVm(Guid vmId, List<String> messages) {
    VM vm = vmDao.get(vmId);
    if (vm == null) {
        messages.add(EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND.name());
        return false;
    }
    // TODO: This is done to keep consistency with VmDao.getById.
    // It can probably be removed, but that requires some more research
    vmHandler.updateNetworkInterfacesFromDb(vm);
    RunVmParams runVmParams = new RunVmParams(vmId);
    return Injector.injectMembers(new RunVmValidator(vm, runVmParams, false, findActiveISODomain(vm.getStoragePoolId()))).canRunVm(messages, fetchStoragePool(vm.getStoragePoolId()), Collections.emptyList(), Collections.emptyList(), clusterDao.get(vm.getClusterId()), false);
}
Also used : RunVmValidator(org.ovirt.engine.core.bll.validator.RunVmValidator) VM(org.ovirt.engine.core.common.businessentities.VM) RunVmParams(org.ovirt.engine.core.common.action.RunVmParams)

Aggregations

RunVmParams (org.ovirt.engine.core.common.action.RunVmParams)6 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)2 EntityInfo (org.ovirt.engine.core.common.asynctasks.EntityInfo)2 VM (org.ovirt.engine.core.common.businessentities.VM)2 ArrayList (java.util.ArrayList)1 Fault (org.ovirt.engine.api.model.Fault)1 Vm (org.ovirt.engine.api.model.Vm)1 ExecutionContext (org.ovirt.engine.core.bll.job.ExecutionContext)1 RunVmValidator (org.ovirt.engine.core.bll.validator.RunVmValidator)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionType (org.ovirt.engine.core.common.action.ActionType)1 AuditLogDirector (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector)1 AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)1 AuditLogableImpl (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl)1