use of com.emc.storageos.db.client.model.VirtualDataCenter in project coprhd-controller by CoprHD.
the class AbstractVdcTaskOp method buildConfigParam.
/**
* Build parameter for SyncVdcConfig call
*
* @param vdcList
* @return
*/
protected VdcConfigSyncParam buildConfigParam(List<VirtualDataCenter> vdcList) {
VdcConfigSyncParam syncParam = new VdcConfigSyncParam();
syncParam.setVdcConfigVersion(DrUtil.newVdcConfigVersion());
syncParam.setIpsecKey(ipsecConfig.getPreSharedKeyFromZK());
for (VirtualDataCenter vdc : vdcList) {
syncParam.getVirtualDataCenters().add(helper.toConfigParam(vdc));
}
syncParam.setConfigChangeType(changeType().toString());
return syncParam;
}
use of com.emc.storageos.db.client.model.VirtualDataCenter in project coprhd-controller by CoprHD.
the class AbstractVdcTaskOp method sendPostCheckMsg.
protected void sendPostCheckMsg(List<VirtualDataCenter> vdcList, VdcPostCheckParam checkParam) {
for (VirtualDataCenter vdc : vdcList) {
sendPostCheckMsg(checkParam, vdc);
}
checkParam.setFresher(false);
// notify local vdc to do post steps either
helper.syncVdcConfigPostSteps(checkParam);
}
use of com.emc.storageos.db.client.model.VirtualDataCenter in project coprhd-controller by CoprHD.
the class AbstractVdcTaskOp method isTargetVdcReachable.
/**
* Make sure the vdc is reachable from any of the
* connected VDCs
*/
protected boolean isTargetVdcReachable(int nodeCheckTimeout_ms) {
log.info("Checking to see if the vdc {} is reachable from connected VDCs", operatedVdc.getShortId());
// Go through the connected list
for (VirtualDataCenter vdc : connectedVdc) {
if (vdc.getConnectionStatus() == VirtualDataCenter.ConnectionStatus.DISCONNECTED) {
// skip the disconnected VDC
continue;
}
if (vdc.getId().equals(operatedVdc.getId())) {
// skip the VDC to be disconnected
continue;
}
if (vdc.getLocal()) {
Site activeSite = drUtil.getActiveSite(operatedVdc.getShortId());
if (helper.areNodesReachable(vdc.getShortId(), activeSite.getHostIPv4AddressMap(), activeSite.getHostIPv6AddressMap(), true)) {
return true;
}
continue;
}
// non-local vdcs
VdcPreCheckParam2 checkParam2 = new VdcPreCheckParam2();
checkParam2.setConfigChangeType(VdcConfig.ConfigChangeType.DISCONNECT_VDC);
List<URI> vdcIds = new ArrayList(1);
vdcIds.add(operatedVdc.getId());
checkParam2.setVdcIds(vdcIds);
checkParam2.setIsAllNotReachable(true);
try {
VdcPreCheckResponse2 resp2 = sendVdcPrecheckRequest2(vdc, checkParam2, nodeCheckTimeout_ms);
if (!resp2.getIsAllNodesNotReachable()) {
errMsg = String.format("The vdc %s to be disconnected is still reachable from %s", operatedVdc.getShortId(), vdc.getShortId());
log.error(errMsg);
return true;
}
} catch (Exception e) {
log.error("Failed to check the operatedVdc {} on the vdc {} e=", new Object[] { operatedVdc.getShortId(), vdc.getShortId(), e });
continue;
}
}
return false;
}
use of com.emc.storageos.db.client.model.VirtualDataCenter in project coprhd-controller by CoprHD.
the class AbstractVdcTaskOp method isVdcVersion20.
/**
* For disconnect and reconnect operations, every living connected vdc's version should at least 2.1 or higher.
*/
protected boolean isVdcVersion20() {
log.info("Checking to see if every living vdc's version is 2.0");
// get geoClientCache to get the version for each vdc
for (VirtualDataCenter vdc : connectedVdc) {
if (vdc.getId().equals(operatedVdc.getId())) {
continue;
}
if (vdc.getConnectionStatus() == VirtualDataCenter.ConnectionStatus.CONNECTED) {
String viPRVersion = helper.getViPRVersion(vdc.getShortId());
if (viPRVersion.startsWith(VIPR_INVALID_VERSION_PREFIX)) {
errMsg = String.format("The vipr version for vdc %s is 2.0", vdc.getLabel());
log.info("The vipr version for vdc {} is 2.0", vdc.getShortId());
return true;
}
}
}
return false;
}
use of com.emc.storageos.db.client.model.VirtualDataCenter in project coprhd-controller by CoprHD.
the class AbstractVdcTaskOp method isAllConnectedVdcReachableWith.
/**
* Make sure all the connected(the status is connected, not the connectedVdc instance in this class ) vdc is
* reachable by the targetVdc, there are two usages here:
* 1. verify if the operatedVdc is back online and reachble with other connected vdcs,
* 2. verify current vdc is reachable with other connected vdcs.
*/
protected boolean isAllConnectedVdcReachableWith(VirtualDataCenter targetVdc) {
log.info("Checking to see if the vdc {} is reachable with other connected VDCs", targetVdc.getShortId());
// Go through the connected list
for (VirtualDataCenter vdc : connectedVdc) {
// Don't need to check if the target vdc is reachable with itself
if (vdc.getId().equals(targetVdc.getId())) {
continue;
}
VdcNodeCheckResponse resp = null;
List<VirtualDataCenter> vdcs = new ArrayList(1);
vdcs.add(targetVdc);
try {
// vdcResp = sendVdcCheckRequest(vdc, operatedVdc);
resp = helper.sendVdcNodeCheckRequest(vdc, vdcs);
if (!resp.isNodesReachable()) {
log.error("the vdc {} can not be reached by target Vdc {}", vdc.getShortId(), targetVdc.getShortId());
errMsg = String.format("The Vdc %s can not be reached by target Vdc %s", vdc.getId().toString(), targetVdc.getId().toString());
return false;
}
} catch (GeoException e) {
errMsg = e.getMessage();
return false;
} catch (IllegalStateException e) {
errMsg = e.getMessage();
return false;
}
}
return true;
}
Aggregations