Managing Snapshots

The File Storage service supports snapshots for data protection of your file system. Snapshots are a consistent, point-in-time view of your file systems. Snapshots are copy-on-write, and scoped to the entire file system. The File Storage service encrypts all file system and snapshot data at rest. You can take as many snapshots as you need.

Data usage is metered against differentiated snapshot data. If nothing has changed within the file system since the last snapshot was taken, the new snapshot does not consume more storage. For more information, see File System Usage and Metering.

Snapshots are accessible under the root directory of the file system at .snapshot/name. When you use an NFSv3 client to perform operations such as ls, du, or find on the snapshot directory, the service automatically exports the directory. The client uses nfs_d_automount() to detect and mount the directory. After the directory is detected and mounted the first time, the client mounts the directory automatically.

For data protection, you can use file system replication to copy data in one file system to another file system in the same region or a different region. You can also use a tool that supports NFSv3 to copy your data to a different availability domain, region, file system, Object Storage, or remote location. See Backing Up Snapshots to Object Storage Using rclone for an example.

For best performance, we recommend that you use the parallel tar (partar) and parallel copy (parcp) tools provided in the File Storage Parallel File Toolkit for this purpose. These tools work best with parallel workloads and requests. The Parallel File Toolkit is available for Oracle Linux, Red Hat Enterprise Linux, and CentOS. You can use rsync or regular tar for other operating system types. See Installing the Parallel File Tools for more information.

Tip

Watch a video about protecting data with snapshots in File Storage.

Snapshot Types

User-created snapshots: You create these snapshots when you want to preserve a point-in-time view of the file system. File systems can have one or many user-created snapshots.

Clone source snapshots: Any snapshot, user-created or replication-created, that is used as the blueprint for a clone. See Cloning File Systems.

Replication snapshots: Automatically created by a replication resource. Replication snapshots are used to transmit data from the source file system to the target file system. Replication snapshots follow the naming pattern replication-snapshot-<replication_number>-<creation_time_UTC>. You cannot modify a replication snapshot. Only one replication snapshot is preserved for disaster recovery at a time. Older replication snapshots are deleted. See File System Replication.

Managing Clone and Replication Snapshots

Cloning and replicating file systems also clone and replicate the file system's snapshots. This section describes how to avoid replicating snapshots you don't need, how to identify snapshots to clone for replication, and how to identify snapshots you can safely discard.

Identifying Snapshots

Each snapshot has the following identifiers:

  • Snapshot OCID: The unique OCID (Oracle Cloud Identifier) for the snapshot.
  • Provenance OCID: An OCID (Oracle Cloud Identifier) identifying the parent file system from which this snapshot was cloned, if any. If the snapshot was not the result of cloning, this value is the same as the snapshot OCID.
You can identify the type and history of a snapshot by comparing its snapshot OCID and Provenance OCID values.
  • When you manually create a snapshot in a file system, the snapshot's OCID and Provenance OCID value are the same.
  • When you clone a file system, all its snapshots are also cloned. When a snapshot is created by cloning, the cloned snapshot's OCID and Provenance OCID values are different. The Provenance OCID is the OCID of the clone's parent file system.
  • When you replicate a file system, all its snapshots are also replicated by default. When a snapshot is created by replication, the replication snapshot's Provenance OCID is the same as the Provenance OCID of the original snapshot.
Method of creation Snapshot OCID Provenance OCID
Manual New Snapshot's OCID (Oracle Cloud Identifier) New Snapshot's OCID (Oracle Cloud Identifier)
Cloned New Snapshot's OCID (Oracle Cloud Identifier) Parent File System OCID (Oracle Cloud Identifier)
Replicated New Snapshot's OCID (Oracle Cloud Identifier) Copied Snapshot's OCID (Oracle Cloud Identifier)

Required IAM Service Policy

To use Oracle Cloud Infrastructure, you must be granted security access in a policy  by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don’t have permission or are unauthorized, verify with your administrator what type of access you have and which compartment  to work in.

For administrators: The policy in Let users create, manage, and delete file systems allows users to create and delete snapshots.

If you're new to policies, see Getting Started with Policies and Common Policies.

Details About Your Snapshot

The Details page provides the following information about your snapshot:

SNAPSHOT OCID
Every Oracle Cloud Infrastructure resource has an Oracle-assigned unique ID called an Oracle Cloud Identifier (OCID). You need your snapshot's OCID to use the Command Line Interface (CLI) or the API. You also need the OCID when contacting support. See Resource Identifiers.
CREATED
The date and time that the snapshot was created.
SNAPSHOT TIME
The date and time the snapshot was taken. This value might differ from the date and time that the snapshot was created if it was cloned or replicated.
DESCENDANTS
Indicates whether the this snapshot has been used to create a clone. See Cloning File Systems.
PROVENANCE OCID
An OCID (Oracle Cloud Identifier) identifying the parent file system from which this snapshot was cloned, if any. If the snapshot was not the result of cloning, this value is the same as the snapshot OCID. For more information, see Managing Clone and Replication Snapshots.
TYPE
Indicates whether the snapshot was created by a user or by Replication.

Tagging Resources

You can apply tags to your resources to help you organize them according to your business needs. You can apply tags at the time you create a resource, or you can update the resource later with the wanted tags. For general information about applying tags, see Resource Tags.

Using the Console

To create a snapshot
  1. Open the navigation menu and click Storage. Under File Storage, click File Systems.
  2. In the List Scope section, select a compartment.
  3. In the File Systems list, locate the file system you want to take a snapshot of. Click the Actions menu, and then click View Details.
  4. In Resources, click Snapshots.
  5. Click Create Snapshot.
  6. Fill out the required information:

    • Name: Enter a name for the snapshot. It must be unique among all other snapshots for this file system. The name can't be changed. Avoid entering confidential information.
    • Show Tagging Options: If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you are not sure whether to apply tags, skip this option (you can apply tags later) or ask your administrator.
  7. Click Create. The snapshot is accessible under the root directory of the file system at .snapshot/name.
To view details of a snapshot
  1. Open the navigation menu and click Storage. Under File Storage, click File Systems.
  2. In the List Scope section, select a compartment.

  3. In the File Systems list, locate the file system you took the snapshot of. Click the Actions menu, and then click View Details.

  4. In Resources, click Snapshots.
  5. In the Snapshots list, locate the snapshot you're interested in. Click the Actions menu, and then click View Details.
To create a snapshot from a Unix-style instance

You can create a snapshot from an instance that you've mounted the file system to. Snapshots are created under the root folder of your file system, in a hidden directory named .snapshot.

  1. Connect to your instance and open a command window.
  2. Navigate to your file system's hiden .snapshot directory. Type the following, replacing yourmountpoint with the name of the directory where you mounted the file system.

    cd /mnt/yourmountpoint/.snapshot
  3. Use the mkdir command to create a directory in the hidden .snapshot directory. The directory you create is the snapshot. Give the snapshot a name that will help you identify it. Avoid using confidential information in the snapshot name. For example:

    mkdir snapshot-Jan1
  4. Use the ls command to verify that your snapshot has been created in the .snapshot directory.

    ls
To restore a snapshot

Snapshots are created under the root folder of your file system, in a hidden directory named .snapshot.

You can restore a file within the snapshot, or an entire snapshot using the cp command. Use the -r option when restoring a snapshot that contains subdirectories.

For example:

cp -r .snapshot/snapshot_name/* destination_directory_name

Optionally, you can use rsync, tar, or another tool that supports NFSv3 to copy your data to another remote location. For optimal performance, use the Parallel File Tools.

For example: 

parcp .snapshot/snapshot_name/* destination_directory_name
To manage tags for a snapshot
  1. Open the navigation menu and click Storage. Under File Storage, click File Systems.
  2. In the List Scope section, select a compartment.

  3. In the File Systems list, locate the file system you took the snapshot of. Click the Actions menu, and then click View Details.

  4. In Resources, click Snapshots.
  5. In the Snapshots list, locate the snapshot you're interested in. Click the Actions menu, and then click View Details.
  6. Click the Tags tab to view or edit the existing tags. Or click Add Tags to add new ones.

For more information, see Resource Tags.

To clone a file system from a snapshot

Before you can clone a file system, at least one snapshot must exist for the file system. See To create a snapshot for more information.

  1. Open the navigation menu and click Storage. Under File Storage, click File Systems.
  2. In the List Scope section, select a compartment.

  3. Find the file system you want to clone, click the Actions menu, and then click View Details.

  4. In the Snapshots list, find the snapshot you want to use as the source of the clone, click the Actions menu, and then click Clone.

    The clone is a copy of the file system data as it exists at the date and time that the selected snapshot was taken.

  5. In the Create Clone page, specify the details about the clone that aren't inherited from the parent file system, such as name, export information, and mount target information. You can choose to accept the provided system defaults, or change them by clicking Edit Details. For a detailed description of each file system property and its defaults, see To create a file system.

  6. Click Create.

Hydration begins immediately upon instantiation of the clone.

Cloned file systems are managed in the same way that any other file system is managed. See Managing File Systems for more information.

To view the clone's hydration status, source snapshot, parent file system, and other cloning information, visit the Details page of the cloned file system. See To view file system details.

You can mount and use the clone immediately for READ or WRITE operations after you create it. See Mounting File Systems for more information.

To delete a snapshot
Note

If the snapshot is deleted while a clone of it is being hydrated, the source snapshot remains in the DELETING state until hydration is complete. See Cloning File Systems for more information.
  1. Open the navigation menu and click Storage. Under File Storage, click File Systems.
  2. In the List Scope section, select a compartment.
  3. Find the file system with the snapshot you want to delete.
  4. Click the Actions menu, and then click View Details.
  5. In Resources, click Snapshots.
  6. Find the snapshot you want to delete and click its associated checkbox.
  7. Click Delete.
  8. Confirm when prompted.

Using the Command Line Interface (CLI)

For information about using the CLI, see Command Line Interface (CLI).

To create a snapshot

You can create a snapshot of a file system. A snapshot is a point-in-time view of the file system. The snapshot is accessible at ./snapshot/name.

Open a command prompt and run oci fs snapshot create to create a snapshot of a file system.

For example:

oci fs snapshot create --file-system-id <file_system_OCID> --name "<January1>"

Avoid entering confidential information.

To list snapshots

Open a command prompt and run oci fs snapshot create to list all snapshots associated with a specific file system.

For example:

oci fs snapshot list --file-system-id <file_system_OCID>
To get a specific snapshot

Open a command prompt and run oci fs snapshot get to retrieve information about a specific snapshot.

For example:

oci fs snapshot get --snapshot-id <snapshot_OCID>
To delete a snapshot

Open a command prompt and run oci fs snapshot delete to delete a snapshot.

For example:

oci fs snapshot delete --snapshot-id <snapshot_OCID>