use of org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters in project ovirt-engine by oVirt.
the class FenceVdsManualyCommand method resetSPM.
private void resetSPM() {
log.info("Start reset of SPM. Spm vds id: '{}'", getStoragePool().getSpmVdsId());
if (getStoragePool().getSpmVdsId() != null) {
ResetIrsVDSCommandParameters resetIrsParams = new ResetIrsVDSCommandParameters(getStoragePool().getId(), getStoragePool().getSpmVdsId());
resetIrsParams.setVdsAlreadyRebooted(true);
runVdsCommand(VDSCommandType.ResetIrs, resetIrsParams);
}
}
use of org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters in project ovirt-engine by oVirt.
the class SetVdsStatusVDSCommand method executeVdsIdCommand.
@Override
protected void executeVdsIdCommand() {
final SetVdsStatusVDSCommandParameters parameters = getParameters();
if (_vdsManager != null) {
final VDS vds = getVds();
if (vds.getSpmStatus() != VdsSpmStatus.None && parameters.getStatus() != VDSStatus.Up) {
log.info("VDS '{}' is spm and moved from up calling resetIrs.", vds.getName());
// check if this host was spm and reset if do.
getVDSReturnValue().setSucceeded(resourceManager.runVdsCommand(VDSCommandType.ResetIrs, new ResetIrsVDSCommandParameters(vds.getStoragePoolId(), vds.getId())).getSucceeded());
if (!getVDSReturnValue().getSucceeded()) {
if (getParameters().isStopSpmFailureLogged()) {
AuditLogable base = new AuditLogableImpl();
base.setVdsId(vds.getId());
base.setVdsName(vds.getName());
auditLogDirector.log(base, AuditLogType.VDS_STATUS_CHANGE_FAILED_DUE_TO_STOP_SPM_FAILURE);
}
if (parameters.getStatus() == VDSStatus.PreparingForMaintenance) {
// ResetIrs command failed, SPM host status cannot be moved to Preparing For Maintenance
return;
}
}
}
TransactionSupport.executeInNewTransaction(() -> {
_vdsManager.setStatus(parameters.getStatus(), vds);
_vdsManager.updatePartialDynamicData(parameters.getNonOperationalReason(), parameters.getMaintenanceReason());
_vdsManager.updateStatisticsData(vds.getStatisticsData());
return null;
});
} else {
getVDSReturnValue().setSucceeded(false);
}
}
use of org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters in project ovirt-engine by oVirt.
the class ReconstructMasterDomainCommand method stopSpm.
protected boolean stopSpm() {
boolean commandSucceeded = true;
if (getStoragePool().getSpmVdsId() != null) {
// if spm host id is different from selected host get the spm
// in order to try and perform stop spm
VDS spm;
if (getStoragePool().getSpmVdsId().equals(getVds().getId())) {
spm = getVds();
} else {
spm = vdsDao.get(getStoragePool().getSpmVdsId());
}
if (spm != null) {
ResetIrsVDSCommandParameters tempVar2 = new ResetIrsVDSCommandParameters(getStoragePool().getId(), spm.getId());
tempVar2.setIgnoreStopFailed(true);
commandSucceeded = runVdsCommand(VDSCommandType.ResetIrs, tempVar2).getSucceeded();
// if spm host is up switch to use it in the following logic
if (spm.getStatus() == VDSStatus.Up) {
setVdsId(spm.getId());
setVds(spm);
}
}
}
return commandSucceeded;
}
Aggregations