17.1 Concepts¶
| Operation | Stored where | Use |
|---|---|---|
| VM snapshot | In-cluster (Longhorn snapshots) | Fast rollback before risky changes |
| VM backup | Backup target (S3/NFS) | Off-cluster protection, cross-cluster restore |
| Volume snapshot | In-cluster | Single-volume rollback |
| Scheduled VM backup/snapshot | ScheduleVMBackup |
Recurring protection with retention |
17.2 Backup target¶
Setting backup-target:
{"type":"s3","endpoint":"https://s3.ca-central-1.amazonaws.com","bucketName":"hv-backups","bucketRegion":"ca-central-1","accessKeyId":"AKIA...","secretAccessKey":"..."}
{"type":"nfs","endpoint":"nfs://10.0.20.5:/export/harvester"}
S3-compatible targets (MinIO, Ceph RGW, Wasabi, Backblaze B2 S3) work; for self-signed endpoints set virtualHostedStyle and the CA appropriately.
17.3 Backup behaviour¶
- VM backups capture VM metadata + all volumes (incremental at the block level via Longhorn).
- With
qemu-guest-agent, Harvester freezes filesystems for application-consistent-ish backups (fs-consistent; databases still benefit from their own dumps). - Retention for scheduled backups is configured per schedule.
- Backups include image references; recent versions improved backup/restore when the original image is absent.
17.4 Restore options¶
- Restore as new VM (same or different namespace).
- Replace existing VM (VM must be stopped). v1.9 made safer restore defaults (e.g. not deleting volumes unexpectedly).
- Cross-cluster restore: point a second Harvester cluster at the same backup target; backups are discovered and restorable there — your basic DR mechanism.
17.5 DR strategy example¶
Site A Harvester ──(scheduled VM backups every 4h, keep 42)──► S3 bucket (replicated)
│
Site B Harvester ◄─────────(same backup-target, read)──────────────┘
└─ restore on demand, or Longhorn DR volumes for tighter RPO on key disks
- RPO = backup interval; RTO = restore time (network throughput dependent).
- Test restores regularly. An untested backup is a hope, not a plan.
- Don't forget to back up outside Harvester: guest cluster etcd snapshots, Rancher (rancher-backup), encryption secrets, cloud-init secrets.