LinuxCommandLibrary

exo-compute-block-storage

Manage Exoscale block storage volumes

TLDR

Create a 20GB Block Storage Volume

$ exo compute block-storage create [volume_name] --size 20 [[-z|--zone]] [zone]
copy

List Block Storage Volumes
$ exo compute block-storage list
copy

Attach a Block Storage Volume to a Compute instance
$ exo compute block-storage attach [volume_name|id] [instance_name|id] [[-z|--zone]] [zone]
copy

Forcefully detach a Block Storage Volume (does not require confirmation)
$ exo compute block-storage detach [volume_name|id] [[-z|--zone]] [zone] [[-f|--force]]
copy

Create a snapshot of a Block Storage Volume
$ exo compute block-storage snapshot create [volume_name|id] --name [snapshot_name] [[-z|--zone]] [zone]
copy

Create a Block Storage Volume from a snapshot
$ exo compute block-storage create [volume_name] --snapshot [snapshot_name|id] [[-z|--zone]] [zone]
copy

Update an existing Block Storage Volume with a new name and a new volume size of 30GB
$ exo compute block-storage update [volume_name|id] --size 30 --name [new_name]
copy

SYNOPSIS

exo compute block-storage action [arguments] [options]

Common actions include:
  exo compute block-storage list [options]
  exo compute block-storage show VOLUME [options]
  exo compute block-storage create NAME SIZE [options]
  exo compute block-storage delete VOLUME [options]
  exo compute block-storage attach VOLUME INSTANCE [options]
  exo compute block-storage detach VOLUME [options]

PARAMETERS

VOLUME
    Refers to the ID or name of a block storage volume. Used with `show`, `delete`, `attach`, `detach` actions.

INSTANCE
    Refers to the ID or name of a compute instance to which a volume will be attached or from which it will be detached. Used with `attach` action.

NAME
    A unique name for the new block storage volume (used with the create action).

SIZE
    The size of the volume in GiB (Gigabytes) (e.g., 100). Required when using the create action.

--description
    An optional description for the block storage volume (used with create, update actions).

--zone
    Specify the Exoscale zone for the operation (e.g., ch-gva-2). Many operations require this or default to the configured zone.

--labels
    A comma-separated list of key-value pairs to apply as labels to the resource (used with create, update actions). Example: --labels env=dev,project=web

--instance
    Explicitly specify the compute instance ID or name for attach/detach operations. Required for the attach action.

--output
    Specify the output format for the command's result, e.g., json, table, text. This is a global option for the exo CLI.

--no-read-timeout
    Disables the read timeout for the API client, useful for very long-running operations (a global option for the exo CLI).

DESCRIPTION

The `exo compute block-storage` command group is part of the Exoscale CLI, a command-line interface for interacting with the Exoscale cloud platform. This specific group of commands allows users to manage block storage volumes associated with Exoscale compute instances. These volumes provide persistent, scalable storage that can be attached to and detached from virtual machines, offering high-performance disk space for various applications.

Users can perform various operations such as creating new volumes with specified names and sizes, listing existing ones, showing detailed information about a specific volume, attaching volumes to compute instances, detaching them, updating volume properties (like descriptions or labels), and deleting them. This command is crucial for managing data persistence and expanding storage capacity for virtual machines within the Exoscale cloud infrastructure.

CAVEATS

This command relies on the Exoscale CLI being installed and properly configured with your Exoscale API key and secret.

Block storage volumes are zone-specific; they can only be created, attached, and managed within a single Exoscale zone.

A block storage volume can only be attached to a single compute instance at any given time.

Deleting a volume is an irreversible action and will result in permanent data loss. Always ensure you have backups of critical data.

COMMON ACTIONS

The `exo compute block-storage` group provides several key actions for managing your block storage volumes:

  • list: Lists all block storage volumes associated with your Exoscale account, optionally filtered by zone.
  • show: Displays detailed information about a specific block storage volume using its ID or name.
  • create: Creates a new block storage volume with a specified name and size in a chosen zone.
  • delete: Permanently deletes a block storage volume.
  • attach: Attaches an existing block storage volume to a specified compute instance.
  • detach: Detaches a block storage volume from the compute instance it is currently attached to.
  • update: Modifies properties (like description or labels) of an existing block storage volume.

PREREQUISITES

Before utilizing `exo compute block-storage` commands, ensure that:

  • The Exoscale CLI is installed on your operating system.
  • Your Exoscale API key and secret are properly configured. This is typically done interactively using `exo configure` or by setting the `EXOSCALE_API_KEY` and `EXOSCALE_API_SECRET` environment variables.
  • You have an active Exoscale account with the necessary permissions to perform block storage operations.

HISTORY

The `exo compute block-storage` command group is an integral part of the Exoscale CLI, which has been continuously developed to provide comprehensive programmatic access to Exoscale's cloud services. As Exoscale's robust block storage offering evolved to provide high-performance, persistent storage, the CLI commands were introduced and refined to enable seamless management of these resources directly from the command line. Its development closely follows the iterative release cycles of the Exoscale platform and its underlying API, ensuring compatibility and access to new features.

SEE ALSO

exo compute instance, exo compute security-group, exo compute network, fdisk(8), mount(8), lsblk(8)

Copied to clipboard