Attach a volume

Attach a Block Storage volume to an existing Linode.

📘

  • The volume and its target Linode need to exist in the same region. You can run the List volumes and List Linodes operations and review the region for each.

  • There's a maximum number of volumes that can be attached to a single Linode configuration. This number varies, based on the Linode's plan, with higher plan types supporting more volumes. The maximum follows a formula of the Linode plan's total_ram / 1024, with a minimum of 8 and a total maximum of 64 volumes. Rescue configurations support a maximum of 8.

Permissions and scopes

To call this operation, you need permissions, based on the model you're using:

  • Identity and access permissions. Your user needs a role with these permissions. Learn more.

    • Permissions: attach_volume
  • OAuth scopes. Your user needs these scopes assigned. Learn more.

    • Scopes: volumes:read_write, linodes:read_write

CLI

linode-cli volumes attach 12345 \
  --linode_id 12346 \
  --config_id 23456

Learn more

Path Params
string
enum
required

Enum Call either the v4 URL, or v4beta for operations still in Beta.

Allowed:
integer
required

The unique identifier for the target volume. Run the List volumes operation and store the id for the target volume as your volumeId.

Body Params
integer

The unique identifier assigned to the Linode configuration where you want to include this volume. Run the List configuration profiles operation and store the id for the target configuration.

📘

  • The configuration needs to belong to the Linode referenced by linode_id.

  • If you don't include this value, the API uses the last booted configuration.

integer
required

The unique identifier assigned to the Linode where you want to attach the volume. Run the List Linodes operation and store the id for the target Linode.

boolean
Defaults to true

If set to false, the volume won't be attached to the Linode configuration. In this case, more than eight volumes may be attached to a Linode if a Linode has 16GB of RAM or more. The number of volumes you can attach is equal to the number of GB of RAM that the Linode has, up to a maximum of 64. If you set this to false, you can't include a config_id and only the linode_id should be passed.

📘

To use this object, the target linode_id needs to have a status of running. Run the List Linodes operation to check the status of each Linode.

Responses

Language
Credentials
Response
Choose an example:
application/json