Search in sources :

Example 1 with RefreshPoolSingleAsyncOperationFactory

use of org.ovirt.engine.core.bll.storage.pool.RefreshPoolSingleAsyncOperationFactory in project ovirt-engine by oVirt.

the class ActivateStorageDomainCommand method refreshAllVdssInPool.

private void refreshAllVdssInPool() {
    final List<Guid> vdsIdsToSetNonOperational = new ArrayList<>();
    getEventQueue().submitEventSync(new Event(getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), null, EventType.POOLREFRESH, ""), () -> {
        runSynchronizeOperation(new RefreshPoolSingleAsyncOperationFactory(), vdsIdsToSetNonOperational);
        return null;
    });
    for (Guid vdsId : vdsIdsToSetNonOperational) {
        Map<String, String> customLogValues = Collections.singletonMap("StorageDomainNames", getStorageDomainName());
        SetNonOperationalVdsParameters tempVar = new SetNonOperationalVdsParameters(vdsId, STORAGE_DOMAIN_UNREACHABLE, customLogValues);
        tempVar.setStorageDomainId(getStorageDomain().getId());
        tempVar.setTransactionScopeOption(TransactionScopeOption.RequiresNew);
        runInternalAction(ActionType.SetNonOperationalVds, tempVar, ExecutionHandler.createInternalJobContext(getContext()));
    }
}
Also used : SetNonOperationalVdsParameters(org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters) ArrayList(java.util.ArrayList) Event(org.ovirt.engine.core.common.eventqueue.Event) RefreshPoolSingleAsyncOperationFactory(org.ovirt.engine.core.bll.storage.pool.RefreshPoolSingleAsyncOperationFactory) Guid(org.ovirt.engine.core.compat.Guid)

Aggregations

ArrayList (java.util.ArrayList)1 RefreshPoolSingleAsyncOperationFactory (org.ovirt.engine.core.bll.storage.pool.RefreshPoolSingleAsyncOperationFactory)1 SetNonOperationalVdsParameters (org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters)1 Event (org.ovirt.engine.core.common.eventqueue.Event)1 Guid (org.ovirt.engine.core.compat.Guid)1