Search in sources :

Example 1 with SetStoragePoolStatusParameters

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

the class VdsNotRespondingTreatmentCommand method setStoragePoolNonOperational.

private void setStoragePoolNonOperational() {
    log.info("Fence failed on vds '{}' which is spm of pool '{}' - moving pool to non operational", getVds().getName(), getVds().getStoragePoolId());
    CommandContext commandContext = getContext().clone();
    // CommandContext clone is 'shallow' and does not clone the internal ExecutionContext.
    // So ExecutionContext is cloned here manually to prevent a bug (BZ1145099).
    commandContext.withExecutionContext(new ExecutionContext(commandContext.getExecutionContext()));
    runInternalAction(ActionType.SetStoragePoolStatus, new SetStoragePoolStatusParameters(getVds().getStoragePoolId(), StoragePoolStatus.NotOperational, AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM), commandContext);
}
Also used : SetStoragePoolStatusParameters(org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters) ExecutionContext(org.ovirt.engine.core.bll.job.ExecutionContext) CommandContext(org.ovirt.engine.core.bll.context.CommandContext)

Example 2 with SetStoragePoolStatusParameters

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

the class VdsEventListener method storagePoolStatusChange.

@Override
public void storagePoolStatusChange(Guid storagePoolId, StoragePoolStatus status, AuditLogType auditLogType, EngineError error, TransactionScopeOption transactionScopeOption) {
    SetStoragePoolStatusParameters tempVar = new SetStoragePoolStatusParameters(storagePoolId, status, auditLogType);
    tempVar.setError(error);
    if (transactionScopeOption != null) {
        tempVar.setTransactionScopeOption(transactionScopeOption);
    }
    backend.runInternalAction(ActionType.SetStoragePoolStatus, tempVar);
}
Also used : SetStoragePoolStatusParameters(org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters)

Example 3 with SetStoragePoolStatusParameters

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

the class StoragePoolStatusHandler method nonOperationalPoolTreatment.

private static void nonOperationalPoolTreatment(StoragePool pool) {
    boolean changeStatus = false;
    if (getAllRunningVdssInPool(pool).size() > 0) {
        changeStatus = true;
    }
    if (changeStatus) {
        log.info("Moving data center '{}' with Id '{}' to status Problematic from status NotOperational on a one" + " time basis to try to recover", pool.getName(), pool.getId());
        Backend.getInstance().runInternalAction(ActionType.SetStoragePoolStatus, new SetStoragePoolStatusParameters(pool.getId(), StoragePoolStatus.NonResponsive, AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC_FROM_NON_OPERATIONAL));
        synchronized (nonOperationalPools) {
            nonOperationalPools.remove(pool.getId());
        }
    }
}
Also used : SetStoragePoolStatusParameters(org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters)

Aggregations

SetStoragePoolStatusParameters (org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters)3 CommandContext (org.ovirt.engine.core.bll.context.CommandContext)1 ExecutionContext (org.ovirt.engine.core.bll.job.ExecutionContext)1