Extreme NAS file systems support the snapshot feature. Before you perform high-risk operations, you can create snapshots to back up data. If your data is lost, you can restore some or all of the data in a file system from a snapshot to a specified point in time. This topic describes how to manage snapshots for a file system in the Apsara File Storage NAS console. You can create or delete snapshots. You can create snapshots, create snapshot policies, and apply snapshot policies.

Prerequisites

The file system is in the Running state. Otherwise, you cannot create snapshots for the file system.

Usage notes

  • You can manually create a maximum of 128 snapshots for each file system. A maximum of 128 snapshots can be automatically created for each file system.
  • If a snapshot is being created for a file system, you cannot create another snapshot for the file system.
  • If a file system expires when a snapshot is being created for the file system, the file system is released and the snapshot is deleted.
  • While a snapshot is being created for a file system, the performance of the file system may be slightly compromised and the IOPS may be temporarily degraded. We recommend that you do not create snapshots during peak hours.
  • A snapshot is a backup of a file system at a specific point in time. When you create a snapshot for a file system, incremental data of the file system is not synchronized to the snapshot.

Create a manual snapshot

Before you perform a high-risk operation, we recommend that you create a snapshot to ensure data security.
  • Manual snapshots are permanently retained in a file system. We recommend that you delete the manual snapshots that you no longer need on a regular basis to reduce costs.
  • Manual snapshots are permanently retained if your account has sufficient balance. If you can no longer use NAS for 15 days due to overdue payments, your manual snapshots are deleted.
  1. Log on to the NAS console.
  2. In the left-side navigation pane, choose Data Service > Snapshot.
  3. On the Snapshot page, click Manually Create a Snapshot.
  4. In the Manually Create a Snapshot dialog box, set the parameters. The following table describes the parameters.
    Parameter Description
    File System Select the ID of the Extreme NAS file system for which you want to create a manual snapshot.
    Retention Period Select a retention period based on your business requirements.
    • Custom duration: Specify the period for which the snapshots are retained. Unit: days. Valid values: 1 to 65536.
    • It is permanently retained until the number of snapshots reaches the maximum limit and is automatically deleted.: The created snapshots are permanently retained. When the number of manual snapshots reaches 128, the file system deletes the earliest manual snapshot.
  5. Click OK.

Create an automatic snapshot

You can apply an automatic snapshot policy to an Extreme NAS file system. Snapshots are then automatically created for the Extreme NAS file system at a specified point in time. If you use automatic snapshots to back up data from the Extreme NAS file system, you can improve the security of your business data.
  • You can apply an automatic snapshot policy to multiple file systems.
  • When the number of automatic snapshots for a file system reaches 128, the file system deletes the earliest automatic snapshot. Manual snapshots are not affected.
  • If you modify the retention period in an automatic snapshot policy, the new retention period applies only to new snapshots. The existing snapshots still use the original retention period.
  • If an automatic snapshot is being created when the scheduled time for a new automatic snapshot arrives, the creation of the new snapshot is skipped. This may occur when the file system stores a large volume of data.

    For example, you have scheduled automatic snapshots to be created at 09:00:00, 10:00:00, 11:00:00, and 12:00:00. The system starts to create a snapshot at 09:00:00 and does not complete the process until 10:20:00. The process takes 80 minutes because the file system has a large volume of data. In this case, the system does not create a snapshot at 10:00:00, but creates a snapshot at 11:00:00.

  • All automatic snapshots are named in the auto_yyyyMMdd_X format.

    For example, auto_20140418_1 indicates the name of the first automatic snapshot that was created on April 18, 2014. In the preceding format, auto indicates that the snapshot is an automatic snapshot instead of a manual snapshot. yyyyMMdd indicates the date when an automatic snapshot is created. yyyy stands for the year, MM the month, and dd the day of the month. X indicates the ordinal number of the automatic snapshot.

  1. Log on to the NAS console.
  2. In the left-side navigation pane, choose Data Service > Snapshot.
  3. Create an automatic snapshot policy.
    1. On the Snapshot page, click the Automatic Snapshot Policy tab.
    2. On the Automatic Snapshot Policy tab, click Create an Automatic Snapshot Policy.
    3. In the Create an Automatic Snapshot Policy dialog box, set the following parameters.
      Parameter Description
      Created At The hour of the day at which an automatic snapshot is created. You can select one or more hours from 00:00 to 23:00.
      Note When you create a snapshot for a file system, the I/O performance of the file system is temporarily degraded. We recommend that you create automatic snapshots during off-peak hours.
      Repeat Date The days of the week on which automatic snapshots are created. You can select one or more days from Monday to Sunday.
      Retention Time The retention period of the automatic snapshots. The default retention period is 30 days. The following options are available:
      • Custom duration: Specify the retention period of the snapshots. Unit: days. Valid values: 1 to 65536.
      • It is permanently retained until the number of snapshots reaches the maximum limit and is automatically deleted.: The created automatic snapshots are permanently retained. When the number of automatic snapshots for a file system reaches 128, the file system deletes the earliest automatic snapshot.
    4. Click OK.
  4. Apply the automatic snapshot policy.
    1. Find the automatic snapshot policy that you want to apply and click Apply to The File System.
    2. In the File System ID section of the Apply to The File System dialog box, select the file systems and click the > icon to add the file systems to the Apply to The File System section.
    3. Click OK.
      After you apply an automatic snapshot policy to a file system, NAS creates automatic snapshots for the file system based on the policy.

Use a snapshot to create a file system

You can also use an SDK to create a file system from a snapshot of a specified point in time.
Notice If you want to restore data from a snapshot of a specified point in time to an existing file system, you can create a file system from the snapshot. Then, you can copy the data from the created file system to the existing file system.
  1. Install NAS SDK for Python.
    pip install aliyun-python-sdk-core
    pip install aliyun-python-sdk-bssopenapi
    pip install aliyun-python-sdk-nas
  2. Customize the code that is provided in NAS SDK for Python and run the code to create a file system.

    The sample code creates a pay-as-you-go file system. If you want to create a subscription file system, you must customize the sample code.

    The sample code includes the following required parameters.

    • accessKeyId and accessSecret: Specify the AccessKey ID and AccessKey secret of your Alibaba Cloud account. For more information, see How can I obtain an AccessKey pair?.
    • set_parameters: Specify the required parameters for the file system that you want to create.
      Parameter Description
      Region The region to which the snapshot belongs. For example, the region is cn-hangzhou. You can call the DescribeRegions operation to query regions.
      Zone The zone in the region to which the snapshot belongs. For example, the zone is cn-hangzhou-g. You can call the DescribeZones operation to query zones.
      ProtocolType The protocols that the file system supports. Extreme NAS file systems support only NFS.
      StorageType The storage class of the file system. Valid values:
      • standard: standard
      • advance: advanced
      Capacity The Extreme NAS file system must have the same storage capacity as the file system for which snapshots are created.
      SnapshotId The ID of the snapshot.
    from aliyunsdkcore.client import AcsClient
    from aliyunsdkbssopenapi.request.v20171214.CreateInstanceRequest import CreateInstanceRequest
    
    client = AcsClient('<accessKeyId>', '<accessSecret>', '<Region>')
    
    def Create():
        request = CreateInstanceRequest()
        request.set_accept_format('json')
        request.set_ProductCode("nas")
        # Pay-as-you-go
        request.set_SubscriptionType("PayAsYouGo")
        request.set_ProductType("nas_extreme_post")
        # Subscription
        # request.set_SubscriptionType("Subscription")
        # request.set_ProductType("nas_extreme")
        # request.set_Period(1) # The subscription duration. Unit: months.
        request.set_Parameters([
            {
                "Code": "Region",
                "Value": "cn-shanghai"
            },
            {
                "Code": "Zone",
                "Value": "cn-shanghai-g"
            },
            {
                "Code": "ProtocolType",
                "Value": "NFS"
            },
            {
                "Code": "StorageType",
                "Value": "standard"
            },
            {
                "Code": "Capacity",
                "Value": "100"
            },
            {
                "Code": "SnapshotId",
                "Value": "s-extreme-xxxxxxxxxx"
            }
        ])
        response = client.do_action_with_exception(request)
        print(response)
    if __name__ == '__main__':
        Create()

Related operations

Operation Description
Cancel an automatic snapshot policy To cancel an automatic snapshot policy, perform the following steps:
  1. On the File System List page, find the file system, and choose More > Snapshot > Set Snapshot Policy.
  2. In the Set Snapshot Policy dialog box, turn off the Apply Policy switch and click Cancel to cancel the policy that is applied to the file system.
View a snapshot On the Snapshot tab, view the list of snapshots and their details.
Delete a snapshot On the Snapshot tab, find the snapshot and click Delete.
View automatic snapshot policies On the Automatic Snapshot Policy tab, view the list of automatic snapshot policies and their details.
View the file systems to which an automatic snapshot policy is applied On the Automatic Snapshot Policy tab, find the automatic snapshot policy and click Apply to The File System to view the systems to which the policy is applied.
Modify an automatic snapshot policy On the Automatic Snapshot Policy tab, find the automatic snapshot policy and click Modify Policy.
Delete an automatic snapshot policy On the Automatic Snapshot Policy tab, find the automatic snapshot policy and click Delete.