Attach Volume operation
The Attach Volume operation attaches an Amazon EBS volume to a running instance and exposes the instance as the specified device.
The following figure shows a sample <items> XML element for the Attach Volume operation.
Sample <items> XML element for the Attach Volume operation
<item>
<parameters>
<volume-id></volume-id>
<instance-id></instance-id>
<device></device>
</parameters>
</item>
</items>
The following table shows adapter request elements for the Attach Volume operation.
Adapter request elements for the Attach 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: attach-volume | Yes |
<volume-id> | Specifies the ID of the Amazon EBS volume | Yes |
<instance-id> | Specifies the ID of the instance to which the volume attaches | Yes |
<device> | Specifies how the device is exposed to the instance (For example, /dev/sdh) | Yes |
The following figure shows a sample adapter request for the Attach Volume operation.
Sample adapter request for the Attach 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>attach-volume</operation-name>
<parameters>
<parameters>
<volume-id>vol-fd56fc94</volume-id>
<instance-id>i-5bc8a930</instance-id>
<device>/dev/sda2</device>
</parameters>
</parameters>
</amazon-ec2-request>
The following figure shows a sample adapter response for the Attach Volume operation.
Sample adapter response for the Attach Volume operation
<metadata>
<status>success</status>
</metadata>
<AttachVolumeResponse>
<requestId>932e3043-8ed3-4578-8d76-e337abecb881</requestId>
<volumeId>vol-fd56fc94</volumeId>
<instanceId>i-5bc8a930</instanceId>
<device>/dev/sda2</device>
<status>attaching</status>
<attachTime>2010-04-16T09:29:51.000Z</attachTime>
</AttachVolumeResponse>
</amazon-ec2-response>