void deleteVirtualVolume(String virtualVolumeName,boolean unclaimVolumes,boolean retryOnDismantleFailure) throws VPlexApiException {
  s_logger.info("Deleting virtual volume {}",virtualVolumeName);
  VPlexVirtualVolumeInfo virtualVolumeInfo=null;
  VPlexApiDiscoveryManager discoveryMgr=_vplexApiClient.getDiscoveryManager();
  List<VPlexClusterInfo> clusterInfoList=discoveryMgr.getClusterInfoLite();
  for (  VPlexClusterInfo clusterInfo : clusterInfoList) {
    virtualVolumeInfo=discoveryMgr.findVirtualVolume(clusterInfo.getName(),virtualVolumeName,false);
    if (virtualVolumeInfo != null) {
      break;
    }
  }
  if (virtualVolumeInfo != null) {
    s_logger.info("Tearing down virtual volume {}",virtualVolumeName);
    try {
      dismantleResource(virtualVolumeInfo.getPath(),unclaimVolumes,false);
    }
 catch (    VPlexApiException vae) {
      if (retryOnDismantleFailure) {
        s_logger.info("Tear down of virtual volume {} failed: {}",virtualVolumeName,vae.getMessage());
        deleteVirtualVolume(virtualVolumeName,unclaimVolumes,false);
      }
 else {
        throw vae;
      }
    }
  }
 else   if (virtualVolumeName.endsWith(VPlexApiConstants.VIRTUAL_VOLUME_SUFFIX)) {
    String deviceName=virtualVolumeName.substring(0,virtualVolumeName.indexOf(VPlexApiConstants.VIRTUAL_VOLUME_SUFFIX));
    if (deviceName.startsWith(VPlexApiConstants.DIST_DEVICE_PREFIX)) {
      s_logger.info("Tearing down distributed device for virtual volume {}",virtualVolumeName);
      deleteDistributedDevice(deviceName);
    }
 else {
      s_logger.info("Tearing down local device for virtual volume {}",virtualVolumeName);
      deleteLocalDevice(deviceName);
    }
  }
}

void deleteVirtualVolume ( String virtualVolumeName , boolean unclaimVolumes , boolean retryOnDismantleFailure ) throws VPlexApiException { s_logger . info ( "Deleting virtual volume {}" , virtualVolumeName ) ; VPlexVirtualVolumeInfo virtualVolumeInfo = null ; VPlexApiDiscoveryManager discoveryMgr = _vplexApiClient . getDiscoveryManager ( ) ; List < VPlexClusterInfo > clusterInfoList = discoveryMgr . getClusterInfoLite ( ) ; for ( VPlexClusterInfo clusterInfo : clusterInfoList ) { virtualVolumeInfo = discoveryMgr . findVirtualVolume ( clusterInfo . getName ( ) , virtualVolumeName , false ) ; if ( virtualVolumeInfo != null ) { break ; } } if ( virtualVolumeInfo != null ) { s_logger . info ( "Tearing down virtual volume {}" , virtualVolumeName ) ; try { dismantleResource ( virtualVolumeInfo . getPath ( ) , unclaimVolumes , false ) ; } catch ( VPlexApiException vae ) { if ( retryOnDismantleFailure ) { s_logger . info ( "Tear down of virtual volume {} failed: {}" , virtualVolumeName , vae . getMessage ( ) ) ; deleteVirtualVolume ( virtualVolumeName , unclaimVolumes , false ) ; } else { throw vae ; } } } else if ( virtualVolumeName . endsWith ( VPlexApiConstants . VIRTUAL_VOLUME_SUFFIX ) ) { String deviceName = virtualVolumeName . substring ( 0 , virtualVolumeName . indexOf ( VPlexApiConstants . VIRTUAL_VOLUME_SUFFIX ) ) ; if ( deviceName . startsWith ( VPlexApiConstants . DIST_DEVICE_PREFIX ) ) { s_logger . info ( "Tearing down distributed device for virtual volume {}" , virtualVolumeName ) ; deleteDistributedDevice ( deviceName ) ; } else { s_logger . info ( "Tearing down local device for virtual volume {}" , virtualVolumeName ) ; deleteLocalDevice ( deviceName ) ; } } }
deletes the virtual volume by destroying all the components ( i . e , extents , devices ) that were created in the process of creating the virtual and unclaiming the storage volume ( s ) .
