Search in sources :

Example 1 with ConnectHostToStoragePoolServersParameters

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

the class InitVdsOnUpCommand method initializeStorage.

private boolean initializeStorage() {
    boolean returnValue = false;
    // connect any storage
    if (getStoragePool() == null || StoragePoolStatus.Uninitialized == getStoragePool().getStatus() || StoragePoolStatus.Maintenance == getStoragePool().getStatus()) {
        returnValue = true;
        connectPoolSucceeded = true;
    } else {
        ConnectHostToStoragePoolServersParameters params = new ConnectHostToStoragePoolServersParameters(getStoragePool(), getVds());
        CommandContext ctx = cloneContext();
        ctx.getExecutionContext().setJobRequired(false);
        runInternalAction(ActionType.ConnectHostToStoragePoolServers, params, ctx);
        EventResult connectResult = connectHostToPool();
        if (connectResult != null) {
            returnValue = connectResult.isSuccess();
            problematicDomains = (List<StorageDomainStatic>) connectResult.getResultData();
        }
        connectPoolSucceeded = returnValue;
    }
    return returnValue;
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) ConnectHostToStoragePoolServersParameters(org.ovirt.engine.core.common.action.ConnectHostToStoragePoolServersParameters) EventResult(org.ovirt.engine.core.common.eventqueue.EventResult) CommandContext(org.ovirt.engine.core.bll.context.CommandContext)

Example 2 with ConnectHostToStoragePoolServersParameters

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

the class VdsEventListener method connectHostToDomainsInActiveOrUnknownStatus.

@Override
public boolean connectHostToDomainsInActiveOrUnknownStatus(VDS vds) {
    StoragePool sp = storagePoolDao.get(vds.getStoragePoolId());
    ConnectHostToStoragePoolServersParameters params = new ConnectHostToStoragePoolServersParameters(sp, vds, false);
    return backend.runInternalAction(ActionType.ConnectHostToStoragePoolServers, params).getSucceeded();
}
Also used : ConnectHostToStoragePoolServersParameters(org.ovirt.engine.core.common.action.ConnectHostToStoragePoolServersParameters) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool)

Aggregations

ConnectHostToStoragePoolServersParameters (org.ovirt.engine.core.common.action.ConnectHostToStoragePoolServersParameters)2 CommandContext (org.ovirt.engine.core.bll.context.CommandContext)1 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)1 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)1 EventResult (org.ovirt.engine.core.common.eventqueue.EventResult)1