AttachVolume
The AttachVolume
operation attaches an Amazon EBS volume to a running instance.
For more information about Amazon EBS, see Amazon Elastic Block Store.
Request Parameters
The following table describes the request parameters for
AttachVolume
. Parameter names are case
sensitive.
Name | Description | Required |
---|---|---|
|
The ID of the Amazon EBS volume Type: String Default: none Valid Values: ID of a volume that you own Constraints: The volume and instance must be within the same Availability Zone and the instance must be running |
Yes |
|
The ID of the instance to which the volume attaches Type: String Default: none Valid Values: ID of an instance that you own Constraints: The volume and instance must be within the same Availability Zone and the instance must be running |
Yes |
|
Specifies how the device is exposed to the instance (e.g., Type: String Default: none Valid Values: Valid device ID Constraints: The specified device ID cannot be in use by another device or an instance store |
Yes |
Response Elements
The following table describes the default response tags included
in AttachVolume
responses.
Name | Description |
---|---|
|
The ID of the volume Type: xsd:string |
|
The ID of the instance Type: xsd:string |
|
The device as it is exposed to the instance Type: xsd:string |
|
Volume state (e.g., Type: xsd:string |
|
Time stamp when the attachment was initiated Type: xsd:dateTime |
Sample Request
https://ec2.amazonaws.com/ ?Action=AttachVolume &VolumeId=vol-4d826724 &InstanceId=i-6058a509 &Device=/dev/sdh &...auth parameters...
Sample Response
<AttachVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2008-12-01"> <volumeId>vol-4d826724</volumeId> <instanceId>i-6058a509</instanceId> <device>/dev/sdh</device> <status>attaching</status> <attachTime>2008-05-07T11:51:50.000Z</attachTime> </AttachVolumeResponse>