use of com.emc.storageos.volumecontroller.impl.isilon.job.IsilonSyncJobResync in project coprhd-controller by CoprHD.
the class IsilonMirrorOperations method doResyncPrep.
/**
* Call to resync-prep
*
* @param system
* @param policyName
* @param completer
* @return
* @throws IsilonException
*/
public BiosCommandResult doResyncPrep(StorageSystem system, String policyName, TaskCompleter completer) throws IsilonException {
try {
_log.info("resync-prep between source file system to target file system started and device ip:", system.getIpAddress());
IsilonApi isi = getIsilonDevice(system);
IsilonSyncPolicy syncPolicy = isi.getReplicationPolicy(policyName);
// Before 'resync-prep' operation, Original source to target policy should be enabled.
if (!syncPolicy.getEnabled()) {
_log.info("Policy {} is in disabled state, enabling the policy before do resync-prep", policyName);
syncPolicy = doEnableReplicationPolicy(isi, policyName);
_log.info("Sleeping for 40 seconds for cancel operation to complete...");
TimeUnit.SECONDS.sleep(40);
syncPolicy = isi.getReplicationPolicy(policyName);
_log.info("Replication Policy -{} Enabled successfully.", syncPolicy.toString());
}
IsilonSyncJob job = new IsilonSyncJob();
job.setId(policyName);
job.setAction(Action.resync_prep);
isi.modifyReplicationJob(job);
IsilonSyncJobResync isilonSyncJobResync = new IsilonSyncJobResync(policyName, system.getId(), completer);
ControllerServiceImpl.enqueueJob(new QueueJob(isilonSyncJobResync));
return BiosCommandResult.createPendingResult();
} catch (Exception ex) {
_log.error("Resync-Prep Failed", ex);
ServiceError error = DeviceControllerErrors.isilon.jobFailed("Resync-Prep FAILED as : " + ex.getMessage());
if (completer != null) {
completer.error(_dbClient, error);
}
return BiosCommandResult.createErrorResult(error);
}
}
Aggregations