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

<items>
   <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

Examples:

Conditional:

  • Required if not specified in the request
  • If specified in the configuration and request, the value in the request overrides the value in the configuration
<endpoint-address>

Specifies the web service endpoint for the adapter to use while performing operations on Amazon EC2 instances across different regions
Default value: US East region: http://us-east-1.ec2.amazonaws.com/

No

<signature-properties>

Specifies the mode for signing the adapter request

Conditional:

  • Required if not specified in the configuration
  • If <signature-properties mode = "key-files">, requires <private-key-file>
     and <certificate-file>
  • If <signature-properties mode = "key-data">, requires <private-key-data> and <certificate-data>
<operation-name>

Contains the name of the operation: attach-volume

Yes

<volume-id>

Specifies the ID of the Amazon EBS volume
The volume and instance must be within the same Availability Zone and the instance must be running.

Yes

<instance-id>

Specifies the ID of the instance to which the volume attaches
The volume and instance must be within the same Availability Zone and the instance must be running.

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

<amazon-ec2-request>
   <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

<amazon-ec2-response>
 <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>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*