Nov 26, 2024
4 min read

Snapshots: Create a Point-in-Time Copy of your High-Performance Volumes

Today, we are excited to announce the availability of Volume Snapshots in public preview!

Snapshots are an essential feature to backup your High-Performance Volumes, simplify data management and allow reproducibility.

With Snapshots, you can create an immediate point-in-time copy of your Volumes with a simple CLI command or click, enabling:

  • Live backups: create an exact copy of your data at any time to prevent data loss.
  • Duplicate Volumes: you can now easily create Snapshots to replicate an existing dataset
  • Data movement: to maximize throughput and reduce latency, our high-performance NVMe Volumes are stored locally on our bare metal hypervisors. Snapshots are an easy way to move data between different GPUs and CPU instances.
  • Disaster recovery: Volumes can fail as they are local. Snapshots are automatically stored on a highly-available and durable remote store to prevent data loss in case of hardware failure.

Volumes and Snapshots are available today in our Frankfurt, EU and Washington, US regions!

Snapshots 101

Here are the basics, you can:

  • Snapshot a Volume: Create a point-in-time Volume copy that is remotely stored to ensure long-term storage
  • Create a Volume from a Snapshot: Restore your Snapshots and mount the new Volume to your service in case of accidental data loss or corruption.

When you snapshot a volume, there are three automatic steps:

  1. Creating: the Volume is being snapshotted locally on the hypervisor. Snapshotting a Volume takes only a couple of seconds.
  2. Migrating: the Snapshot is uploaded to a durable remote store for long-term storage. This takes between a couple of seconds and several minutes depending on the amount of data to copy.
  3. Available: the Snapshot can be used to create a new Volume!

Creating Snapshots in the Koyeb control panel

How to Get Started

You can create Snapshots with the CLI or via the control panel. Here is an example of the simple steps to take with the CLI:

  1. Create a Snapshot

    Use the Koyeb CLI to create a Snapshot:

    koyeb snapshots create <snapshot-name> <volume-name>
    
  2. View Snapshots

    List all snapshots for a specific Volume:

    koyeb volume snapshot list <volume-name>
    
  3. Restore a Volume from Snapshot

    Restore a snapshot to an existing or new Volume:

    koyeb volume create <new-volume-name> --snapshot <snapshot-name>
    

Automatic Snapshots

If you want to automate the process of performing snapshots at specific intervals, we recommend using a third-party service to schedule this task for now. Spoiler alert: we have some exciting announcements coming soon!

In the example below, we use GitHub Actions to define a workflow that creates a Snapshot of a specified Volume on a daily basis. Feel free to extend and adapt this workflow to suit your needs.

name: Daily Volume Snapshot

on:
  schedule:
    - cron: "0 0 * * *" # Runs every day at midnight UTC
  workflow_dispatch: # Allows manual triggering of the workflow

jobs:
  manage-services:
    runs-on: ubuntu-latest
    env:
      VOLUME_NAME: "koyeb_koyeb_volume_name" # Replace with the volume name your want to snapshot

    steps:
      - name: Install and configure the Koyeb CLI
        uses: koyeb-community/koyeb-actions@v2
        with:
          api_token: "${{ secrets.KOYEB_TOKEN }}"

      - name: Create a new snapshot of the volume
        run: |
          koyeb volume snapshot create "$(date +'%Y-%m-%d')-${VOLUME_NAME}-snapshot" "${VOLUME_NAME}"
          echo "Created snapshot: $(date +'%Y-%m-%d')-${VOLUME_NAME}-snapshot"

To deploy this workflow, using the GitHub CLI process as below:

  1. Create a new GitHub repository:
gh repo create koyeb-daily-volume-snapshot --private --clone
cd koyeb-daily-volume-snapshot
  1. Add the Workflow content above to the following path and edit the VOLUME_NAME value with the name of the Volume to snapshot
mkdir -p .github/workflows/koyeb-daily-volume-snapshot.yml
cd .github/workflows
  1. Create a new Koyeb API access tokens here, and then create a new KOYEB_TOKEN secret on the GitHub repository
gh secret set KOYEB_TOKEN -b"your-koyeb-token-value"
  1. Commit, push, and test the workflow
git add .
git commit -m "initial commit"
git push

Navigate to your GitHub repository, and trigger the workflow in the Actions tab. If everything is working as expected, you should see a new snapshot created on Koyeb. This workflow will now trigger on a daily basis.

Take a Snapshot Today!

Snapshots are now available and free during the public preview. Check out the Snapshot documentation.

Ready to get started? Sign up and deploy your first stateful Service today!

We're looking forward to your feedback to help us shape the product, stay tuned for more updates, and thank you for building with Koyeb!


Deploy AI apps to production in minutes

Koyeb is a developer-friendly serverless platform to deploy apps globally. No-ops, servers, or infrastructure management.
All systems operational
© Koyeb