ec2-attach-volume
Syntax
ec2-attach-volume
volume_id
--instance instance_id
--device device
Description
Attaches an Amazon EBS volume to a running instance and exposes it as the specified device.
Note | |
---|---|
Windows instances currently support devices xvda through xvdp. Devices xvda and xvdb are reserved by the operating system, xvdc is assigned to drive C:\, and, depending on the instance type, devices xvdd through xvde might be reserved by the instance stores. Any device that is not reserved can be attached to an Amazon EBS volume. For a list of devices that are reserved by the instance stores, see |
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. For a list of devices reserved by the instance stores, see Instance Storage. 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 Storage Locations.
PROMPT>
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