Working with snapshots - FSx for ONTAP
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Working with snapshots

A snapshot is a read-only image of an Amazon FSx for NetApp ONTAP volume at a point in time. Snapshots offer protection against accidental deletion or modification of files in your volumes. With snapshots, your users can easily view and restore individual files or folders from an earlier snapshot. Doing this enables users to easily undo changes and compare file versions.

Because snapshots are stored alongside your file system's data, they consume the file system's storage capacity. However, snapshots consume storage capacity only for the changed portions of files since the last snapshot. Note that snapshots consume no capacity at the time of creation. Snapshots stored in your file system are not included in backups of your file system volumes.

Snapshots are enabled by default on your volumes using the default snapshot policy. Your FSx for ONTAP file system has three built-in snapshot policies to choose from when creating or updating a volume in the Amazon FSx console, the Amazon CLI, or the Amazon FSx API. You can also create a custom snapshot policy or snapshots on-demand using the ONTAP CLI or REST API. Snapshots are stored in the .snapshot directory at the root of a volume. You can store up to 1,023 snapshots per volume at any point in time. Once you reach this limit, you must delete an existing snapshot before a new snapshot of your volume can be created.

Snapshot policies

The snapshot policy defines how the system creates snapshots for a volume. The policy specifies when to create snapshots, how many copies to retain, and how to name them. There are three built-in snapshot policies for FSx for ONTAP:

  • default

  • default-1weekly

  • none

By default, every volume is associated with the file system's default snapshot policy. We recommend using this policy for most workloads.

The default policy automatically creates snapshots on the following schedule, with the oldest snapshot copies deleted to make room for newer copies:

  • A maximum of six hourly snapshots taken five minutes past the hour.

  • A maximum of two daily snapshots taken Monday through Saturday at 10 minutes after midnight.

  • A maximum of two weekly snapshots taken every Sunday at 15 minutes after midnight.

Note

Snapshot times are based on the file system's time zone, which defaults to Coordinated Universal Time (UTC). For information about changing the time zone, see Displaying and setting the system time zone in the NetApp Support documentation.

The default-1weekly policy works in the same way as the default policy, except that it only retains one snapshot from the weekly schedule.

The none policy doesn't take any snapshots. You can assign this policy to volumes to prevent automatic snapshots from being taken.

You can also create a custom snapshot policy using the ONTAP CLI or REST API. For more information, see Create a Snapshot Policy in the NetApp ONTAP Product Documentation. You can choose a snapshot policy while creating or updating a volume in the Amazon FSx console, the Amazon CLI, or the Amazon FSx API. For more information, see Creating volumes and Updating a volume.

Restoring individual files and folders

Using the snapshots on your Amazon FSx file system, your users can quickly restore previous versions of individual files or folders. Doing this enables them to recover deleted or changed files stored on the shared file system. They do this in a self-service manner directly on their desktop without administrator assistance. This self-service approach increases productivity and reduces administrative workload.

Linux and macOS clients can view snapshots in the .snapshot directory at the root of a volume. Windows clients can view snapshots in the Previous Versions tab of Windows Explorer (when right-clicking on a file or folder).

Deleting snapshots

Snapshots are point-in-time read-only images of a prior state of your volume, and are enabled by default on all FSx for ONTAP volumes to protect your data. Snapshots consume storage capacity only for the portions of files that have changed since the last snapshot. For this reason, if your workload changes data rapidly, snapshots from old data can take up a significant portion of the capacity of your volume.

For example, the volume show-space command output provided earlier shows 140 KB of User Data. However, the volume had 9.8 GB of User Data before the user data was deleted. Even if you've deleted the files from your volume, a snapshot might still reference old user data. Because of this, Snapshot Reserve and Snapshot Spill in the prior example take up a total of 9.8 GB of space, even though there is virtually no user data on the volume.

To free up space on volumes, you can delete older snapshots that you no longer need. You can do this by creating a snapshot auto-delete policy or by manually deleting snapshots. Deleting a snapshot deletes the changed data stored on the snapshot.

Snapshot reserve

Snapshot copy reserve sets a specific percent of the disk space for storing Snapshot copies. The default Snapshot copy reserve is set to 5 percent of the disk space. If the Snapshot copies exceed the reserve space, they spill into the active file system and this process is called Snapshot spill.

The Snapshot copy reserve must have sufficient space allocated for the Snapshot copies, including volume backups. If the Snapshot copies exceeds the reserve space, you must delete the existing Snapshot copies from the active file system to recover the space, for the use of the file system. You can also modify the percent of disk space that is allotted to Snapshot copies.

Whenever Snapshots consume more than 100% of the Snapshot reserve, they begin to occupy primary SSD storage space. This process is called Snapshot spill. When the Snapshots continue to occupy the active file system space, the system is in danger of becoming full. If the system becomes full due to Snapshot spill, you can create files only after you delete enough Snapshots.

When enough disk space is available for Snapshots in the Snapshot reserve, deleting files from the primary SSD tier frees disk space for new files, while the Snapshot copies that reference those files consume only the space in the Snapshot copy reserve.

Because there is no way to prevent Snapshots from consuming disk space greater than the amount reserved for them (the Snapshot reserve), it is important to reserve enough disk space for Snapshots so that the primary SSD tier always has space available to create new files or modify existing ones.

If a Snapshot is created when the disks are full, deleting files from the primary SSD tier does not create any free space because all that data is also referenced by the newly created Snapshot. You must delete the Snapshot before in order to free up storage in order to create or update any files.

You can modify the amount of Snapshot reserve on a volume using the NetApp ONTAP CLI. For more information, see Updating volume's Snapshot reserve.