You can attach a volume to an instance within the same Availability Zone (AZ) to add additional storage. You can attach several volumes to an instance (up to 25), for example to separate different types of data.


To avoid conflicts with device names when restarting your instance, we highly recommend naming your ephemeral disks before naming your volumes. You can also start naming your ephemeral disks from /dev/xvdb, and your volumes up from /dev/xvdz.

For more information, see About Ephemeral Storage and About Volumes > Volumes Attachment and Device Names

The following procedures are available:

Attaching a Volume to an Instance Using Cockpit

  1. In the navigation panel of the IaaS section, click Volumes.

    You can also select an instance in the Instances tab and click Attach Volume(s) .


  2. Click the volume you want to attach to an instance.
    The volume is selected.
     
  3. Click Attach .
    The ATTACH VOLUME dialog box appears.
     
  4. In the Instance list, click the instance you want to attach the volume to.

    Only the instances that are in the same Availability Zone as the volume you want to attach appear in the list.

  5. In the Device list, click the device name you want to assign to the volume.
     

  6. Click Attach.
    The volume is attached to the selected instance.
     

  7. To make the volume available for use, format and mount it to the instance. For more information, see Initializing a Volume from an Instance.


Attaching a Volume to an Instance Using AWS CLI

  1. To attach a volume to an instance, use the attach-volume command following this syntax:

    Request sample
    $> aws ec2 attach-volume \
    	--profile YOUR_PROFILE \
    	--volume-id vol-12345678 \
    	--instance-id i-87654321 \
    	--device /dev/xvdb \
    	--endpoint https://fcu.eu-west-2.outscale.com

    This command contains the following attributes that you need to specify:

    • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Using AWS CLI in the Outscale Cloud.
    • volume-id: The ID of the volume.
    • instance-id: The ID of the instance.
    • device: The device name you want to assign to the volume.

      You must use /dev/xvdX device names. For more information, see About Volumes > Volumes Attachment and Device Names.

    • endpoint: The endpoint corresponding to the Region you want to send the request to.


    The attach-volume command returns a result as follows:

    • AttachTime: The time at which the attachment was initiated.
    • InstanceId: The ID of the instance.
    • VolumeId: The ID of the volume.
    • State: The attachment state of your volume (attaching | detaching | attached | detached).
    • Device: The device name you specified when attaching the volume.
    Result sample
    {
     "AttachTime":"2016-02-05T13:56:48.970Z",
     "InstanceId":"i-87654321",
     "VolumeId":"vol-12345678",
     "State":"attaching",
     "Device":"/dev/xvdb"
    }

    The volume is attached to the specified instance.

  2. To make the volume available for use, format and mount it to the instance. For more information, see Initializing a Volume from an Instance.






Windows® is a registered trademark of Microsoft Corporation in the United States and/or other countries.

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.

See Legal Mentions.