Search in sources :

Example 1 with TimeBoundPollVDSCommandParameters

use of org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters in project ovirt-engine by oVirt.

the class HostConnectivityChecker method check.

public boolean check(final VDS host) {
    PollTechnique pollTechnique = FeatureSupported.isPing2SupportedByVdsm(host.getClusterCompatibilityVersion()) ? POLL2 : POLL;
    HostPoller poller = new HostPoller(new TimeBoundPollVDSCommandParameters(host.getId(), pollTechnique));
    final long startTime = System.nanoTime();
    while (System.nanoTime() - startTime < VDSM_RESPONSIVENESS_PERIOD_IN_NANOS) {
        if (poller.poll()) {
            log.info("Engine managed to communicate with VDSM agent on host '{}' with address '{}' ('{}')", host.getName(), host.getHostName(), host.getId());
            return true;
        }
    }
    return false;
}
Also used : HostPoller(org.ovirt.engine.core.bll.network.host.HostPoller) PollTechnique(org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters.PollTechnique) TimeBoundPollVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters)

Example 2 with TimeBoundPollVDSCommandParameters

use of org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters in project ovirt-engine by oVirt.

the class HostSetupNetworksCommand method invokeSetupNetworksCommand.

private FutureVDSCall<VDSReturnValue> invokeSetupNetworksCommand(int timeout) {
    final HostSetupNetworksVdsCommandParameters parameters = createSetupNetworksParameters(timeout);
    FutureVDSCall<VDSReturnValue> setupNetworksTask = getVdsBroker().runFutureVdsCommand(FutureVDSCommandType.HostSetupNetworks, parameters);
    if (parameters.isRollbackOnFailure()) {
        PollTechnique pollTechnique = FeatureSupported.isConfirmConnectivitySupportedByVdsm(getVds().getClusterCompatibilityVersion()) ? CONFIRM_CONNECTIVITY : POLL;
        HostPoller poller = new HostPoller(new TimeBoundPollVDSCommandParameters(getVdsId(), pollTechnique));
        while (!setupNetworksTask.isDone()) {
            poller.poll();
        }
    }
    return setupNetworksTask;
}
Also used : HostSetupNetworksVdsCommandParameters(org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters) PollTechnique(org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters.PollTechnique) TimeBoundPollVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Aggregations

TimeBoundPollVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters)2 PollTechnique (org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters.PollTechnique)2 HostPoller (org.ovirt.engine.core.bll.network.host.HostPoller)1 HostSetupNetworksVdsCommandParameters (org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1