Search in sources :

Example 1 with HostSetupNetworksVdsCommandParameters

use of org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters 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)

Example 2 with HostSetupNetworksVdsCommandParameters

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

the class HostSetupNetworksCommand method createSetupNetworksParameters.

private HostSetupNetworksVdsCommandParameters createSetupNetworksParameters(int timeout) {
    SwitchType clusterSwitchType = getCluster().getRequiredSwitchTypeForCluster();
    List<HostNetwork> networksToConfigure = calculateNetworksToConfigure();
    final HostSetupNetworksVdsCommandParameters hostCmdParams = new HostSetupNetworksVdsCommandParameters(getVds(), networksToConfigure, getAllNetworksToRemove(), getParameters().getCreateOrUpdateBonds(), getRemovedBondNames(), clusterSwitchType);
    hostCmdParams.setRollbackOnFailure(getParameters().rollbackOnFailure());
    hostCmdParams.setConnectivityTimeout(timeout);
    hostCmdParams.setManagementNetworkChanged(isManagementNetworkChanged(networksToConfigure));
    return hostCmdParams;
}
Also used : SwitchType(org.ovirt.engine.core.common.network.SwitchType) HostSetupNetworksVdsCommandParameters(org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters) HostNetwork(org.ovirt.engine.core.common.vdscommands.HostNetwork)

Example 3 with HostSetupNetworksVdsCommandParameters

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

the class HostSetupNetworksVDSCommandTest method setUp.

@Before
public void setUp() {
    hostSetupNetworksVdsCommandParameters = new HostSetupNetworksVdsCommandParameters();
    underTest = new TestableHostSetupNetworksVDSCommand(hostSetupNetworksVdsCommandParameters);
}
Also used : HostSetupNetworksVdsCommandParameters(org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters) Before(org.junit.Before)

Aggregations

HostSetupNetworksVdsCommandParameters (org.ovirt.engine.core.common.vdscommands.HostSetupNetworksVdsCommandParameters)3 Before (org.junit.Before)1 SwitchType (org.ovirt.engine.core.common.network.SwitchType)1 HostNetwork (org.ovirt.engine.core.common.vdscommands.HostNetwork)1 TimeBoundPollVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters)1 PollTechnique (org.ovirt.engine.core.common.vdscommands.TimeBoundPollVDSCommandParameters.PollTechnique)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1