Search in sources :

Example 1 with InternalDbClient

use of com.emc.storageos.geo.vdccontroller.impl.InternalDbClient in project coprhd-controller by CoprHD.

the class DBClient method resetGeoBlacklist.

/**
 * Remove geo blacklist for geo
 *
 * @param vdcShortId
 */
public void resetGeoBlacklist(String vdcShortId) {
    InternalDbClient geoDbClient = (InternalDbClient) ctx.getBean("geodbclient");
    List<URI> vdcList = geoDbClient.queryByType(VirtualDataCenter.class, true);
    for (URI vdcId : vdcList) {
        VirtualDataCenter vdc = geoDbClient.queryObject(VirtualDataCenter.class, vdcId);
        if (vdc.getShortId().equals(vdcShortId)) {
            System.out.println("Remove black list for vdc: " + vdcShortId);
            geoDbClient.removeVdcNodesFromBlacklist(vdc);
            break;
        }
    }
}
Also used : InternalDbClient(com.emc.storageos.geo.vdccontroller.impl.InternalDbClient) VirtualDataCenter(com.emc.storageos.db.client.model.VirtualDataCenter) URI(java.net.URI)

Example 2 with InternalDbClient

use of com.emc.storageos.geo.vdccontroller.impl.InternalDbClient in project coprhd-controller by CoprHD.

the class DBClient method recoverVdcConfigFromRecoverFile.

/**
 * Recover the system after add/remove vdc failures from recover file
 *
 * @param recoverFileName
 */
public void recoverVdcConfigFromRecoverFile(String recoverFileName) {
    List<VdcConfig> newVdcConfigList = loadRecoverFileToRecoverInfo(recoverFileName);
    InternalDbClient geoDbClient = (InternalDbClient) ctx.getBean("geodbclient");
    geoDbClient.stopClusterGossiping();
    // Don't recover version and ipsec key. Need to reconsider once all vdc data moving to ZK.
    vdcConfHelper.syncVdcConfig(newVdcConfigList, null, true, DrUtil.newVdcConfigVersion(), "");
    try {
        Thread.sleep(30000);
    } catch (InterruptedException e) {
        log.error("Error in recover Vdc Config, e=" + e);
    }
    System.out.println("Recover successfully, please wait for the whole vdc reboot.");
}
Also used : VdcConfig(com.emc.storageos.geomodel.VdcConfig) InternalDbClient(com.emc.storageos.geo.vdccontroller.impl.InternalDbClient)

Example 3 with InternalDbClient

use of com.emc.storageos.geo.vdccontroller.impl.InternalDbClient in project coprhd-controller by CoprHD.

the class DBClient method setGeoBlacklist.

/**
 * Set geo blacklist
 *
 * @param vdcShortId
 */
public void setGeoBlacklist(String vdcShortId) {
    InternalDbClient geoDbClient = (InternalDbClient) ctx.getBean("geodbclient");
    List<URI> vdcList = geoDbClient.queryByType(VirtualDataCenter.class, true);
    for (URI vdcId : vdcList) {
        VirtualDataCenter vdc = geoDbClient.queryObject(VirtualDataCenter.class, vdcId);
        if (vdc.getShortId().equals(vdcShortId)) {
            System.out.println("Add black list for vdc: " + vdcShortId);
            geoDbClient.addVdcNodesToBlacklist(vdc);
            break;
        }
    }
}
Also used : InternalDbClient(com.emc.storageos.geo.vdccontroller.impl.InternalDbClient) VirtualDataCenter(com.emc.storageos.db.client.model.VirtualDataCenter) URI(java.net.URI)

Aggregations

InternalDbClient (com.emc.storageos.geo.vdccontroller.impl.InternalDbClient)3 VirtualDataCenter (com.emc.storageos.db.client.model.VirtualDataCenter)2 URI (java.net.URI)2 VdcConfig (com.emc.storageos.geomodel.VdcConfig)1