Search in sources :

Example 1 with SmisDeleteVmaxCGTargetVolumesJob

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

the class VmaxSnapshotOperations method deleteTargetDevices.

/**
 * Method will invoke the SMI-S operation to return the Volumes represented by the native ids to the storage pool
 *
 * @param storageSystem - StorageSystem where the pool and volume exist
 * @param deviceIds - List of native Ids representing the elements to be returned to the pool
 * @param taskCompleter - Completer object used for task status update
 *
 * @throws DeviceControllerException
 */
private void deleteTargetDevices(final StorageSystem storageSystem, final String[] deviceIds, final TaskCompleter taskCompleter) {
    _log.info(format("Removing target devices {0} from storage system {1}", Joiner.on("\t").join(deviceIds), storageSystem.getId()));
    try {
        if (storageSystem.checkIfVmax3()) {
            _helper.removeVolumeFromParkingSLOStorageGroup(storageSystem, deviceIds, false);
            _log.info("Done invoking remove volumes from parking SLO storage group");
        }
        final CIMObjectPath configSvcPath = _cimPath.getConfigSvcPath(storageSystem);
        final CIMObjectPath[] theElements = _cimPath.getVolumePaths(storageSystem, deviceIds);
        final CIMArgument[] inArgs = _helper.getReturnElementsToStoragePoolArguments(theElements, SmisConstants.CONTINUE_ON_NONEXISTENT_ELEMENT);
        final CIMArgument[] outArgs = new CIMArgument[5];
        final SmisDeleteVmaxCGTargetVolumesJob job = new SmisDeleteVmaxCGTargetVolumesJob(null, storageSystem.getId(), deviceIds, taskCompleter);
        _helper.invokeMethodSynchronously(storageSystem, configSvcPath, RETURN_ELEMENTS_TO_STORAGE_POOL, inArgs, outArgs, job);
    } catch (Exception e) {
        _log.error(format("An error occurred when removing target devices {0} from storage system {1}", Joiner.on("\t").join(deviceIds), storageSystem.getId()), e);
    }
}
Also used : CIMObjectPath(javax.cim.CIMObjectPath) SmisDeleteVmaxCGTargetVolumesJob(com.emc.storageos.volumecontroller.impl.smis.job.SmisDeleteVmaxCGTargetVolumesJob) SmisException(com.emc.storageos.volumecontroller.impl.smis.SmisException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WBEMException(javax.wbem.WBEMException) CIMArgument(javax.cim.CIMArgument)

Example 2 with SmisDeleteVmaxCGTargetVolumesJob

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

the class ReplicationUtils method deleteTargetDevices.

/**
 * Method will invoke the SMI-S operation to return the Volumes represented by the native ids to the storage pool
 *
 * @param storageSystem - StorageSystem where the pool and volume exist
 * @param deviceIds - List of native Ids representing the elements to be returned to the pool
 * @param taskCompleter - Completer object used for task status update
 *
 * @throws DeviceControllerException
 */
public static void deleteTargetDevices(final StorageSystem storageSystem, final String[] deviceIds, final TaskCompleter taskCompleter, final DbClient dbClient, final SmisCommandHelper helper, final CIMObjectPathFactory cimPath) {
    _log.info(format("Removing target devices {0} from storage system {1}", Joiner.on(',').join(deviceIds), storageSystem.getId()));
    try {
        if (storageSystem.checkIfVmax3()) {
            helper.removeVolumeFromParkingSLOStorageGroup(storageSystem, deviceIds, false);
            _log.info("Done invoking remove volumes from parking SLO storage group");
        }
        CIMArgument[] outArgs = new CIMArgument[5];
        CIMArgument[] inArgs = null;
        String method = null;
        CIMObjectPath configSvcPath = cimPath.getConfigSvcPath(storageSystem);
        if (storageSystem.deviceIsType(Type.vmax)) {
            final CIMObjectPath[] theElements = cimPath.getVolumePaths(storageSystem, deviceIds);
            inArgs = helper.getReturnElementsToStoragePoolArguments(theElements, SmisConstants.CONTINUE_ON_NONEXISTENT_ELEMENT);
            method = RETURN_ELEMENTS_TO_STORAGE_POOL;
        } else {
            inArgs = helper.getDeleteVolumesInputArguments(storageSystem, deviceIds);
            method = EMC_RETURN_TO_STORAGE_POOL;
        }
        final SmisDeleteVmaxCGTargetVolumesJob job = new SmisDeleteVmaxCGTargetVolumesJob(null, storageSystem.getId(), deviceIds, taskCompleter);
        helper.invokeMethodSynchronously(storageSystem, configSvcPath, method, inArgs, outArgs, job);
    } catch (Exception e) {
        _log.error(format("An error occurred when removing target devices {0} from storage system {1}", deviceIds, storageSystem.getId()), e);
    }
}
Also used : CIMObjectPath(javax.cim.CIMObjectPath) SmisDeleteVmaxCGTargetVolumesJob(com.emc.storageos.volumecontroller.impl.smis.job.SmisDeleteVmaxCGTargetVolumesJob) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) WBEMException(javax.wbem.WBEMException) CIMArgument(javax.cim.CIMArgument)

Aggregations

DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)2 SmisDeleteVmaxCGTargetVolumesJob (com.emc.storageos.volumecontroller.impl.smis.job.SmisDeleteVmaxCGTargetVolumesJob)2 CIMArgument (javax.cim.CIMArgument)2 CIMObjectPath (javax.cim.CIMObjectPath)2 WBEMException (javax.wbem.WBEMException)2 SmisException (com.emc.storageos.volumecontroller.impl.smis.SmisException)1