private void computeCapacityforSRDFV3ToV2(Volume targetVolume,final VirtualPool vpool){
  if (targetVolume == null) {
    return;
  }
  StorageSystem targetSystem=_dbClient.queryObject(StorageSystem.class,targetVolume.getStorageController());
  StoragePool targetPool=_dbClient.queryObject(StoragePool.class,targetVolume.getPool());
  Volume sourceVolume=_dbClient.queryObject(Volume.class,targetVolume.getSrdfParent());
  StorageSystem sourceSystem=_dbClient.queryObject(StorageSystem.class,sourceVolume.getStorageController());
  StoragePool sourcePool=_dbClient.queryObject(StoragePool.class,sourceVolume.getPool());
  if (sourceSystem != null && targetSystem != null) {
    boolean isCapacityReset=false;
    if (sourcePool != null && targetPool != null) {
      MetaVolumeRecommendation sourceVolumeRecommendation=MetaVolumeUtils.getCreateRecommendation(sourceSystem,sourcePool,sourceVolume.getCapacity(),sourceVolume.getThinlyProvisioned(),vpool.getFastExpansion(),null);
      MetaVolumeRecommendation targetVolumeRecommendation=MetaVolumeUtils.getCreateRecommendation(targetSystem,targetPool,targetVolume.getCapacity(),targetVolume.getThinlyProvisioned(),vpool.getFastExpansion(),null);
      isCapacityReset=computeCapacityforSRDFV3ToV2Meta(sourcePool,targetPool,sourceVolume,targetVolume,sourceVolumeRecommendation,targetVolumeRecommendation);
    }
    if (sourceSystem.checkIfVmax3() && !targetSystem.checkIfVmax3() && !isCapacityReset) {
      Long cylinderCount=(long)Math.ceil((double)targetVolume.getCapacity() / V3CYLINDERSIZE);
      targetVolume.setCapacity(cylinderCount * V3CYLINDERSIZE);
      _log.info("Cylinder Count : {}, VMAX2 volume Capacity : {}",cylinderCount,targetVolume.getCapacity());
    }
  }
}

private void computeCapacityforSRDFV3ToV2 ( Volume targetVolume , final VirtualPool vpool ) { if ( targetVolume == null ) { return ; } StorageSystem targetSystem = _dbClient . queryObject ( StorageSystem . class , targetVolume . getStorageController ( ) ) ; StoragePool targetPool = _dbClient . queryObject ( StoragePool . class , targetVolume . getPool ( ) ) ; Volume sourceVolume = _dbClient . queryObject ( Volume . class , targetVolume . getSrdfParent ( ) ) ; StorageSystem sourceSystem = _dbClient . queryObject ( StorageSystem . class , sourceVolume . getStorageController ( ) ) ; StoragePool sourcePool = _dbClient . queryObject ( StoragePool . class , sourceVolume . getPool ( ) ) ; if ( sourceSystem != null && targetSystem != null ) { boolean isCapacityReset = false ; if ( sourcePool != null && targetPool != null ) { MetaVolumeRecommendation sourceVolumeRecommendation = MetaVolumeUtils . getCreateRecommendation ( sourceSystem , sourcePool , sourceVolume . getCapacity ( ) , sourceVolume . getThinlyProvisioned ( ) , vpool . getFastExpansion ( ) , null ) ; MetaVolumeRecommendation targetVolumeRecommendation = MetaVolumeUtils . getCreateRecommendation ( targetSystem , targetPool , targetVolume . getCapacity ( ) , targetVolume . getThinlyProvisioned ( ) , vpool . getFastExpansion ( ) , null ) ; isCapacityReset = computeCapacityforSRDFV3ToV2Meta ( sourcePool , targetPool , sourceVolume , targetVolume , sourceVolumeRecommendation , targetVolumeRecommendation ) ; } if ( sourceSystem . checkIfVmax3 ( ) && ! targetSystem . checkIfVmax3 ( ) && ! isCapacityReset ) { Long cylinderCount = ( long ) Math . ceil ( ( double ) targetVolume . getCapacity ( ) / V3CYLINDERSIZE ) ; targetVolume . setCapacity ( cylinderCount * V3CYLINDERSIZE ) ; _log . info ( "Cylinder Count : {}, VMAX2 volume Capacity : {}" , cylinderCount , targetVolume . getCapacity ( ) ) ; } } }
srdf between vmax3 to vmax2 is failing due to configuration mismatch ( opt # 475186 ) . as a workaround , calculate the vmax2 volume size based on the vmax3 cylinder size .
