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);
}
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;
}
Aggregations