public DriverTask removeVolumesFromConsistencyGroup(List<StorageVolume> volumes,StorageCapabilities capabilities){
  DellSCDriverTask task=new DellSCDriverTask("removeVolumeFromCG");
  StringBuilder errBuffer=new StringBuilder();
  int removeCount=0;
  for (  StorageVolume volume : volumes) {
    String ssn=volume.getStorageSystemId();
    try {
      StorageCenterAPI api=connectionManager.getConnection(ssn);
      api.removeVolumeFromConsistencyGroup(volume.getNativeId(),volume.getConsistencyGroup());
      removeCount++;
    }
 catch (    StorageCenterAPIException|DellSCDriverException dex) {
      String error=String.format("Error adding volume %s to consistency group: %s",volume.getNativeId(),dex);
      LOG.warn(error);
      errBuffer.append(String.format("%s%n",error));
    }
  }
  task.setMessage(errBuffer.toString());
  if (removeCount == volumes.size()) {
    task.setStatus(TaskStatus.READY);
  }
 else   if (removeCount == 0) {
    task.setStatus(TaskStatus.FAILED);
  }
 else {
    task.setStatus(TaskStatus.PARTIALLY_FAILED);
  }
  return task;
}

public DriverTask removeVolumesFromConsistencyGroup ( List < StorageVolume > volumes , StorageCapabilities capabilities ) { DellSCDriverTask task = new DellSCDriverTask ( "removeVolumeFromCG" ) ; StringBuilder errBuffer = new StringBuilder ( ) ; int removeCount = 0 ; for ( StorageVolume volume : volumes ) { String ssn = volume . getStorageSystemId ( ) ; try { StorageCenterAPI api = connectionManager . getConnection ( ssn ) ; api . removeVolumeFromConsistencyGroup ( volume . getNativeId ( ) , volume . getConsistencyGroup ( ) ) ; removeCount ++ ; } catch ( StorageCenterAPIException | DellSCDriverException dex ) { String error = String . format ( "Error adding volume %s to consistency group: %s" , volume . getNativeId ( ) , dex ) ; LOG . warn ( error ) ; errBuffer . append ( String . format ( "%s%n" , error ) ) ; } } task . setMessage ( errBuffer . toString ( ) ) ; if ( removeCount == volumes . size ( ) ) { task . setStatus ( TaskStatus . READY ) ; } else if ( removeCount == 0 ) { task . setStatus ( TaskStatus . FAILED ) ; } else { task . setStatus ( TaskStatus . PARTIALLY_FAILED ) ; } return task ; }
remove volumes from consistency groups .
