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()));
}
}
Aggregations