Datafy Snapshots
Datafy Snapshot Lifecycle
Create a Datafy Snapshot - use the Datafy
create-snapshotAPI instead of the AWSCreateSnapshotAPI.Manage Retention - use your existing logic with the relevant volume tags to manage the retention of Datafy Snapshots.
Restoration - use the Datafy
create-volume-from-snapshotandattachendpoints to create and attach a new autoscaling volume. You can also restore with Terraform.
Creating a Datafy Snapshot
To create a new Datafy Snapshot, call the create-snapshot endpoint with the volume ID of the original volume managed by Datafy (as it appears in the Datafy app). Call the Datafy API wherever you currently call the AWS CreateSnapshot API.
Datafy Snapshots will create a separate snapshot for each underlying Datafy volume associated with the autoscaling volume. These snapshots have tags that identify them as Datafy snapshots, and help track their lineage. You can use these tags to identify the original volume the snapshot is associated with, and to identify all of the snapshots that were created together and are associated with each other.
Snapshot Retention
Snapshots created by Datafy are stored in your AWS account like regular EBS snapshots. Handle their retention with your existing retention tools and policies, with the following adjustments:
Use the
datafy:source-volume:idtag to determine the volume ID of the original non-autoscaling volume associated with the snapshot.
If you use a backup management tool to manage snapshot retention as part of a larger backup object, check out how to integrate with backup management tools below.
Restoring a Volume from a Datafy Snapshot
Datafy snapshots represent the underlying volumes created by Datafy when a volume is autoscaling. As such, they can be restored to autoscaling volumes with the Datafy API or with Terraform.
Using the Datafy API
Restore with the following adjustments to your restoration flow:
Use the tags
datafy:source-volume:idanddatafy:snapshot:idand the snapshot timestamp to find all of the snapshots for the volume and time you need.After selecting the desired snapshots and making sure you have all of the snapshots with the same
datafy:snapshot:id, create a new autoscaling volume using the Datafycreate-volume-from-snapshotendpoint.Attach the new autoscaling volume to an EC2 instance with Datafy AutoScaler installed using the Datafy
attachendpoint. Mount the volume as you would any EBS volume.
Using Terraform
Instead of the API calls in steps 2 and 3, set snapshot_id on an aws_ebs_volume to the Datafy snapshot ID, which starts with dsnap-. Attach the volume with aws_volume_attachment. Make sure both resources use the datafyaws provider:
The instance must have AutoScaler installed before the created volume can be mounted and accessed. After terraform apply, mount the volume as in step 3 of Using the Datafy API.
The restored volume is an autoscaling volume. In the Terraform state, its snapshot_id stays the dsnap- ID.
Offline Restoration
Datafy snapshots are intended to be restored to an instance with Datafy AutoScaler installed and access to the Datafy API. For emergencies where this isn't possible, we provide local offline tools that enable access to the data saved in Datafy snapshots without any additional dependencies.
For restoring Datafy snapshots when the Datafy API is unavailable
For complete offline restoration of Datafy snapshots, without Datafy Autoscaler
Integration with Backup Managers
Datafy snapshots can be integrated into the workflows of your existing backup management tools. They can be used seamlessly with any backup tool that uses the K8s CSI, and with minimal integration with custom backup systems.
Kubernetes CSI Integration
Datafy integrates directly with the Kubernetes CSI Snapshotter, allowing Kubernetes-native backup tools like Velero to seamlessly create snapshots of Datafy-managed volumes. For an overview of how Datafy extends the CSI driver in your cluster, see AutoScaler on Kubernetes. The resulting snapshots are associated with specific PVCs, and can be used directly in the rest of the backup and restoration flow.
To enable this integration:
Make sure your cluster is set up for taking snapshots through the CSI:
The
snapshot-controllerEKS add-on is installed on your cluster, and thecsi-snapshottersidecar is installed on your cluster's CSI-controller podAn appropriate
VolumeSnapshotClassresource is defined in the cluster
Configure your backup tool to use the CSI Snapshotter (and not the AWS native snapshotter).
When a snapshot is triggered, it will call the Datafy API in the background for Autoscaling volumes.
Custom Backup Systems
If you use a custom backup manager or automation script, adjust your logic to use Datafy snapshots at each part of the snapshot lifecycle.
Snapshot creation - Use the Datafy API instead of the AWS snapshot API to create snapshots of AutoScaling volumes.
Snapshot retention - Retention policies that target all snapshots in the account will apply to Datafy snapshots as well. If you use targeted retention policies, make sure to apply them to snapshots with the tag
Managed-By: Datafy.io.Restoration from snapshots - As detailed above, restoration of volumes from Datafy snapshots follows a similar process as restoring volumes from regular EBS snapshots. Your restoration logic should:
Ensure that Datafy AutoScaler is installed on the instances the new volumes will be attached to.
Identify the relevant snapshots using the
datafy:source-volume:idanddatafy:snapshot:idtags, and use the Datafy API instead of AWS to create new volumes from the snapshots and to attach them.
Last updated
Was this helpful?
