Search in sources :

Example 1 with SmisBlockSnapshotSessionCGCreateJob

use of com.emc.storageos.volumecontroller.impl.smis.job.SmisBlockSnapshotSessionCGCreateJob in project coprhd-controller by CoprHD.

the class VmaxSnapshotOperations method createGroupSnapshotSession.

/**
 * {@inheritDoc}
 */
@Override
public void createGroupSnapshotSession(StorageSystem system, URI snapSessionURI, String groupName, TaskCompleter completer) throws DeviceControllerException {
    if (system.checkIfVmax3()) {
        _log.info("Create snapshot session group operation START");
        BlockSnapshotSession snapSession = _dbClient.queryObject(BlockSnapshotSession.class, snapSessionURI);
        BlockConsistencyGroup consistencyGroup = _dbClient.queryObject(BlockConsistencyGroup.class, snapSession.getConsistencyGroup());
        TenantOrg tenant = _dbClient.queryObject(TenantOrg.class, consistencyGroup.getTenant().getURI());
        String tenantName = tenant.getLabel();
        final String label = _nameGenerator.generate(tenantName, snapSession.getSessionLabel(), snapSessionURI.toString(), '-', SmisConstants.MAX_SMI80_SNAPSHOT_NAME_LENGTH);
        CIMObjectPath groupPath = _cimPath.getReplicationGroupPath(system, groupName);
        try {
            CIMObjectPath replicationSvcPath = _cimPath.getControllerReplicationSvcPath(system);
            CIMArgument[] outArgs = new CIMArgument[5];
            CIMArgument[] inArgs = _helper.getCreateSynchronizationAspectForGroupInput(groupPath, false, label, new Integer(SmisConstants.MODE_SYNCHRONOUS));
            _helper.invokeMethod(system, replicationSvcPath, SmisConstants.CREATE_SYNCHRONIZATION_ASPECT, inArgs, outArgs);
            CIMObjectPath jobPath = _cimPath.getCimObjectPathFromOutputArgs(outArgs, SmisConstants.JOB);
            ControllerServiceImpl.enqueueJob(new QueueJob(new SmisBlockSnapshotSessionCGCreateJob(jobPath, system.getId(), completer)));
        } catch (Exception e) {
            _log.error("Exception creating group snapshot session ", e);
            ServiceError error = DeviceControllerErrors.smis.unableToCallStorageProvider(e.getMessage());
            completer.error(_dbClient, error);
        }
        _log.info("Create snapshot session group operation FINISH");
    } else {
        throw DeviceControllerException.exceptions.blockDeviceOperationNotSupported();
    }
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) BlockSnapshotSession(com.emc.storageos.db.client.model.BlockSnapshotSession) TenantOrg(com.emc.storageos.db.client.model.TenantOrg) CIMObjectPath(javax.cim.CIMObjectPath) SmisBlockSnapshotSessionCGCreateJob(com.emc.storageos.volumecontroller.impl.smis.job.SmisBlockSnapshotSessionCGCreateJob) QueueJob(com.emc.storageos.volumecontroller.impl.job.QueueJob) SmisException(com.emc.storageos.volumecontroller.impl.smis.SmisException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WBEMException(javax.wbem.WBEMException) BlockConsistencyGroup(com.emc.storageos.db.client.model.BlockConsistencyGroup) CIMArgument(javax.cim.CIMArgument)

Aggregations

BlockConsistencyGroup (com.emc.storageos.db.client.model.BlockConsistencyGroup)1 BlockSnapshotSession (com.emc.storageos.db.client.model.BlockSnapshotSession)1 TenantOrg (com.emc.storageos.db.client.model.TenantOrg)1 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)1 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)1 QueueJob (com.emc.storageos.volumecontroller.impl.job.QueueJob)1 SmisException (com.emc.storageos.volumecontroller.impl.smis.SmisException)1 SmisBlockSnapshotSessionCGCreateJob (com.emc.storageos.volumecontroller.impl.smis.job.SmisBlockSnapshotSessionCGCreateJob)1 CIMArgument (javax.cim.CIMArgument)1 CIMObjectPath (javax.cim.CIMObjectPath)1 WBEMException (javax.wbem.WBEMException)1