Search in sources :

Example 1 with VmNumaNodeOperationParameters

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

the class UpdateVmCommand method updateVmNumaNodes.

private void updateVmNumaNodes() {
    if (!getParameters().isUpdateNuma()) {
        return;
    }
    List<VmNumaNode> newList = getParameters().getVmStaticData().getvNumaNodeList();
    VmNumaNodeOperationParameters params = new VmNumaNodeOperationParameters(getParameters().getVm(), new ArrayList<>(newList));
    addLogMessages(backend.runInternalAction(ActionType.SetVmNumaNodes, params));
}
Also used : VmNumaNodeOperationParameters(org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters) VmNumaNode(org.ovirt.engine.core.common.businessentities.VmNumaNode)

Example 2 with VmNumaNodeOperationParameters

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

the class BackendVmNumaNodeResource method getRemoveParameters.

private ActionParametersBase getRemoveParameters() {
    VmNumaNode entity = new VmNumaNode();
    entity.setId(guid);
    VmNumaNodeOperationParameters parameters = new VmNumaNodeOperationParameters(collection.parentId, entity);
    return parameters;
}
Also used : VmNumaNodeOperationParameters(org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters) VmNumaNode(org.ovirt.engine.core.common.businessentities.VmNumaNode)

Example 3 with VmNumaNodeOperationParameters

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

the class NumaSupportModel method getUpdateParameters.

/**
 * Return a list of action parameters which contain numa pinning updates for different VMs.
 * Used when accessing the numa support screen from the host list panel.
 * @return List of updated numa configurations
 */
public ArrayList<ActionParametersBase> getUpdateParameters() {
    final ArrayList<ActionParametersBase> parameters = new ArrayList<>();
    for (Guid vmId : vmsToUpdate) {
        final List<VmNumaNode> numaNodes = new ArrayList<>();
        for (final VNodeModel model : numaModelsPerVm.get(vmId).values()) {
            numaNodes.add(model.toVmNumaNode());
        }
        parameters.add(new VmNumaNodeOperationParameters(vmId, numaNodes));
    }
    return parameters;
}
Also used : VmNumaNodeOperationParameters(org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters) VmNumaNode(org.ovirt.engine.core.common.businessentities.VmNumaNode) ArrayList(java.util.ArrayList) Guid(org.ovirt.engine.core.compat.Guid) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 4 with VmNumaNodeOperationParameters

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

the class AddVmCommand method addVmNumaNodes.

private void addVmNumaNodes() {
    List<VmNumaNode> numaNodes = getParameters().getVm().getvNumaNodeList();
    if (numaNodes.isEmpty()) {
        return;
    }
    VmNumaNodeOperationParameters params = new VmNumaNodeOperationParameters(getParameters().getVm(), numaNodes);
    ActionReturnValue returnValueBase = backend.runInternalAction(ActionType.AddVmNumaNodes, params);
    if (!returnValueBase.getSucceeded()) {
        auditLogDirector.log(this, AuditLogType.NUMA_ADD_VM_NUMA_NODE_FAILED);
    }
}
Also used : VmNumaNodeOperationParameters(org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters) VmNumaNode(org.ovirt.engine.core.common.businessentities.VmNumaNode) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue)

Aggregations

VmNumaNodeOperationParameters (org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters)4 VmNumaNode (org.ovirt.engine.core.common.businessentities.VmNumaNode)4 ArrayList (java.util.ArrayList)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 Guid (org.ovirt.engine.core.compat.Guid)1