Search in sources :

Example 1 with ClusterState

use of com.emc.vipr.model.sys.ClusterInfo.ClusterState in project coprhd-controller by CoprHD.

the class ClusterInfo method loadRenderArgs.

/**
 * loads render args
 */
private static void loadRenderArgs() {
    boolean reconfigSupported = true;
    boolean unsupportedPlatform = BourneUtil.getViprClient().vdcs().isGeoSetup();
    if (unsupportedPlatform) {
        reconfigSupported = false;
        Logger.info(UNSUPPORTED_KEY + "  isGeo: " + unsupportedPlatform);
        flash.put("warning", MessagesUtils.get(UNSUPPORTED_KEY));
    }
    ClusterState clusterState = getClusterStateFromCoordinator();
    if (clusterState == null || !clusterState.equals(ClusterState.STABLE)) {
        reconfigSupported = false;
        flash.put("warning", MessagesUtils.get(UNSTABLE_KEY));
    }
    renderArgs.put("reconfigSupported", reconfigSupported);
    renderArgs.put("vip", vip);
}
Also used : ClusterState(com.emc.vipr.model.sys.ClusterInfo.ClusterState)

Example 2 with ClusterState

use of com.emc.vipr.model.sys.ClusterInfo.ClusterState in project coprhd-controller by CoprHD.

the class SchedulerConfig method isClusterUpgrading.

private boolean isClusterUpgrading() {
    try {
        RepositoryInfo target = coordinator.getTargetInfo(RepositoryInfo.class);
        SoftwareVersion targetVersion = target.getCurrentVersion();
        SoftwareVersion currentVersion = new LocalRepository().getRepositoryInfo().getCurrentVersion();
        log.info("The current version={} target version={}", currentVersion, targetVersion);
        if (!currentVersion.equals(targetVersion)) {
            log.info("The current version is NOT equals to target version");
            return true;
        }
    } catch (Exception e) {
        log.error("Failed to get versions e=", e);
        // failed to read data from zk, so no need to do backup at this time
        return true;
    }
    CoordinatorClient coordinatorClient = coordinator.getCoordinatorClient();
    String currentDbSchemaVersion = coordinatorClient.getCurrentDbSchemaVersion();
    String targetDbSchemaVersion = coordinatorClient.getTargetDbSchemaVersion();
    log.info("Current db schema version: {}, target db schema version: {}.", currentDbSchemaVersion, targetDbSchemaVersion);
    if (currentDbSchemaVersion == null || !currentDbSchemaVersion.equalsIgnoreCase(targetDbSchemaVersion)) {
        log.warn("Current version is not equal to the target version");
        return true;
    }
    ClusterState state = coordinatorClient.getControlNodesState();
    log.info("Current control nodes' state: {}", state);
    if (state == ClusterState.STABLE || state == ClusterState.SYNCING || state == ClusterState.DEGRADED) {
        return false;
    }
    return true;
}
Also used : ClusterState(com.emc.vipr.model.sys.ClusterInfo.ClusterState) SoftwareVersion(com.emc.storageos.coordinator.client.model.SoftwareVersion) RepositoryInfo(com.emc.storageos.coordinator.client.model.RepositoryInfo) LocalRepository(com.emc.storageos.systemservices.impl.upgrade.LocalRepository) CoordinatorClient(com.emc.storageos.coordinator.client.service.CoordinatorClient)

Example 3 with ClusterState

use of com.emc.vipr.model.sys.ClusterInfo.ClusterState in project coprhd-controller by CoprHD.

the class ClusterInfo method getClusterStateFromCoordinator.

private static ClusterState getClusterStateFromCoordinator() {
    if (StorageOsPlugin.isEnabled()) {
        CoordinatorClient coordinatorClient = StorageOsPlugin.getInstance().getCoordinatorClient();
        ClusterState clusterState = coordinatorClient.getControlNodesState();
        return clusterState;
    }
    return null;
}
Also used : ClusterState(com.emc.vipr.model.sys.ClusterInfo.ClusterState) CoordinatorClient(com.emc.storageos.coordinator.client.service.CoordinatorClient)

Aggregations

ClusterState (com.emc.vipr.model.sys.ClusterInfo.ClusterState)3 CoordinatorClient (com.emc.storageos.coordinator.client.service.CoordinatorClient)2 RepositoryInfo (com.emc.storageos.coordinator.client.model.RepositoryInfo)1 SoftwareVersion (com.emc.storageos.coordinator.client.model.SoftwareVersion)1 LocalRepository (com.emc.storageos.systemservices.impl.upgrade.LocalRepository)1