@Override public void deleteBCVHelperVolume(StorageSystem storageSystem,Volume volume) throws Exception {
  _log.info(String.format("Start executing BCV helper volume from array: %s, for volume: %s",storageSystem.getId(),volume.getId()));
  try {
    String deviceName=volume.getNativeId();
    String deviceNameWithoutLeadingZeros=deviceName.replaceAll("^0*","");
    String query=String.format("SELECT CIM_StorageVolume.%s, CIM_StorageVolume.%s  FROM CIM_StorageVolume where CIM_StorageVolume.%s ='SMI_BCV_META_%s'",SmisConstants.CP_ELEMENT_NAME,SmisConstants.CP_DEVICE_ID,SmisConstants.CP_ELEMENT_NAME,deviceNameWithoutLeadingZeros);
    String queryLanguage="CQL";
    List<CIMInstance> bcvVolumeInstanceList=_helper.executeQuery(storageSystem,query,queryLanguage);
    if (bcvVolumeInstanceList == null || bcvVolumeInstanceList.isEmpty()) {
      query=String.format("SELECT CIM_StorageVolume.%s, CIM_StorageVolume.%s FROM CIM_StorageVolume where CIM_StorageVolume.%s ='SMI_BCV_META_%s'",SmisConstants.CP_ELEMENT_NAME,SmisConstants.CP_DEVICE_ID,SmisConstants.CP_ELEMENT_NAME,deviceName);
      bcvVolumeInstanceList=_helper.executeQuery(storageSystem,query,queryLanguage);
    }
    String elementName=null;
    String nativeId=null;
    CIMInstance bcvVolumeInstance=null;
    if (bcvVolumeInstanceList != null && !bcvVolumeInstanceList.isEmpty()) {
      bcvVolumeInstance=bcvVolumeInstanceList.get(0);
      elementName=CIMPropertyFactory.getPropertyValue(bcvVolumeInstance,SmisConstants.CP_ELEMENT_NAME);
      nativeId=CIMPropertyFactory.getPropertyValue(bcvVolumeInstance,SmisConstants.CP_DEVICE_ID);
      _log.info(String.format("Found BCV helper volume: %s, nativeId: %s",elementName,nativeId));
    }
 else {
      _log.warn(String.format("Could not find BCV helper volume for volume: %s, nativeId: %s",volume.getId(),volume.getNativeId()));
      return;
    }
    _log.info(String.format("Executing delete of BCV helper volume: " + nativeId));
    String[] nativeIds=new String[]{nativeId};
    CIMObjectPath configSvcPath=_cimPath.getConfigSvcPath(storageSystem);
    CIMArgument[] inArgs=_helper.getDeleteVolumesInputArguments(storageSystem,nativeIds);
    CIMArgument[] outArgs=new CIMArgument[5];
    String returnElementsMethod;
    if (storageSystem.getUsingSmis80()) {
      returnElementsMethod=SmisConstants.RETURN_ELEMENTS_TO_STORAGE_POOL;
    }
 else {
      returnElementsMethod=SmisConstants.EMC_RETURN_TO_STORAGE_POOL;
    }
    _helper.invokeMethodSynchronously(storageSystem,configSvcPath,returnElementsMethod,inArgs,outArgs,null);
    _log.info(String.format("Deleted BCV helper volume: " + nativeId));
  }
 catch (  Exception ex) {
    _log.error(String.format("Failed to delete BCV helper volume from array: %s, for volume: %s",storageSystem.getId(),volume.getId()));
  }
}

@ Override public void deleteBCVHelperVolume ( StorageSystem storageSystem , Volume volume ) throws Exception { _log . info ( String . format ( "Start executing BCV helper volume from array: %s, for volume: %s" , storageSystem . getId ( ) , volume . getId ( ) ) ) ; try { String deviceName = volume . getNativeId ( ) ; String deviceNameWithoutLeadingZeros = deviceName . replaceAll ( "^0*" , "" ) ; String query = String . format ( "SELECT CIM_StorageVolume.%s, CIM_StorageVolume.%s  FROM CIM_StorageVolume where CIM_StorageVolume.%s ='SMI_BCV_META_%s'" , SmisConstants . CP_ELEMENT_NAME , SmisConstants . CP_DEVICE_ID , SmisConstants . CP_ELEMENT_NAME , deviceNameWithoutLeadingZeros ) ; String queryLanguage = "CQL" ; List < CIMInstance > bcvVolumeInstanceList = _helper . executeQuery ( storageSystem , query , queryLanguage ) ; if ( bcvVolumeInstanceList == null || bcvVolumeInstanceList . isEmpty ( ) ) { query = String . format ( "SELECT CIM_StorageVolume.%s, CIM_StorageVolume.%s FROM CIM_StorageVolume where CIM_StorageVolume.%s ='SMI_BCV_META_%s'" , SmisConstants . CP_ELEMENT_NAME , SmisConstants . CP_DEVICE_ID , SmisConstants . CP_ELEMENT_NAME , deviceName ) ; bcvVolumeInstanceList = _helper . executeQuery ( storageSystem , query , queryLanguage ) ; } String elementName = null ; String nativeId = null ; CIMInstance bcvVolumeInstance = null ; if ( bcvVolumeInstanceList != null && ! bcvVolumeInstanceList . isEmpty ( ) ) { bcvVolumeInstance = bcvVolumeInstanceList . get ( 0 ) ; elementName = CIMPropertyFactory . getPropertyValue ( bcvVolumeInstance , SmisConstants . CP_ELEMENT_NAME ) ; nativeId = CIMPropertyFactory . getPropertyValue ( bcvVolumeInstance , SmisConstants . CP_DEVICE_ID ) ; _log . info ( String . format ( "Found BCV helper volume: %s, nativeId: %s" , elementName , nativeId ) ) ; } else { _log . warn ( String . format ( "Could not find BCV helper volume for volume: %s, nativeId: %s" , volume . getId ( ) , volume . getNativeId ( ) ) ) ; return ; } _log . info ( String . format ( "Executing delete of BCV helper volume: " + nativeId ) ) ; String [ ] nativeIds = new String [ ] { nativeId } ; CIMObjectPath configSvcPath = _cimPath . getConfigSvcPath ( storageSystem ) ; CIMArgument [ ] inArgs = _helper . getDeleteVolumesInputArguments ( storageSystem , nativeIds ) ; CIMArgument [ ] outArgs = new CIMArgument [ 5 ] ; String returnElementsMethod ; if ( storageSystem . getUsingSmis80 ( ) ) { returnElementsMethod = SmisConstants . RETURN_ELEMENTS_TO_STORAGE_POOL ; } else { returnElementsMethod = SmisConstants . EMC_RETURN_TO_STORAGE_POOL ; } _helper . invokeMethodSynchronously ( storageSystem , configSvcPath , returnElementsMethod , inArgs , outArgs , null ) ; _log . info ( String . format ( "Deleted BCV helper volume: " + nativeId ) ) ; } catch ( Exception ex ) { _log . error ( String . format ( "Failed to delete BCV helper volume from array: %s, for volume: %s" , storageSystem . getId ( ) , volume . getId ( ) ) ) ; } }
deletes ' smi_bcv_meta_ . . . ' helper volume form array .
