Search in sources :

Example 1 with SmisCreateMetaVolumeMembersJob

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

the class SmisMetaVolumeOperations method createMetaVolumeMembers.

/**
 * Create meta volume member devices. These devices provide capacity to meta volume.
 * SMI-S requires that these devices be created unbound form a pool.
 *
 * @param storageSystem
 * @param storagePool
 * @param metaHead
 * @param memberCount
 * @param memberCapacity
 * @param metaVolumeTaskCompleter
 * @return list of native ids of meta member devices
 * @throws Exception
 */
@Override
public List<String> createMetaVolumeMembers(StorageSystem storageSystem, StoragePool storagePool, Volume metaHead, int memberCount, long memberCapacity, MetaVolumeTaskCompleter metaVolumeTaskCompleter) throws Exception {
    _log.info(String.format("Create Meta Volume Members Start - Array: %s, Pool: %s, %n   Volume: %s, Count:%s, Member capacity: %s", storageSystem.getSerialNumber(), storagePool.getNativeId(), metaHead.getLabel(), memberCount, memberCapacity));
    try {
        boolean isThinlyProvisioned = metaHead.getThinlyProvisioned();
        CIMObjectPath configSvcPath = _cimPath.getConfigSvcPath(storageSystem);
        CIMArgument[] inArgs;
        // Prepare parameters and call method to create meta members
        inArgs = _helper.getCreateMetaVolumeMembersInputArguments(storageSystem, storagePool, memberCount, memberCapacity, isThinlyProvisioned);
        CIMArgument[] outArgs = new CIMArgument[5];
        StorageSystem forProvider = _helper.getStorageSystemForProvider(storageSystem, metaHead);
        _log.info("Selected Provider : {}", forProvider.getNativeGuid());
        SmisCreateMetaVolumeMembersJob smisJobCompleter = new SmisCreateMetaVolumeMembersJob(null, forProvider.getId(), metaHead, memberCount, metaVolumeTaskCompleter);
        _helper.invokeMethodSynchronously(forProvider, configSvcPath, SmisConstants.CREATE_OR_MODIFY_ELEMENT_FROM_STORAGE_POOL, inArgs, outArgs, smisJobCompleter);
        return smisJobCompleter.getMetaMembers();
    } catch (WBEMException e) {
        _log.error("Problem making SMI-S call: ", e);
        ServiceError error = DeviceControllerErrors.smis.unableToCallStorageProvider(e.getMessage());
        metaVolumeTaskCompleter.getVolumeTaskCompleter().error(_dbClient, error);
        throw e;
    } catch (Exception e) {
        _log.error("Problem in createMetaVolumeMembers: ", e);
        ServiceError error = DeviceControllerErrors.smis.methodFailed("createMetaVolumeMemebers", e.getMessage());
        metaVolumeTaskCompleter.getVolumeTaskCompleter().error(_dbClient, error);
        throw e;
    } finally {
        _log.info(String.format("Create Meta Volume Members End - Array: %s, Pool: %s, %n   Volume: %s", storageSystem.getSerialNumber(), storagePool.getNativeId(), metaHead.getLabel()));
    }
}
Also used : ServiceError(com.emc.storageos.svcs.errorhandling.model.ServiceError) SmisCreateMetaVolumeMembersJob(com.emc.storageos.volumecontroller.impl.smis.job.SmisCreateMetaVolumeMembersJob) CIMObjectPath(javax.cim.CIMObjectPath) WBEMException(javax.wbem.WBEMException) WBEMException(javax.wbem.WBEMException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException) DeviceControllerException(com.emc.storageos.exceptions.DeviceControllerException) CIMArgument(javax.cim.CIMArgument) StorageSystem(com.emc.storageos.db.client.model.StorageSystem)

Aggregations

StorageSystem (com.emc.storageos.db.client.model.StorageSystem)1 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)1 DeviceControllerException (com.emc.storageos.exceptions.DeviceControllerException)1 ServiceError (com.emc.storageos.svcs.errorhandling.model.ServiceError)1 SmisCreateMetaVolumeMembersJob (com.emc.storageos.volumecontroller.impl.smis.job.SmisCreateMetaVolumeMembersJob)1 CIMArgument (javax.cim.CIMArgument)1 CIMObjectPath (javax.cim.CIMObjectPath)1 WBEMException (javax.wbem.WBEMException)1