Detach Volume operation
The Detach Volume operation detaches an Amazon EBS volume from an instance.
The following figure shows a sample <items> XML element for the Detach Volume operation.
Sample <items> XML element for the Detach Volume operation
<item>
<parameters>
<volume-id></volume-id>
<!--Optional:-->
<instance-id></instance-id>
<!--Optional:-->
<device></device>
<!--Optional:-->
<force></force>
</parameters>
</item>
</items>
The following table shows adapter request elements for the Detach Volume operation.
Adapter request elements for the Detach Volume operation
Element | Definition | Required |
---|---|---|
<wsdl-location> | Specifies the target Web Service Description Language (WSDL) URL for Amazon EC2 | Conditional:
|
<endpoint-address> | Specifies the web service endpoint for the adapter to use while performing operations on Amazon EC2 instances across different regions | No |
<signature-properties> | Specifies the mode for signing the adapter request | Conditional:
|
<operation-name> | Contains the name of the operation: detach-volume | Yes |
<volume-id> | Specifies the ID of the Amazon EBS volume that you want to detach | Yes |
<instance-id> | Specifies the ID of the instance from which the volume is detached | No |
<device> | Specifies the name of the device | No |
<force> | Forces detachment if the previous detachment attempt did not occur cleanly (logging into an instance, unmounting the volume, and detaching normally) | No |
The following figure shows a sample adapter request for the Detach Volume operation.
Sample adapter request for the Detach Volume operation
<wsdl-location>http://ec2.amazonaws.com/doc/2009-11-30/</wsdl-location>
<endpoint-address>http://us-east-1.ec2.amazonaws.com/</endpoint-address>
<signature-properties mode = "key-files">
<private-key-file>C:\Security\
pk-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</private-key-file>
<certificate-file>C:\Security\
cert-MJ5GIUNLM2XJ3VRJSYTKOFDWILELDQHB.PEM</certificate-file>
</signature-properties>
<operation-name>detach-volume</operation-name>
<parameters>
<volume-id>vol-e14fec88</volume-id>
<!--Optional:-->
<instance-id>i-e577f48e</instance-id>
<!--Optional:-->
<device>/dev/sdh</device>
<!--Optional:-->
<force>true</force>
</parameters>
</amazon-ec2-request>
The following figure shows a sample adapter response for the Detach Volume operation.
Sample adapter response for the Detach Volume operation
<metadata>
<status>success</status>
</metadata>
<DetachVolumeResponse>
<requestId>3e1d2401-c665-4547-b5d0-fccc29f5c961</requestId>
<volumeId>vol-e14fec88</volumeId>
<instanceId>i-e577f48e</instanceId>
<device>/dev/sdh</device>
<status>detaching</status>
<attachTime>2010-03-31T08:25:25.000Z</attachTime>
</DetachVolumeResponse>
</amazon-ec2-response>