Skip to main content

Overview

The Xloud Block Storage API provides programmatic management of persistent storage volumes, volume snapshots, volume backups, volume types, and QoS specifications. Volumes attach to compute instances as block devices — independent of instance lifecycle.
Prerequisites
  • A valid project-scoped token from the Identity API
  • Base URL: https://api.<your-domain>/volume/v3
  • All operations are project-scoped unless using admin credentials

Key Endpoints

ResourceMethodEndpointDescription
List volumesGET/volumesList volumes in the current project
Volume detailGET/volumes/detailList volumes with full metadata
Get volumeGET/volumes/{id}Get a specific volume
Create volumePOST/volumesCreate a new volume
Extend volumePOST/volumes/{id}/actionExtend volume size
Delete volumeDELETE/volumes/{id}Delete a volume
Attach volumePOST/volumes/{id}/actionReserve for attachment
List snapshotsGET/snapshotsList volume snapshots
Create snapshotPOST/snapshotsCreate a volume snapshot
Delete snapshotDELETE/snapshots/{id}Delete a snapshot
List backupsGET/backupsList volume backups
Create backupPOST/backupsCreate a volume backup
Restore backupPOST/backups/{id}/restoreRestore backup to a volume
Volume typesGET/typesList available volume types
QoS specsGET/qos-specsList QoS specifications (admin)
QuotasGET/os-quota-sets/{project_id}Show project storage quotas

Create a Volume

name
string
Display name for the volume.
size
integer
required
Volume size in gigabytes.
volume_type
string
Volume type name or ID. Determines the storage backend and QoS policy.
availability_zone
string
Target availability zone. Must match the compute availability zone to attach.
source_volid
string
Clone from an existing volume by providing its ID.
snapshot_id
string
Create from a snapshot by providing the snapshot ID.
metadata
object
Key-value metadata pairs for custom tagging.
curl -X POST https://api.<your-domain>/volume/v3/volumes \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "volume": {
      "name": "db-data-01",
      "size": 200,
      "volume_type": "ssd-standard",
      "availability_zone": "nova",
      "metadata": {
        "environment": "production",
        "service": "mysql"
      }
    }
  }'
{
  "volume": {
    "id": "c3d4e5f6-a7b8-9012-c3d4-e5f6a7b89012",
    "name": "db-data-01",
    "status": "creating",
    "size": 200,
    "volume_type": "ssd-standard",
    "availability_zone": "nova",
    "metadata": { "environment": "production" },
    "created_at": "2026-03-18T10:00:00.000000",
    "bootable": "false",
    "encrypted": false
  }
}

Volume Operations

Volumes are attached to instances via the Compute API. The Storage API provides the os-reserve and os-attach actions for low-level attachment management.
Attach volume via Compute API (recommended)
curl -X POST https://api.<your-domain>/compute/v2.1/servers/{server_id}/os-volume_attachments \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "volumeAttachment": {
      "volumeId": "<volume-id>",
      "device": "/dev/vdb"
    }
  }'
Detach volume from instance
curl -X DELETE \
  "https://api.<your-domain>/compute/v2.1/servers/{server_id}/os-volume_attachments/{volume_id}" \
  -H "X-Auth-Token: $OS_TOKEN"
Always detach a volume from the guest OS before issuing the API detach call to prevent filesystem corruption.

Snapshots

Create a volume snapshot
curl -X POST https://api.<your-domain>/volume/v3/snapshots \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "snapshot": {
      "name": "db-data-01-snap-20260318",
      "volume_id": "<volume-id>",
      "force": false,
      "metadata": { "backup_type": "daily" }
    }
  }'
Create volume from snapshot
curl -X POST https://api.<your-domain>/volume/v3/volumes \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "volume": {
      "name": "db-data-restored",
      "snapshot_id": "<snapshot-id>",
      "size": 200
    }
  }'
Set force: true in the snapshot request to snapshot a volume that is currently attached to a running instance. Ensure the filesystem is quiesced (via sync or application-level flush) before forcing a snapshot.

Backups

Backups are stored in Xloud Object Storage and are independent of volume availability.
Create a full backup
curl -X POST https://api.<your-domain>/volume/v3/backups \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "backup": {
      "name": "db-data-01-backup-20260318",
      "volume_id": "<volume-id>",
      "incremental": false,
      "container": "volume-backups"
    }
  }'
Create incremental backup (faster, less storage)
curl -X POST https://api.<your-domain>/volume/v3/backups \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "backup": {
      "name": "db-data-01-incr-20260318",
      "volume_id": "<volume-id>",
      "incremental": true
    }
  }'
Restore backup to a new volume
curl -X POST https://api.<your-domain>/volume/v3/backups/{backup_id}/restore \
  -H "X-Auth-Token: $OS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "restore": {
      "name": "db-data-01-restored"
    }
  }'

Volume Status Reference

StatusDescription
creatingVolume is being provisioned
availableReady to attach
in-useCurrently attached to an instance
deletingDeletion in progress
extendingSize extension in progress
retypingVolume type change in progress
backing-upBackup in progress
restoring-backupBackup restore in progress
errorAn error occurred — check volume events
error_deletingDeletion failed

Next Steps

Compute API

Attach volumes to compute instances via the Compute API

Networking API

Configure networks for your storage-backed instances

Storage QoS

Configure IOPS and throughput limits for volume types

Automation

Automate backup workflows with scripts and scheduling