use of com.emc.storageos.coordinator.client.model.ConfigVersion in project coprhd-controller by CoprHD.
the class CoordinatorClientExt method getClusterInfo.
public ClusterInfo getClusterInfo(String siteIdParam) {
try {
String siteId = siteIdParam == null ? _coordinator.getSiteId() : siteIdParam;
// get target repository and configVersion
final RepositoryInfo targetRepository = _coordinator.getTargetInfo(RepositoryInfo.class);
final PropertyInfoExt targetProperty = _coordinator.getTargetInfo(PropertyInfoExt.class);
// get control nodes' repository and configVersion info
final Map<Service, RepositoryInfo> controlNodesInfo = getAllNodeInfos(RepositoryInfo.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
final Map<Service, ConfigVersion> controlNodesConfigVersions = getAllNodeInfos(ConfigVersion.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
ClusterInfo.ClusterState controlNodesState = _coordinator.getControlNodesState(siteId);
// rotating ipsec key. We should report upgrade in progress on UI
if (backCompatPreYoda && ClusterInfo.ClusterState.STABLE.equals(controlNodesState)) {
if (!drUtil.isMultivdc()) {
_log.info("Back compat flag for preyoda is true. ");
controlNodesState = ClusterInfo.ClusterState.UPDATING;
}
}
// cluster state is determined both by control nodes' state and extra nodes
return toClusterInfo(controlNodesState, controlNodesInfo, controlNodesConfigVersions, targetRepository, targetProperty);
} catch (Exception e) {
_log.info("Fail to get the cluster information ", e);
return null;
}
}
use of com.emc.storageos.coordinator.client.model.ConfigVersion in project coprhd-controller by CoprHD.
the class PropertyManager method initializeLocalAndTargetInfo.
/**
* Initialize local and target info
*
* @throws Exception
*/
private void initializeLocalAndTargetInfo(String svcId) throws Exception {
// publish config_version which is also a target property
// used as a flag denoting whether target properties have been changed
PropertyInfoExt localPropInfo = localRepository.getOverrideProperties();
localConfigVersion = localPropInfo.getProperty(PropertyInfoExt.CONFIG_VERSION);
if (localConfigVersion == null) {
localConfigVersion = "0";
localPropInfo.addProperty(PropertyInfoExt.CONFIG_VERSION, localConfigVersion);
}
coordinator.setNodeSessionScopeInfo(new ConfigVersion(localConfigVersion));
log.info("Step1a: Local config version: {}", localConfigVersion);
// get local target property info
localTargetPropInfo = getLocalTargetPropInfo(localPropInfo);
log.debug("Step1a: Local target properties: {}", localTargetPropInfo);
// set target if empty
targetPropInfo = coordinator.getTargetProperties();
if (targetPropInfo == null) {
// only control node can set target
try {
// Set the updated propperty info in coordinator
coordinator.setTargetProperties(localPropInfo.getAllProperties());
coordinator.setTargetInfo(new PowerOffState(PowerOffState.State.NONE));
targetPropInfo = coordinator.getTargetInfo(PropertyInfoExt.class);
log.info("Step1b: Target property set to local state: {}", targetPropInfo);
} catch (CoordinatorClientException e) {
log.info("Step1b: Wait another control node to set target");
retrySleep();
throw e;
}
}
}
use of com.emc.storageos.coordinator.client.model.ConfigVersion in project coprhd-controller by CoprHD.
the class CoordinatorClientImpl method getControlNodesState.
@Override
public ClusterInfo.ClusterState getControlNodesState(String siteId) {
try {
// get target repository and configVersion
final RepositoryInfo targetRepository = getTargetInfo(RepositoryInfo.class);
final PropertyInfoRestRep targetProperty = getTargetInfo(PropertyInfoExt.class);
final PowerOffState targetPowerOffState = getTargetInfo(PowerOffState.class);
final StorageDriversInfo targetDrivers = getTargetInfo(StorageDriversInfo.class);
// get control nodes' repository and configVersion info
final Map<Service, RepositoryInfo> controlNodesInfo = getAllNodeInfos(RepositoryInfo.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
final Map<Service, ConfigVersion> controlNodesConfigVersions = getAllNodeInfos(ConfigVersion.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
final Map<Service, VdcConfigVersion> controlNodesVdcConfigVersions = getAllNodeInfos(VdcConfigVersion.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
final Map<Service, StorageDriversInfo> controlNodesDrivers = getAllNodeInfos(StorageDriversInfo.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
return getControlNodesState(targetRepository, controlNodesInfo, targetProperty, controlNodesConfigVersions, controlNodesVdcConfigVersions, targetPowerOffState, targetDrivers, controlNodesDrivers, siteId);
} catch (Exception e) {
log.info("Fail to get the control node information ", e);
return ClusterInfo.ClusterState.UNKNOWN;
}
}
Aggregations