AttachVolume#

Description#

Attaches a volume to a running or stopped instance and exposes it to the instance with the specified device name.

Request Parameters#

Required parameters#

  • instanceId — The ID of the instance.

    • Type: String

    • Required: Yes

  • VolumeId — The ID of the volume

    • Type: String

    • Required: Yes

Optional parameters#

  • Device — The name of the device, attaching to the instance.

    • Type: String

    • Required: No

Response Elements#

  • attachTime — The time when the volume was attached to the instance.

    • Type: Timestamp

  • device — The device name.

    • Type: String

  • instanceId — The ID of the instance to which the volume is attached

    • Type: String

  • requestId — The request ID

    • Type: String

  • status — The state of the volume attachment.

    • Type: String

  • volumeId — The ID of the volume

    • Type: String

Examples#

c2-ec2 AttachVolume VolumeId vol-01234567 InstanceId i-01234567 Device disk2