:doc:`StorageGateway <../../storagegateway>` / Client / detach_volume

*************
detach_volume
*************



.. py:method:: StorageGateway.Client.detach_volume(**kwargs)

  

  Disconnects a volume from an iSCSI connection and then detaches the volume from the specified gateway. Detaching and attaching a volume enables you to recover your data from one gateway to a different gateway without creating a snapshot. It also makes it easier to move your volumes from an on-premises gateway to a gateway hosted on an Amazon EC2 instance. This operation is only supported in the volume gateway type.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/DetachVolume>`_  


  **Request Syntax**
  ::

    response = client.detach_volume(
        VolumeARN='string',
        ForceDetach=True|False
    )
    
  :type VolumeARN: string
  :param VolumeARN: **[REQUIRED]** 

    The Amazon Resource Name (ARN) of the volume to detach from the gateway.

    

  
  :type ForceDetach: boolean
  :param ForceDetach: 

    Set to ``true`` to forcibly remove the iSCSI connection of the target volume and detach the volume. The default is ``false``. If this value is set to ``false``, you must manually disconnect the iSCSI connection from the target volume.

     

    Valid Values: ``true`` | ``false``

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'VolumeARN': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      AttachVolumeOutput

      
      

      - **VolumeARN** *(string) --* 

        The Amazon Resource Name (ARN) of the volume that was detached.

        
  
  **Exceptions**
  
  *   :py:class:`StorageGateway.Client.exceptions.InvalidGatewayRequestException`

  
  *   :py:class:`StorageGateway.Client.exceptions.InternalServerError`

  