use of com.emc.storageos.volumecontroller.impl.smis.job.SmisBlockResumeSnapshotJob in project coprhd-controller by CoprHD.
the class VmaxSnapshotOperations method resumeSnapshot.
/**
* Routine will call SMI-S ModifyReplicaSynchronization to resume a synchronization instance.
* The operation is a counter-intuitive; it will terminate a RESTORE session between
* target and source. This was the suggestion based on input from SMI-S team.
* See OPT 443785.
*
* @param storage [in] - StorageSystem object representing the array
* @param from [in] - Should be the snapshot object
* @param blockObject [in] - Should be the volume object
* @param syncObject [in] - A CIMObjectPath representing the SMI-S synchronization object tying
* from and blockObject together, along with other related consistency group members
* @param taskCompleter [in] - TaskCompleter used for updating status of operation
* @return true if the resume operation was successfully performed on the synchronization
* @throws WBEMException
*/
private boolean resumeSnapshot(StorageSystem storage, BlockObject from, BlockObject blockObject, CIMObjectPath syncObject, TaskCompleter taskCompleter) throws WBEMException {
boolean wasResumed = false;
SmisBlockResumeSnapshotJob job = new SmisBlockResumeSnapshotJob(null, storage.getId(), new TaskCompleter() {
@Override
protected void complete(DbClient dbClient, Operation.Status status, ServiceCoded coded) throws DeviceControllerException {
}
});
CIMArgument[] result = new CIMArgument[5];
try {
if (storage.checkIfVmax3()) {
_helper.invokeMethodSynchronously(storage, _cimPath.getControllerReplicationSvcPath(storage), SmisConstants.MODIFY_SETTINGS_DEFINE_STATE, _helper.getEMCResumeInputArguments(syncObject), result, job);
} else if (storage.getUsingSmis80()) {
/**
* VMAX2 managed by 8.* SMIS
* We need to pass Operation = 16
*/
_helper.invokeMethodSynchronously(storage, _cimPath.getControllerReplicationSvcPath(storage), SmisConstants.MODIFY_REPLICA_SYNCHRONIZATION, _helper.getResumeSnapshotSynchronizationInputArguments(syncObject), result, job);
} else {
/**
* VMAX2 managed by 4.6.2 SMI provider
* We need to pass Operation = 14
*/
_helper.invokeMethodSynchronously(storage, _cimPath.getControllerReplicationSvcPath(storage), SmisConstants.MODIFY_REPLICA_SYNCHRONIZATION, _helper.getResumeSynchronizationInputArguments(syncObject), result, job);
}
} catch (Exception e) {
/*
* May be ignored if message is about invalid device state, since when
* dealing with multiple GroupSynchronized instances, we attempt to resume
* all of them.
*/
_log.info("Encountered exception which may be ignored: {}", e.getMessage());
}
if (job.isSuccess()) {
_log.info("Synchronization was successfully resumed: {}", syncObject);
wasResumed = true;
} else {
_log.info("Synchronization was not resumed and can be ignored: {}", syncObject);
}
return wasResumed;
}
Aggregations