ec2-attach-volume
Syntax
ec2-attach-volume
volume_id
--instance instance_id
--device device
Description
Attaches an Amazon EBS volume to an instance and exposes it as the specified device.
Options
Option | Description | Required |
---|---|---|
| The ID of the Amazon EBS volume Example: | Yes |
--instance | The ID of the instance to which the volume will attach Volumes can only attach to instances in the same availability zone. Example: | Yes |
--device | Specifies how the device is exposed to the instance. This value is operating system dependent. Example: | Yes |
Output
Amazon EBS returns a table that contains the following information:
ATTACHMENT identifier
ID of the volume
ID of the instance
The device as it is exposed to the instance
Volume state (e.g.,
attaching
,attached
)Time stamp when attachment initiated
Amazon EBS displays errors on stderr
.
Example
This example attaches volume vol-4d826724
to instance i-6058a509
and exposes it as /dev/sdh
. For information on standard storage locations, see
$
ec2-attach-volume vol-4d826724 --instance i-6058a509 --device /dev/sdh
ATTACHMENT vol-4d826724 i-6058a509 /dev/sdh attaching 2008-02-14T00:15:00+0000