Search in sources :

Example 1 with SmisBlockDeleteListReplicaJob

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

the class AbstractReplicaOperations method deleteListReplica.

@Override
public void deleteListReplica(StorageSystem storage, List<URI> replicaList, TaskCompleter taskCompleter) throws DeviceControllerException {
    _log.info("deleteListReplica operation START");
    if (!((storage.getUsingSmis80() && storage.deviceIsType(Type.vmax)) || storage.deviceIsType(Type.vnxblock))) {
        throw DeviceControllerException.exceptions.blockDeviceOperationNotSupported();
    }
    try {
        String[] deviceIds = _helper.getBlockObjectNativeIds(replicaList);
        if (storage.checkIfVmax3()) {
            _helper.removeVolumeFromParkingSLOStorageGroup(storage, deviceIds, false);
            _log.info("Done invoking remove volumes from parking SLO storage group");
        }
        CIMObjectPath[] devicePaths = _cimPath.getVolumePaths(storage, deviceIds);
        CIMObjectPath configSvcPath = _cimPath.getConfigSvcPath(storage);
        CIMArgument[] inArgs = null;
        if (storage.deviceIsType(Type.vnxblock)) {
            inArgs = _helper.getReturnElementsToStoragePoolArguments(devicePaths);
        } else {
            inArgs = _helper.getReturnElementsToStoragePoolArguments(devicePaths, SmisConstants.CONTINUE_ON_NONEXISTENT_ELEMENT);
        }
        CIMArgument[] outArgs = new CIMArgument[5];
        _helper.invokeMethod(storage, configSvcPath, SmisConstants.RETURN_ELEMENTS_TO_STORAGE_POOL, inArgs, outArgs);
        CIMObjectPath job = _cimPath.getCimObjectPathFromOutputArgs(outArgs, SmisConstants.JOB);
        ControllerServiceImpl.enqueueJob(new QueueJob(new SmisBlockDeleteListReplicaJob(job, storage.getId(), taskCompleter)));
    } catch (Exception e) {
        _log.error("Problem making SMI-S call: ", e);
        ServiceError serviceError = DeviceControllerErrors.smis.unableToCallStorageProvider(e.getMessage());
        taskCompleter.error(_dbClient, serviceError);
    }
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) SmisBlockDeleteListReplicaJob(com.emc.storageos.volumecontroller.impl.smis.job.SmisBlockDeleteListReplicaJob) CIMObjectPath(javax.cim.CIMObjectPath) QueueJob(com.emc.storageos.volumecontroller.impl.job.QueueJob) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) CIMArgument(javax.cim.CIMArgument)

Aggregations

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 SmisBlockDeleteListReplicaJob (com.emc.storageos.volumecontroller.impl.smis.job.SmisBlockDeleteListReplicaJob)1 CIMArgument (javax.cim.CIMArgument)1 CIMObjectPath (javax.cim.CIMObjectPath)1