Search in sources :

Example 11 with VmManagementParametersBase

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

the class VmHostDeviceListModel method pinVmToHost.

private void pinVmToHost(Guid hostId, IFrontendActionAsyncCallback callback) {
    getEntity().setDedicatedVmForVdsList(hostId);
    Frontend.getInstance().runAction(ActionType.UpdateVm, new VmManagementParametersBase(getEntity().getStaticData()), callback);
}
Also used : VmManagementParametersBase(org.ovirt.engine.core.common.action.VmManagementParametersBase)

Example 12 with VmManagementParametersBase

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

the class UpdateClusterCommand method updateVms.

private boolean updateVms() {
    for (VmStatic vm : vmsLockedForUpdate) {
        VmManagementParametersBase updateParams = new VmManagementParametersBase(vm);
        /*
            Locking by UpdateVmCommand is disabled since VMs are already locked in #getExclusiveLocks method.
            This logic relies on assumption that UpdateVmCommand locks exactly only updated VM.
             */
        updateParams.setLockProperties(LockProperties.create(LockProperties.Scope.None));
        updateParams.setClusterLevelChangeFromVersion(oldCluster.getCompatibilityVersion());
        upgradeGraphicsDevices(vm, updateParams);
        updateResumeBehavior(vm);
        updateRngDeviceIfNecessary(vm.getId(), vm.getCustomCompatibilityVersion(), updateParams);
        ActionReturnValue result = runInternalAction(ActionType.UpdateVm, updateParams, cloneContextAndDetachFromParent());
        if (!result.getSucceeded()) {
            List<String> params = new ArrayList<>();
            params.add("$action Update");
            params.add("$type VM");
            params.add(parseErrorMessage(result.getValidationMessages()));
            List<String> messages = Backend.getInstance().getErrorsTranslator().translateErrorText(params);
            failedUpgradeEntities.put(vm.getName(), getFailedMessage(messages));
        }
    }
    return true;
}
Also used : ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) ArrayList(java.util.ArrayList) VmStatic(org.ovirt.engine.core.common.businessentities.VmStatic) VmManagementParametersBase(org.ovirt.engine.core.common.action.VmManagementParametersBase)

Aggregations

VmManagementParametersBase (org.ovirt.engine.core.common.action.VmManagementParametersBase)12 VM (org.ovirt.engine.core.common.businessentities.VM)6 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)4 VmStatic (org.ovirt.engine.core.common.businessentities.VmStatic)2 ArrayList (java.util.ArrayList)1 CommandContext (org.ovirt.engine.core.bll.context.CommandContext)1 ChangeDiskCommandParameters (org.ovirt.engine.core.common.action.ChangeDiskCommandParameters)1 ChangeVMClusterParameters (org.ovirt.engine.core.common.action.ChangeVMClusterParameters)1 GraphicsDevice (org.ovirt.engine.core.common.businessentities.GraphicsDevice)1 GraphicsType (org.ovirt.engine.core.common.businessentities.GraphicsType)1 VmDevice (org.ovirt.engine.core.common.businessentities.VmDevice)1 VmPayload (org.ovirt.engine.core.common.businessentities.VmPayload)1 VmRngDevice (org.ovirt.engine.core.common.businessentities.VmRngDevice)1 VmWatchdog (org.ovirt.engine.core.common.businessentities.VmWatchdog)1 Guid (org.ovirt.engine.core.compat.Guid)1 EngineLock (org.ovirt.engine.core.utils.lock.EngineLock)1 UnitToGraphicsDeviceParamsBuilder (org.ovirt.engine.ui.uicommonweb.builders.vm.UnitToGraphicsDeviceParamsBuilder)1 VmIconUnitAndVmToParameterBuilder (org.ovirt.engine.ui.uicommonweb.builders.vm.VmIconUnitAndVmToParameterBuilder)1