You can create snapshots for Extreme NAS file systems. This topic describes how to manage snapshots in the Apsara File Storage NAS console. You can create or delete snapshots. You can also create, apply, or delete snapshot policies.

Prerequisites

An Extreme NAS file system is created. For more information, see Mount a NAS Extreme file system.

Background information

Snapshots are commonly used to ensure data backup and recovery. To eliminate the risk of data loss, you can create a snapshot for the file system before you perform an operation. You can create manual snapshots for file systems. You can also use automatic snapshot policies to create auto snapshots.
Note Snapshots are only available for Extreme NAS file systems.

Create a snapshot

  1. Log on to the NAS console.
  2. Log on to the NAS console. In the left-side navigation pane, choose Data Service > Snapshot. On the Snapshot tab, click Manually Create a Snapshot.
    Note
    • You can create a maximum of 128 snapshots for a file system.
    • You can create snapshots only for a file system that is in the Running state.
    • You can create only one snapshot at a time.
    • If the file system expires during the creation of a snapshot, the file system is released and the created snapshot is deleted.
    • When you create a snapshot for the file system, the file system may exhibit a short-term decrease in I/O performance. We recommend that you create snapshots during off-peak hours.
    • A snapshot is a backup of a file system at a specific point in time. During the process of creating a snapshot, incremental data that is generated by the operating system is not synchronized to the snapshot.
    • Manual snapshots remain in a file system for persistent storage. We recommend that you delete snapshots that you do not need on a regular basis to reduce the extra costs that they incur.
    • If your account is overdue for more than 15 days, manual snapshots are deleted.
  3. In the Manually Create a Snapshot dialog box, set the parameters.
    Manually Create a Snapshot

    The following table describes the required parameters.

    Parameter Description
    File System Specify the ID of an Extreme NAS file system.
    Retention Time Select a retention period based on your needs:
    • Custom duration specifies a duration that ranges from 1 to 65536. Unit: day.
    • Select It is permanently retained until the number of snapshots reaches the maximum limit and is automatically deleted..
  4. Click OK to create the snapshot.

Create an auto snapshot

You can use an automatic snapshot policy to create auto snapshots.

  1. Log on to the NAS console.
  2. Create an automatic snapshot policy.
    1. Log on to the NAS console. In the left-side navigation pane, choose Data Service > Snapshot. On the Automatic Snapshot Policy tab, click Create an Automatic Snapshot Policy.
    2. In the Create an Automatic Snapshot Policy dialog box, set the required parameters.
      Create an automatic snapshot policy
      The following table describes the required parameters.
      Parameter Description
      Creation Time Specify the time when an auto snapshot is created. You can select one or more time points within the range of 00:00 to 23:00.
      Repeat Date Specify the frequency at which auto snapshots are created. You can select multiple days from Monday to Sunday.
      Retention Time
      • Select Custom duration and specify a durationwithin the range of 1 to 65536. Unit: days.
      • Select It is permanently retained until the number of snapshots reaches the maximum limit and is automatically deleted..
      Note
      • You can create a maximum of 100 automatic snapshot policies in each region for a single Alibaba Cloud account.
      • You can apply an automatic snapshot policy to multiple file systems.
      • If you modify the retention time of an automatic snapshot policy, the modification applies only to the snapshots that are created after the modification. The retention time of previous snapshots is not affected.
    3. Click OK.
  3. Apply the automatic snapshot policy.
    1. Find the automatic snapshot policy, 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 add the automatic snapshot policy to the Apply to The File System section.
      Note
      • You can create a maximum of 100 automatic snapshot policies in each region for a single Alibaba Cloud account.
      • If an auto snapshot is being created when the scheduled time for a new automatic snapshot arrives, the new snapshot creation is canceled. This may occur when the file system stores a large volume of data.

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

      • A file system has a maximum of 64 auto snapshots. If this limit is reached, the earliest auto snapshots are deleted. This rule does not apply to manual snapshots.
      • If your account is overdue for more than 15 days, manual snapshots are deleted.
      • If you modify the retention time of an automatic snapshot policy, the modification applies only to the snapshots that are created after the modification. The retention time of previous snapshots is not affected.
      • If an automatic snapshot is being created for a file system, you cannot create a manual snapshot for the file system. You must wait after the automatic snapshot is created.
      • You can only apply automatic snapshot policies to a file system that is in the Running state.
      • All automatic snapshots are named by using 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 naming format, auto indicates that the snapshot is an auto snapshot which is different from a manual snapshot. yyyyMMdd indicates the date when a 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 snapshot.

    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

To create a file system, you can specify a snapshot when you call API operations.

  1. Install Python and the SDK for Python.
    pip install aliyun-python-sdk-corepip
    pip install aliyun-python-sdk-bssopenapipip
    pip install aliyun-python-sdk-nas
  2. Customize the code that is provided in the 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 information about an AccessKey pair, see How can I obtain an AccessKey pair?.
    • set_parameters: Specify the required parameters of the file system.
    #! /usr/bin/env python
    # coding=utf-8
    
    from aliyunsdkcore.client import AcsClient
    from aliyunsdkcore.acs_exception.exceptions import ClientException
    from aliyunsdkcore.acs_exception.exceptions import ServerException
    from aliyunsdkbssopenapi.request.v20171214.GetPayAsYouGoPriceRequest import GetPayAsYouGoPriceRequest
    from aliyunsdkbssopenapi.request.v20171214.CreateInstanceRequest import CreateInstanceRequest
    from aliyunsdknas.request.v20170626.DescribeFileSystemsRequest import DescribeFileSystemsRequest
    
    client = AcsClient('<accessKeyId>', '<accessSecret>', 'cn-hangzhou')
    
    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": "Size",
                "Value": "100"
            },
            {
                "Code": "Throughput",
                "Value": "150"
            },
            {
                "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 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, 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.
Roll back a file system On the Snapshot tab, find the snapshot and click Rollback. You can roll back a file system to a previous snapshot.
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.