This topic describes how to create an Apsara File Storage NAS file system. After you create a NAS file system, you can mount the file system on multiple compute instances. This way, multiple clients can access the file system at the same time. You can create a General-purpose NAS file system or an Extreme NAS file system.

Background information

A General-purpose NAS file system and an Extreme NAS file system have different features and are suitable for different scenarios. For more information, see General-purpose NAS file systems and Extreme NAS file systems.

Create a General-purpose NAS file system in the NAS console

  1. Log on to the NAS console.
  2. In the File System Selection Guide section of the Overview page, click Create General-purpose NAS File System.
  3. On the General-purpose NAS (Pay-as-you-go) page, configure the parameters. The following table describes the parameters.
    ParameterDescription
    RegionSelect the region where you want to create the file system.
    Note
    • We recommend that you select the region where the Elastic Compute Service (ECS) instance on which you want to mount the file system resides. Otherwise, the ECS instance cannot access the NAS file system. You can use Cloud Enterprise Network (CEN) to mount a file system across regions. However, a cross-region mount degrades the data transfer performance of the file system. For more information, see Mount a file system across VPCs in the same region.
    • You can use an Alibaba Cloud account to create up to 20 file systems in a region.
    ZoneSelect the zone in which you want to create the file system. Each region has multiple isolated locations known as zones. Each zone has its own independent power supply and networks. If the ECS instance and the file system reside in different zones of the same region, the ECS instance can access the file system.

    We recommend that you select the zone where the ECS instance resides. This reduces the latency that is caused by cross-zone communication between the file system and the ECS instance.

    Storage TypeSelect the type of the file system. Valid values: Performance NAS and Capacity NAS.

    For information about the performance comparison between Capacity NAS file systems and Performance NAS file systems, see General-purpose NAS file systems.

    Protocol TypeSelect the protocol type of the file system. Valid values: NFS and SMB.

    The Network File System (NFS) protocol is suitable for file sharing among Linux ECS instances. The Server Message Block (SMB) protocol is suitable for file sharing among Windows ECS instances.

    Recycle BinSpecify whether to enable the recycle bin feature. Valid values:
    • Enable: enables the recycle bin feature. By default, this feature is enabled after a file system is created.

      After you enable the recycle bin feature, deleted files or directories are temporarily stored in the recycle bin. If you accidentally delete files from a file system, you can restore the files and the metadata of the files from the recycle bin. The metadata includes the UID, GID, and ACL. For more information, see Recycle bin.

    • Disable: disables the recycle bin feature.
    Encryption TypeSelect the type of server-side encryption. Valid values:
    • Not Encrypted: disables server-side encryption.
    • NAS-managed Key: encrypts the data in the file system by using a NAS-managed key.
    • KMS-managed Key: encrypts and decrypts the data in the file system by using a custom key that is managed by Key Management Service (KMS).

    If you set the Encryption Type parameter to NAS-managed Key or KMS-managed Key, the key that is used to encrypt the data in the file system is managed by KMS. When you access the encrypted data, the data is automatically decrypted. For more information, see Server-side encryption.

    Note You can use KMS-managed keys only in the following regions:
    • US (Silicon Valley)
    • US (Virginia)
    • UK (London)
    • Australia (Sydney)
    • Germany (Frankfurt)
    • India (Mumbai)
    • Singapore (Singapore)
    Key IDIf you set the Encryption Type parameter to KMS-managed Key, you must select a customer master key (CMK) ID from the drop-down list.
    Key AliasIf you set the Encryption Type parameter to KMS-managed Key, you must make sure that the key alias is valid.
    Assign SLRIf you set the Encryption Type parameter to KMS-managed Key, you must assign the AliyunServiceRoleForNasEncryption service-linked role to NAS. For more information, see Service-linked roles of NAS.
    Data BackupSpecify whether to enable the data backup feature. Valid values:
    • Disable: disables the data backup feature.
    • Enable: enables the data backup feature. If you enable the data backup feature, you can restore data to any backup point.
    For more information, see Back up an Apsara File Storage NAS file system.
    Service-linked RoleIf you enable the data backup feature, you must assign the AliyunServiceRoleForNasBackup service-linked role to NAS. NAS can assume the service-linked role to access the resources of Hybrid Backup Recovery (HBR). For more information, see Service-linked roles of NAS.
    Network TypeSelect the network type of the mount target. In this example, select VPC.
    VPCSelect the VPC where the ECS instance to which you want to mount the file system resides. If no VPC is available, create a VPC in the VPC console.
    Note You must select the VPC where the ECS instance to which you want to mount the file system resides. If you select a VPC that is different from the VPC where the ECS instance resides, you must use CEN to establish a connection between the VPCs. Then, you can mount the file system across the VPCs. For more information, see Mount a file system across VPCs in the same region.
    vSwitchSelect a vSwitch that resides in the VPC.
  4. Click Buy Now to create a file system.

    After a General-purpose NAS file system is created, you are charged for the file system based on the maximum storage usage on an hourly basis. For more information about the pricing of General-purpose NAS file systems, see Apsara File Storage NAS Pricing. You can purchase General-purpose NAS resource plans to offset the storage usage fees. For more information, see Purchase resource plans.

    Note After a file system is created, the default permission group is attached to the file system. For information about how to modify a permission group, see Manage a permission group.

Create an Extreme NAS file system in the NAS console

  1. Log on to the NAS console.
  2. In the File System Selection Guide section of the Overview page, click Create Extreme NAS File System.
  3. On the Extreme NAS on International Site (Pay-as-you-go) page, configure the parameters. The following table describes the parameters.
    ParameterDescription
    RegionSelect the region where you want to create the file system.
    Note
    • We recommend that you select the region where the Elastic Compute Service (ECS) instance on which you want to mount the file system resides. Otherwise, the ECS instance cannot access the NAS file system. You can use Cloud Enterprise Network (CEN) to mount a file system across regions. However, a cross-region mount degrades the data transfer performance of the file system. For more information, see Mount a file system across VPCs in the same region.
    • You can use an Alibaba Cloud account to create up to 20 file systems in a region.
    • Only Extreme NAS file systems that reside in the Chinese mainland support IPv6. To enable IPv6 in other regions, contact NAS technical support.
    ZoneSelect the zone in which you want to create the file system. Each region has multiple isolated locations known as zones. Each zone has its own independent power supply and networks. If the ECS instance and the file system reside in different zones of the same region, the ECS instance can access the file system.

    We recommend that you select the zone where the ECS instance resides. This reduces the latency that is caused by cross-zone communication between the file system and the ECS instance.

    Storage TypeSelect the type of the Extreme NAS file system. Valid values:
    • Standard: suitable for scenarios that require high IOPS, intensive metadata operations, low latency, and moderate throughput to process a large number of small files.
    • Advanced: suitable for scenarios that require high IOPS, low latency, and moderate throughput to process a large number of small files. Advanced Extreme NAS file systems implement remote direct memory access (RDMA) networks. Compared with standard Extreme file systems, advanced Extreme NAS file systems provide lower I/O latency and higher write performance.
    Note Each zone supports only one type of Extreme NAS file systems. We recommend that you deploy your business in a zone that supports advanced Extreme NAS file systems.
    Protocol TypeSelect the protocol type of the file system. Extreme NAS file systems support only NFS.
    CapacityAdjust the slider to specify a capacity for the file system. Valid values: 100 GiB to 256 TiB.
    Encryption TypeSelect the type of server-side encryption. Valid values:
    • Not Encrypted: disables server-side encryption.
    • NAS-managed Key: encrypts the data in the file system by using a NAS-managed key.
    • KMS-managed Key: encrypts and decrypts the data in the file system by using a custom key that is managed by KMS.

    If you select NAS-managed Key or KMS-managed Key, the key that is used to encrypt the data in the file system is managed by KMS. When you access the encrypted data, the data is automatically decrypted. For more information, see Server-side encryption.

    Key IDIf you set the Encryption Type parameter to KMS-managed Key, you must select a customer master key (CMK) ID from the drop-down list.
  4. Click Buy Now to create a file system.

    After an Extreme NAS file system is created, you are charged based on the maximum capacity purchased for the file system on an hourly basis. For more information about the pricing of Extreme NAS file systems, see Apsara File Storage NAS Pricing. You can purchase Extreme NAS resource plans to offset the capacity fees. For more information, see Purchase resource plans.

    Note The unit price displayed on the buy page of an Extreme NAS file system is the hourly fee of the file system. If you have purchased an Extreme NAS resource plan, the fee of the file system is automatically offset by using the resource plan.

Create an Extreme NAS file system based on a snapshot

You can call a NAS API operation to create an Extreme NAS file system based on a snapshot.

  1. Install NAS SDK for Python.
    pip install aliyun-python-sdk-core
    pip install aliyun-python-sdk-nas
  2. Create a file system.
    #!/usr/bin/env python3
    import json
    
    from aliyunsdkcore.client import AcsClient
    from aliyunsdknas.request.v20170626.CreateFileSystemRequest import CreateFileSystemRequest
    
    def create_file_system():
        client = AcsClient('<accessKeyId>', '<accessSecret>', '<Region>')
        request = CreateFileSystemRequest()
        request.set_accept_format('json')
        # Pay-as-you-go
        request.set_ChargeType("PayAsYouGo")
        request.set_StorageType("standard")
        request.set_ProtocolType("NFS")
        request.set_FileSystemType("extreme")
        request.set_Capacity("100")
        request.set_ZoneId("cn-hangzhou-h")
        request.set_SnapshotId("s-extreme-xxxxxxxxxx")
    
        response = client.do_action_with_exception(request)
        res = json.loads(response)
        print(res)
    The following table describes the parameters. For more information, see CreateFileSystem.
    ParameterDescription
    accessKeyIdThe AccessKey ID and AccessKey secret of your Alibaba Cloud account. For more information, see How do I obtain an AccessKey pair?
    accessSecret
    RegionThe region to which the snapshot belongs. For example, you can specify cn-hangzhou. You can call the DescribeRegions operation to query the information about all supported regions.
    ZoneThe zone in the region to which the snapshot belongs. For example, you can specify cn-hangzhou-h. You can call the DescribeZones operation to query the information about all supported zones.
    ProtocolTypeThe protocol type of the file system. Extreme NAS file systems support only NFSv3.
    StorageTypeThe storage type of the file system. Valid values:
    • standard: standard
    • advance: advanced

    For example, you have created a snapshot named B_Snapshot for a standard Extreme NAS file system. When you create another file system based on B_Snapshot, you must set the StorageType parameter to standard.

    CapacityThe storage capacity of the Extreme NAS file system that you want to create. The value of this parameter must be the same as the storage capacity of the file system for which the snapshot is created.

    For example, you have created a snapshot named A_Snapshot for an Extreme NAS file system whose storage capacity is 100 GiB. When you create another file system based on A_Snapshot, you must set the Capacity parameter to 100.

    SnapshotIdThe ID of the snapshot.