use of org.ovirt.engine.core.common.vdscommands.UpgradeStoragePoolVDSCommandParameters in project ovirt-engine by oVirt.
the class UpdateStoragePoolCommand method updateStoragePoolFormatType.
private void updateStoragePoolFormatType() {
final StoragePool storagePool = getStoragePool();
final Guid spId = storagePool.getId();
final Version spVersion = storagePool.getCompatibilityVersion();
final Version oldSpVersion = getOldStoragePool().getCompatibilityVersion();
if (oldSpVersion.equals(spVersion)) {
return;
}
StorageFormatType targetFormat = updatePoolAndDomainsFormat(spVersion);
if (getOldStoragePool().getStatus() == StoragePoolStatus.Up) {
try {
// No need to worry about "reupgrading" as VDSM will silently ignore
// the request.
runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat));
} catch (EngineException e) {
log.warn("Upgrade process of Storage Pool '{}' has encountered a problem due to following reason: {}", spId, e.getMessage());
auditLogDirector.log(this, AuditLogType.UPGRADE_STORAGE_POOL_ENCOUNTERED_PROBLEMS);
// and return.
if (e.getVdsError() != null && e.getErrorCode() == EngineError.PoolUpgradeInProgress) {
updatePoolAndDomainsFormat(oldSpVersion);
return;
}
}
}
runSynchronizeOperation(new RefreshPoolSingleAsyncOperationFactory(), new ArrayList<Guid>());
}
Aggregations