Storage Snapshots
Snapshots provide point-in-time copies of your block storage volumes. They are incremental, meaning only changed blocks are stored after the initial snapshot, optimizing storage costs and creation speed. Snapshots can be used to restore data, create new volumes, or migrate workloads across regions.
fsfreeze or shut down the application before creating the snapshot.
Prerequisites
- CloudNexus CLI
v2.4+installed and configured - Active API key with
storage:readandstorage:writescopes - An existing volume in the
availableorattachedstate - Sufficient storage quota in the target region
Creating a Snapshot
Using the CLI
cx snapshot create --volume-id vol-8f3a2b9c --name "daily-prod-2025-05-20" --tags env:prod,team:backend
Using the API
{
"volume_id": "vol-8f3a2b9c",
"name": "daily-prod-2025-05-20",
"tags": ["env:prod", "team:backend"],
"description": "Automated nightly snapshot",
"region": "us-east-1"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
volume_id |
string | Yes | UUID of the source volume |
name |
string | No | Human-readable name (max 64 chars) |
tags |
array | No | Key-value pairs for filtering |
region |
string | No | Target region (defaults to volume region) |
Managing Snapshots
List Snapshots
cx snapshot list --volume-id vol-8f3a2b9c --sort created_at
Restore from Snapshot
cx volume restore --volume-id vol-8f3a2b9c --snapshot-id snap-7d4e1a2f
Delete a Snapshot
cx snapshot delete --snapshot-id snap-7d4e1a2f --force
Best Practices
- Automate with Schedules: Use cron or our Schedule API to create daily snapshots during low-traffic windows.
- Retention Policies: Keep 7 daily, 4 weekly, and 12 monthly snapshots to balance recovery needs and costs.
- Cross-Region Replication: Copy critical snapshots to a secondary region using
cx snapshot copy --region eu-west-1. - Monitor Storage: Incremental snapshots save space, but initial full snapshots consume full volume size. Monitor via the dashboard or
cx account usage. - Consistency: For databases, flush logs and freeze filesystems before snapshotting to avoid corruption.
FAQ
Can I take a snapshot of a mounted volume?
Yes. However, active I/O during snapshot creation may cause temporary consistency gaps. For production databases, we recommend unmounting the volume or using fsfreeze for consistent block-level backups.
How are snapshot costs calculated?
The first snapshot stores a full copy of the volume. Subsequent snapshots only store changed blocks. You are billed per GB-month of stored data. Cross-region copies incur standard egress fees.
Can I boot a VM directly from a snapshot?
No. Snapshots are block-level backups. You must first create a new volume from the snapshot, then attach it to an instance or convert it to a bootable image using cx image create --source-snapshot.