Docs · Guides

Backup strategy

Three layers. Each protects against a different failure mode. Setting up all three takes ~15 minutes for a typical workload and meets the 3-2-1 rule (3 copies, 2 different storage classes, 1 offsite).

Layer 1 — Instance snapshots (fastest restore)

Snapshots capture the full VM (root volume + state) at a point in time. Restore creates a new instance from the snapshot in ~30s. Cost: ₹2/GB/month.

  • On demand — from the instance detail page → Snapshots → Take snapshot. Use this before a risky deploy.
  • Scheduled — set a daily / weekly cron in the snapshot schedule. Defaults to 7-day retention.
  • Host-level nightly — every customer VM is also snapshotted by the host’s Proxmox cron at 02:30 IST with 7-day retention. This is free and runs whether or not you’ve scheduled your own.

Protects against: bad deploys, accidental file deletion, application data corruption.

Layer 2 — Volume snapshots (granular)

Block-volume snapshots are independent of the VM. Snapshot the data volume daily even if the VM itself doesn’t change.

# CLI:
cloudnx volume snapshot pg-data --description "pre-migration"
cloudnx volume snapshot-list pg-data
cloudnx volume snapshot-restore <snapshot-id> --new-volume pg-data-restored

Volume snapshots are stored on the host’s NVMe (fast). Detach the volume from one VM and attach to another for cross-instance disaster recovery.

Layer 3 — Offsite backups (worst-case)

Layers 1 and 2 live on the same physical host as your VM. If that host has a catastrophic hardware failure, those backups are gone too. The third layer pushes copies offsite.

Database dumps to S3

# Daily cron on the VM:
0 2 * * * sudo -u postgres pg_dumpall \
  | gzip \
  | aws s3 --endpoint-url https://s3.cloudnx.in cp - s3://my-backups/pg-$(date +%Y%m%d).sql.gz

Object Storage is on a different storage pool than your VM disk. Survives host-level failure. Lifecycle policy can age out backups > 30 days automatically.

Cross-cloud copy (Backblaze B2)

For mission-critical data, replicate the S3 bucket to another provider. Backblaze B2 charges ~₹0.50/GB/month — cheaper than another CloudNx region.

# Weekly rclone job to mirror s3.cloudnx.in/my-backups → B2:
0 3 * * 0 rclone sync s3-cnx:my-backups b2:my-backups-mirror \
  --transfers=8 --checkers=16

Restore drill — do this quarterly

Backups you don’t test are theoretical. Every quarter, restore from one layer to a throwaway VM and confirm the data is intact:

  1. Launch a new cnx.t1.small instance.
  2. Restore your latest layer-3 dump into it.
  3. Run your application smoke test against the restored state.
  4. Delete the test VM.

Cost: ~₹5 for the 30-min test instance. Insurance value: knowing your runbook actually works.

What CloudNx already does for you

  • Postgres on the platform (the Asynq queue + customer audit logs) is dumped daily to MinIO with 14-day retention by the deploy/backups container.
  • Every customer VM gets a nightly Proxmox snapshot (host cron, 7-day retention) — no setup needed.
  • Object Storage is on a separate Proxmox storage pool from VM disks, so an S3 bucket survives a VM failure.

None of these substitute for your own application-aware backups. They’re the safety net under your safety net.