How to Attach the Volume to an Instance
This section describes how to attach a volume that you created to an instance.
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 Instance Storage. |
Procedure
To attach an Amazon EBS volume
-
If you are using SOAP, construct the following request:
<AttachVolume xmlns="http://ec2.amazonaws.com/doc/2009-08-15/"> <volumeId>
volume-id
</volumeId> <instanceId>instance-id
</instanceId> <device>device
</device> </AttachVolume> -
If you are using Query, construct the following request:
https://ec2.amazonaws.com/ ?Action=AttachVolume &VolumeId=
volume-id
&InstanceId=instance-id
&Device=device
&...auth parameters... -
View output similar to the following:
<AttachVolumeResponse xmlns="http://ec2.amazonaws.com/doc/2009-08-15/"> <volumeId>vol-4d826724</volumeId> <instanceId>i-6058a509</instanceId> <device>/dev/sdh</device> <status>attaching</status> <attachTime>2008-05-07T11:51:50.000Z</attachTime> </AttachVolumeResponse>