use of org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase in project ovirt-engine by oVirt.
the class AutoRecoveryManager method recoverImpl.
public void recoverImpl() {
check(vdsDao, ActionType.ActivateVds, arg -> {
final VdsActionParameters params = new VdsActionParameters(arg.getId());
params.setRunSilent(true);
return params;
}, list -> {
List<VDS> filtered = new ArrayList<>(list.size());
List<VdsNetworkInterface> nics;
for (VDS vds : list) {
if (vds.getNonOperationalReason() == NonOperationalReason.NETWORK_INTERFACE_IS_DOWN) {
backend.getResourceManager().runVdsCommand(VDSCommandType.GetStats, new VdsIdAndVdsVDSCommandParametersBase(vds));
nics = vds.getInterfaces();
} else {
nics = interfaceDao.getAllInterfacesForVds(vds.getId());
}
Map<String, Set<String>> problematicNics = NetworkMonitoringHelper.determineProblematicNics(nics, networkDao.getAllForCluster(vds.getClusterId()));
if (problematicNics.isEmpty()) {
filtered.add(vds);
}
}
return filtered;
}, "hosts");
check(storageDomainDao, ActionType.ConnectDomainToStorage, arg -> {
final StorageDomainPoolParametersBase params = new StorageDomainPoolParametersBase(arg.getId(), arg.getStoragePoolId());
params.setRunSilent(true);
return params;
}, list -> list, "storage domains");
}
use of org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase in project ovirt-engine by oVirt.
the class HostSetupNetworksCommand method executeCommand.
@Override
protected void executeCommand() {
if (noChangesDetected()) {
log.info("No changes were detected in setup networks for host '{}' (ID: '{}')", getVdsName(), getVdsId());
setSucceeded(true);
return;
}
try (EngineLock monitoringLock = acquireMonitorLock("Host setup networks")) {
int timeout = getSetupNetworksTimeout();
FutureVDSCall<VDSReturnValue> setupNetworksTask = invokeSetupNetworksCommand(timeout);
try {
VDSReturnValue retVal = setupNetworksTask.get(timeout, TimeUnit.SECONDS);
if (retVal != null) {
if (!retVal.getSucceeded() && retVal.getVdsError() == null && getParameters().rollbackOnFailure()) {
throw new EngineException(EngineError.SETUP_NETWORKS_ROLLBACK, retVal.getExceptionString());
}
VdsHandler.handleVdsResult(retVal);
if (retVal.getSucceeded()) {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetCapabilities, new VdsIdAndVdsVDSCommandParametersBase(getVds()));
VDS updatedHost = (VDS) returnValue.getReturnValue();
persistNetworkChanges(updatedHost);
}
setSucceeded(true);
}
} catch (TimeoutException e) {
log.debug("Host Setup networks command timed out for {} seconds", timeout);
}
}
}
use of org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase in project ovirt-engine by oVirt.
the class InitVdsOnUpCommand method proceedVdsStats.
private Pair<Boolean, List<StorageDomainStatic>> proceedVdsStats(boolean shouldCheckReportedDomains, StoragePool storagePool) {
Pair<Boolean, List<StorageDomainStatic>> returnValue = new Pair<>(true, null);
try {
runVdsCommand(VDSCommandType.GetStats, new VdsIdAndVdsVDSCommandParametersBase(getVds()));
if (shouldCheckReportedDomains) {
List<Guid> problematicDomainsIds = fetchDomainsReportedAsProblematic(getVds().getDomains(), storagePool);
for (Guid domainId : problematicDomainsIds) {
StorageDomainStatic domainInfo = storageDomainStaticDao.get(domainId);
log.error("Storage Domain '{}' of pool '{}' is in problem in host '{}'", domainInfo != null ? domainInfo.getStorageName() : domainId, getStoragePool().getName(), getVds().getName());
if (domainInfo == null || domainInfo.getStorageDomainType().isDataDomain()) {
returnValue.setFirst(false);
if (returnValue.getSecond() == null) {
returnValue.setSecond(new ArrayList<>());
}
returnValue.getSecond().add(domainInfo);
}
}
}
} catch (EngineException e) {
log.error("Could not get Host statistics for Host '{}': {}", getVds().getName(), e.getMessage());
log.debug("Exception", e);
returnValue.setFirst(false);
}
return returnValue;
}
use of org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase in project ovirt-engine by oVirt.
the class VdsManager method refreshHostSync.
public void refreshHostSync(VDS vds) {
VDSReturnValue caps = resourceManager.runVdsCommand(VDSCommandType.GetCapabilities, new VdsIdAndVdsVDSCommandParametersBase(vds));
handleRefreshCapabilitiesResponse(vds, caps, true);
}
use of org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase in project ovirt-engine by oVirt.
the class VdsManager method getHardwareInfo.
public void getHardwareInfo(VDS vds) {
// Verify version capabilities
Set<Version> hostVersions = vds.getSupportedClusterVersionsSet();
Version clusterCompatibility = vds.getClusterCompatibilityVersion();
// API won't exist for the host and an exception will be raised by VDSM.
if (hostVersions != null && hostVersions.contains(clusterCompatibility)) {
resourceManager.runVdsCommand(VDSCommandType.GetHardwareInfoAsync, new VdsIdAndVdsVDSCommandParametersBase(vds).withCallback(new HardwareInfoCallback(vds)));
}
}
Aggregations