Working with backups - FSx for ONTAP

Working with backups

With FSx for ONTAP, you can take automatic daily backups and user-initiated backups of the volumes on your file system. Amazon FSx backups are per volume; that is, each backup contains only the data in a particular volume. Amazon FSx backups are highly durable and incremental.

Amazon FSx backups are incremental, whether they are generated using the automatic daily backup or the user-initiated backup feature. This means that only the data on the volume that has changed after your most recent backup is saved. This minimizes the time required to create the backup and saves on storage costs by not duplicating data. When you delete a backup, only the data unique to that backup is removed. Each Amazon FSx backup contains all of the information that is needed to create a new volume from the backup, effectively restoring a point-in-time snapshot of the file system volume.

Creating regular backups for your volumes is a best practice that helps support your backup retention and compliance needs. Working with Amazon FSx backups is easy, whether it's creating backups, restoring from a backup, or deleting a backup.

Working with automatic daily backups

By default, Amazon FSx takes an automatic daily backup of your file system's volumes. These automatic daily backups occur during the daily backup window that was established when you created the file system. At some point during the daily backup window, storage I/O might be suspended briefly while the backup process initializes (typically for less than a few seconds). When you choose your daily backup window, we recommend that you choose a convenient time of the day. This time ideally is outside of the normal operating hours for the applications that use your volumes.

Automatic daily backups are kept for a certain period of time, known as a retention period. The default retention period for automatic daily backups is 7 days. You can set the retention period to be between 1–90 days.

Note

While automatic daily backups have a maximum retention period of 90 days, user-initiated backups are kept forever, unless you delete them. For more information about user-initiated backups, see Working with user-initiated backups..

Automatic daily backups are deleted when the volume is deleted. If you set the retention period to 0, automatic backups will be disabled.

Both the daily backup window and retention period are system-level settings that apply to all the volumes on your file system. You can use the Amazon FSx console, AWS CLI, or one of the AWS SDKs to change the backup window and backup retention period for your file systems. Use the UpdateFileSystem API operation or the update-file-system CLI command.

Working with user-initiated backups

With Amazon FSx, you can manually take backups of your file system's volumes at any time. You can do so using the Amazon FSx console, API, or the AWS Command Line Interface (AWS CLI). Your user-initiated backups never expire, and they are available for as long as you want to keep them. User-initiated backups are retained even after you delete the volume or the file system the backups were taken on. You can delete user-initiated backups only by using the Amazon FSx console, API, or CLI. They are never automatically deleted by Amazon FSx. For more information, see Deleting backups.

Creating user-initiated backups

The following procedure guides you through how to create a user-initiated backup in the Amazon FSx console for a volume of an existing file system.

To create a user-initiated backup of a volume

  1. Open the Amazon FSx console at https://console.aws.amazon.com/fsx/.

  2. Navigate to File systems and choose the ONTAP file system that you want to back up a volume for.

  3. Choose the Volumes tab.

  4. Choose the volume you want to back up.

  5. From Actions, choose Create backup.

  6. In the Create backup dialog box that opens, provide a name for your backup. Backup names can be a maximum of 256 Unicode characters, including letters, white space, numbers, and the special characters . + - = _ : /

  7. Choose Create backup.

You have now created a backup of one of your file system's volumes. You can find a table of all your backups in the Amazon FSx console by choosing Backups in the left side navigation. You can search for the name you gave your backup, and the table filters to only show matching results.

When you create a user-initiated backup as this procedure described, it has the type USER_INITIATED, and it has the CREATING status until it is fully available.

Restoring backups

You can use an available backup to create a new volume, effectively restoring a point-in-time snapshot of a volume. You can restore a backup using the console, AWS CLI, or one of the AWS SDKs. Restoring a backup to a file system takes the same amount of time as creating a new volume. The data restored from the backup must be downloaded to your file system before the volume can be brought online.

The following procedure guides you through how to restore a backup using the console to create a new volume.

To restore a volume from a backup

  1. Open the Amazon FSx console at https://console.aws.amazon.com/fsx/.

  2. From the console dashboard, choose Backups from the left side navigation.

  3. Choose the backup that you want to restore from the Backups table, and then choose Restore backup.

    Doing so opens the volume creation wizard. This wizard is identical to the standard volume creation wizard, except that the file system ID is already filled in.

  4. Provide configuration information for the volume. For more information, see To create a volume (console).

  5. Review the settings, and then choose Confirm.

You have restored from a backup, and a volume is now being created. When its status changes to CREATED, you can use the volume as normal.

Deleting backups

Deleting a backup is a permanent, unrecoverable action. Any data in a deleted backup is also deleted. Do not delete a backup unless you're sure you won't need that backup again in the future.

To delete a backup

  1. Open the Amazon FSx console at https://console.aws.amazon.com/fsx/.

  2. From the console dashboard, choose Backups from the left side navigation.

  3. Choose the backup that you want to delete from the Backups table, and then choose Delete backup.

  4. In the Delete backups dialog box that opens, confirm that the ID of the backup identifies the backup that you want to delete.

  5. Confirm that the check box is checked for the backup that you want to delete.

  6. Choose Delete backups.

Your backup and all included data are now permanently and unrecoverably deleted.

Setting up a custom backup schedule

Amazon FSx for NetApp ONTAP automatically takes a backup of your volumes once a day during a daily backup window that you can specify. Amazon FSx enforces a retention period that you specify for these automatic backups. It also supports user-initiated backups, so you can take backups of your volumes at any time.

Following, you can find the resources and configuration to deploy custom backup scheduling. Custom backup scheduling performs user-initiated backups of your Amazon FSx volumes on a custom schedule that you define. Examples might be once every six hours, once every week, and so on. This script also configures deleting backups older than your specified retention period.

The solution automatically deploys all the components needed, and takes in the following parameters:

  • A volume ID

  • A CRON schedule pattern for performing backups

  • The backup retention period (in days)

  • The backup name tags

For more information on CRON schedule patterns, see Schedule Expressions for Rules in the Amazon CloudWatch Events User Guide.

Architecture overview

This solution does the following:

  1. The AWS CloudFormation template deploys an CloudWatch Event, a Lambda function, an Amazon SNS queue, and an IAM role. The IAM role gives the Lambda function permission to invoke the Amazon FSx API operations.

  2. The CloudWatch event runs on a schedule you define as a CRON pattern, during the initial deployment. This event invokes the solution’s backup manager Lambda function that invokes the Amazon FSx CreateBackup API operation to initiate a backup.

  3. The backup manager retrieves a list of existing user-initiated backups for the specified volume using DescribeBackups. It then deletes backups older than the retention period, which you specify during the initial deployment.

  4. The backup manager sends a notification message to the Amazon SNS queue on a successful backup if you choose the option to be notified during the initial deployment. A notification is always sent in the event of a failure.

AWS CloudFormation template

This solution uses AWS CloudFormation to automate the deployment of the Amazon FSx custom backup scheduling solution. To use this solution, download the fsx-ontap-scheduled-backup.template AWS CloudFormation template.

Automated deployment

The following procedure configures and deploys this custom backup scheduling solution. It takes about five minutes to deploy. Before you start, you must have the ID of a volume on an Amazon FSx file system running in an Amazon Virtual Private Cloud (Amazon VPC) in your AWS account. For more information on creating these resources, see Creating a volume.

Note

Implementing this solution incurs billing for the associated AWS services. For more information, see the pricing details pages for those services.

To launch the custom backup solution stack

  1. Download the fsx-ontap-scheduled-backup.template AWS CloudFormation template. For more information on creating an AWS CloudFormation stack, see Creating a stack on the AWS CloudFormation console in the AWS CloudFormation User Guide.

    Note

    By default, this template launches in the US East (N. Virginia) AWS Region. Amazon FSx is currently only available in specific AWS Regions. You must launch this solution in an AWS Region where Amazon FSx is available. For more information, see Amazon FSx endpoints and quotas in the AWS General Reference.

  2. For Parameters, review the parameters for the template and modify them for the needs of your file system volumes. This solution uses the following default values.

    Parameter Default Description
    FSx for NetApp ONTAP Filesystem Volume ID No default value The volume ID for the volume that you want to back up.
    CRON schedule pattern for backups 0 0/6 * * ? * The schedule to run the CloudWatch event, triggering a new backup and deleting old backups outside of the retention period.
    Backup retention (days) 7 The number of days to keep user-initiated backups. The Lambda function deletes user-initiated backups older than this number of days.
    Name for backups User-scheduled backup The name for these backups, which appears in the Backup Name column of the Amazon FSx Management Console.
    Backup Notification Yes Choose whether to be notified when backups are successfully initiated. A notification is always sent if there's an error.
    Email address No default value The email address to subscribe to the SNS notifications.
  3. Choose Next.

  4. For Options, choose Next.

  5. For Review, review and confirm the settings. You must select the check box acknowledging that the template create IAM resources.

  6. Choose Create to deploy the stack.

You can view the status of the stack in the AWS CloudFormation console in the Status column. You should see a status of CREATE_COMPLETE in about five minutes.

Additional options

You can use the Lambda function created by this solution to perform custom scheduled backups of more than one FSx for ONTAP volume. The volume ID is passed to the Amazon FSx function in the input JSON for the CloudWatch event. The default JSON passed to the Lambda function is as follows, where the values for VolumeId and SuccessNotification are passed from the parameters specified when launching the AWS CloudFormation stack.

{ "start-backup": "true", "purge-backups": "true", "volume-id": "${VolumeId}", "notify_on_success": "${SuccessNotification}" }

To schedule backups for an additional FSx for ONTAP volume, create another CloudWatch event rule. You do so using the Schedule event source, with the Lambda function created by this solution as the target. Choose Constant (JSON text) under Configure Input. For the JSON input, simply substitute the volume ID of the FSx for ONTAP volume to back up in place of ${VolumeId}. Also, substitute either Yes or No in place of ${SuccessNotification} in the JSON above.

Any additional CloudWatch Event rules you create manually aren't part of the AWS CloudFormation stack for the Amazon FSx custom scheduled backup solution. Thus, they aren't removed if you delete the stack.