Search in sources :

Example 11 with RecoverPointVolumeProtectionInfo

use of com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo in project coprhd-controller by CoprHD.

the class RecoverPointClientIntegrationTest method recreateCGSmall.

@Test
public void recreateCGSmall() throws RecoverPointException {
    RecoverPointVolumeProtectionInfo protectionInfo = null;
    try {
        protectionInfo = rpClient.getProtectionInfoForVolume(BourneRPTestProdLUN1WWN);
    } catch (RecoverPointException e) {
        logger.info("Ignore getProtectionInfoForVolume error");
    }
    if (protectionInfo != null) {
        logger.info("Delete previous CG (if it exists)");
        rpClient.deleteCG(protectionInfo);
    }
    logger.info("Create the CG with one replication set");
// CGRequestParams createCGParams = CreateCGParamsHelper(true, true, 1);
// rpClient.createCG(createCGParams);
}
Also used : RecoverPointVolumeProtectionInfo(com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo) RecoverPointException(com.emc.storageos.recoverpoint.exceptions.RecoverPointException) Test(org.junit.Test)

Example 12 with RecoverPointVolumeProtectionInfo

use of com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo in project coprhd-controller by CoprHD.

the class RecoverPointClientIntegrationTest method testUpdateProtectionJournal.

// @Test
public void testUpdateProtectionJournal() throws InterruptedException {
    logger.info("Testing RecoverPoint Update CG Protection Journal");
    try {
        recreateCGSmall();
        RecoverPointVolumeProtectionInfo protectionTargetInfo = rpClient.getProtectionInfoForVolume(BourneRPTestCRRLUN1WWN);
        RecoverPointVolumeProtectionInfo protectionProdInfo = rpClient.getProtectionInfoForVolume(BourneRPTestProdLUN1WWN);
        // rpClient.addJournalToCopy(protectionTargetInfo, BourneRPTestJrnlLUN6WWN);
        // rpClient.addJournalToCopy(protectionProdInfo, BourneRPTestJrnlLUN3WWN);
        logger.info("Journals added.  Sleep 10 seconds before removing them");
        Thread.sleep(10000);
        rpClient.deleteJournalFromCopy(protectionTargetInfo, BourneRPTestJrnlLUN6WWN);
        rpClient.deleteJournalFromCopy(protectionProdInfo, BourneRPTestJrnlLUN3WWN);
        logger.info("TestUpdateProtectionJournal PASSED");
    } catch (RecoverPointException e) {
        fail(e.getMessage());
    }
}
Also used : RecoverPointVolumeProtectionInfo(com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo) RecoverPointException(com.emc.storageos.recoverpoint.exceptions.RecoverPointException)

Example 13 with RecoverPointVolumeProtectionInfo

use of com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo in project coprhd-controller by CoprHD.

the class RecoverPointClientIntegrationTest method recreateCG.

public void recreateCG() throws RecoverPointException {
    RecoverPointVolumeProtectionInfo protectionInfo = null;
    try {
        protectionInfo = rpClient.getProtectionInfoForVolume(BourneRPTestProdLUN1WWN);
    } catch (RecoverPointException e) {
        logger.info("Ignore getProtectionInfoForVolume error");
    }
    if (protectionInfo != null) {
        logger.info("Delete previous CG (if it exists)");
        rpClient.deleteCG(protectionInfo);
    }
    logger.info("Create the CG with two replication sets");
    CGRequestParams createCGParams = createCGParamsHelper(true, true, 2);
    rpClient.createCG(createCGParams, false, false);
}
Also used : RecoverPointVolumeProtectionInfo(com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo) RecoverPointException(com.emc.storageos.recoverpoint.exceptions.RecoverPointException) CGRequestParams(com.emc.storageos.recoverpoint.requests.CGRequestParams)

Example 14 with RecoverPointVolumeProtectionInfo

use of com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo in project coprhd-controller by CoprHD.

the class RecoverPointClient method getCopyAccessStates.

/**
 * Checks to see if the given copy is in direct access state.
 *
 * @param copyToExamine the copy to check for direct access state
 * @return true if the given copy is in direct access state, false otherwise
 */
public Map<String, String> getCopyAccessStates(Set<String> rpWWNs) {
    Map<String, String> copyAccessStates = new HashMap<String, String>();
    if (rpWWNs != null) {
        for (String wwn : rpWWNs) {
            RecoverPointVolumeProtectionInfo protectionInfo = getProtectionInfoForVolume(wwn);
            ConsistencyGroupCopyUID cgCopyUID = RecoverPointUtils.mapRPVolumeProtectionInfoToCGCopyUID(protectionInfo);
            if (cgCopyUID != null) {
                RecoverPointImageManagementUtils imageManager = new RecoverPointImageManagementUtils();
                ConsistencyGroupCopyState copyState = imageManager.getCopyState(functionalAPI, cgCopyUID);
                if (copyState != null) {
                    StorageAccessState copyAccessState = copyState.getStorageAccessState();
                    copyAccessStates.put(wwn, copyAccessState.name());
                }
            }
        }
    }
    logger.info(String.format("Access states for requested copies: %s", copyAccessStates));
    return copyAccessStates;
}
Also used : RecoverPointVolumeProtectionInfo(com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo) HashMap(java.util.HashMap) ConsistencyGroupCopyState(com.emc.fapiclient.ws.ConsistencyGroupCopyState) StorageAccessState(com.emc.fapiclient.ws.StorageAccessState) RecoverPointImageManagementUtils(com.emc.storageos.recoverpoint.utils.RecoverPointImageManagementUtils) ConsistencyGroupCopyUID(com.emc.fapiclient.ws.ConsistencyGroupCopyUID)

Example 15 with RecoverPointVolumeProtectionInfo

use of com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo in project coprhd-controller by CoprHD.

the class RecoverPointClient method failoverCopyTestCancel.

/**
 * Cancel a failover test for a consistency group copy specified by the input request params.
 *
 * @param RPCopyRequestParams copyToFailoverTo - Volume info for the CG that a previous failover test was performed on
 *
 * @return void
 *
 * @throws RecoverPointException
 */
public void failoverCopyTestCancel(RPCopyRequestParams copyToFailoverTo) throws RecoverPointException {
    RecoverPointVolumeProtectionInfo failoverCopyInfo = copyToFailoverTo.getCopyVolumeInfo();
    resumeTransfer(failoverCopyInfo);
    RecoverPointImageManagementUtils imageManager = new RecoverPointImageManagementUtils();
    imageManager.disableCopyImage(functionalAPI, copyToFailoverTo);
}
Also used : RecoverPointVolumeProtectionInfo(com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo) RecoverPointImageManagementUtils(com.emc.storageos.recoverpoint.utils.RecoverPointImageManagementUtils)

Aggregations

RecoverPointVolumeProtectionInfo (com.emc.storageos.recoverpoint.responses.RecoverPointVolumeProtectionInfo)22 RecoverPointException (com.emc.storageos.recoverpoint.exceptions.RecoverPointException)15 Volume (com.emc.storageos.db.client.model.Volume)7 RecoverPointClient (com.emc.storageos.recoverpoint.impl.RecoverPointClient)7 ArrayList (java.util.ArrayList)7 FunctionalAPIActionFailedException_Exception (com.emc.fapiclient.ws.FunctionalAPIActionFailedException_Exception)5 FunctionalAPIInternalError_Exception (com.emc.fapiclient.ws.FunctionalAPIInternalError_Exception)5 RPCopyRequestParams (com.emc.storageos.recoverpoint.requests.RPCopyRequestParams)5 URISyntaxException (java.net.URISyntaxException)5 CoordinatorException (com.emc.storageos.coordinator.exceptions.CoordinatorException)3 NamedURI (com.emc.storageos.db.client.model.NamedURI)3 ProtectionSet (com.emc.storageos.db.client.model.ProtectionSet)3 ProtectionSystem (com.emc.storageos.db.client.model.ProtectionSystem)3 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)3 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)3 LockRetryException (com.emc.storageos.locking.LockRetryException)3 RecoverPointImageManagementUtils (com.emc.storageos.recoverpoint.utils.RecoverPointImageManagementUtils)3 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)3 URI (java.net.URI)3 ConsistencyGroupCopyUID (com.emc.fapiclient.ws.ConsistencyGroupCopyUID)2