This topic describes how to create an Apsara File Storage NAS file system and 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 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 system.

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.
    Parameter Description
    Region Select 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 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 or regions
    • You can use an Alibaba Cloud account to create up to 20 file systems in a region.
    Zone The zone in which you want to create the instance. Each region has multiple isolated locations known as zones. Each zone has its own independent power supply and networks. If an ECS instance and a 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 Specifications The type of the file system. Valid values: NAS Performance and NAS Capacity.

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

    Protocol Type 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.

    Encryption Type The type of server-side encryption. Valid values:
    • Not Encrypted: disables server-side encryption.
    • NAS-managed Key: uses the keys that are managed by NAS to encrypt the file system.
    • User Management Key (KMS): uses the custom keys that are managed by KMS to encrypt and decrypt the data in the file system.

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

    CMK ID If you set the Encryption Type parameter to User Management Key (KMS), you must select a customer master key (CMK) ID from the drop-down list.
    Key Alias If you set the Encryption Type parameter to User Management Key (KMS), make sure that the key alias is valid.
    Assign SLR If you set the Encryption Type parameter to User Management Key (KMS), you must assign the required service-linked role to the encryption service. For more information, see Service-linked roles of NAS.
    Data Backup Specifies whether to enable the data backup service. Valid values:
    • Disable: disables the data backup service.
    • Enable: enables the backup service. You can use the service to restore data to any backup point.
    For more information, see Back up an Apsara File Storage NAS file system
    Service-linked role Before you can use the data backup service, you must assign the required service-linked role to NAS. NAS can assume the service-linked role to access the resources of the data backup service. For more information, see Service-linked roles of NAS
    Network Type Select the network type of the mount target. Valid values: VPC and Classic Network.
    Note
    • You can create a mount target in the classic network only in some regions in the Chinese mainland.
    • If you create a mount target in the classic network for a file system, you can mount the file system only on an ECS instance. The network type of the ECS instance must be the same as the network type of the mount target. If you want to mount a file system on an ECS instance in the classic network, you must create a mount target in the classic network for the file system. If you want to mount a file system on an ECS instance in a virtual private cloud (VPC), you must create a mount target in the VPC for the file system.
    Virtual Private Cloud (VPC) If you set the Network Type parameter to VPC, you must select the VPC where the ECS instance resides. If no VPC is available, create a VPC in the VPC console.
    Note You must select the VPC where the ECS instance resides. If you select a VPC that is different from the VPC where the ECS instance resides, you must use Cloud Enterprise Network 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 or regions
    vSwitch If you set the Network Type parameter to VPC, you must select a vSwitch that resides in the VPC.
  4. Click Buy Now and follow the instructions as prompted to complete the payment.
    Note After the 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.
    Parameter Description
    Billing Method Select a billing method based on your business requirements. Valid values: Subscription and Pay-As-You-Go. For more information, see Billing of Extreme NAS file systems.
    Region Select 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 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 or regions
    • You can use an Alibaba Cloud account to create up to 20 file systems in a region.
    • IPv6 is supported by Extreme NAS file systems only in the Chinese mainland regions.If you want to enable IPv6 for an Extreme NAS file system in a region outside the Chinese mainland, submit a ticket.
    Zone The zone in which you want to create the instance. 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 Specifications Select the type of the Extreme file system. Valid values:
    • Standard Type: suitable for scenarios that require high IOPS, intensive metadata operations, low latency, and moderate throughput to process a large number of small files.
    • Advanced Type: suitable for scenarios that require high IOPS, low latency, and moderate throughput to process a large number of small files. Extreme file systems of the advanced type use remote direct memory access (RDMA) networking. This reduces the latency of read/write operations and improves the write performance compared with Extreme file systems of the standard type.
    Note Each zone supports Extreme file systems of only one of the standard type and the advanced type. We recommend that you deploy your business in a zone that supports the advanced type.
    Protocol Type The protocol type of the file system. Extreme NAS file systems support only NFS.
    Capacity Adjust the slider to change the capacity. Valid values: 100 GiB to 256 TiB.
    Encryption Type The type of server-side encryption. Valid values:
    • Not Encrypted: disables server-side encryption.
    • NAS-managed Key: uses the keys that are managed by NAS to encrypt the file system.
    • User Management Key (KMS): uses the custom keys that are managed by KMS to encrypt and decrypt the data in the file system.

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

    CMK ID If you set the Encryption Type parameter to User Management Key (KMS), select a customer master key (CMK) ID from the drop-down list.
    Subscription Duration If you select subscription as the billing method, you must select a validity period for the file system. After the validity period expires, the file system is automatically disabled. For more information, see Overdue payments

    We recommend that you select Auto-renewal. After you enable the auto-renewal feature, the file system is automatically renewed on a monthly basis.

  4. Click Buy Now and follow the instructions as prompted to complete the payment.

Create an Extreme NAS file system by using a snapshot

You can call a NAS API operation to create an Extreme NAS file system by using a snapshot.

  1. Install NAS SDK for Python.
    pip install aliyun-python-sdk-core
    pip install aliyun-python-sdk-nas
  2. Creates a file system.
    • Run the following code to create a pay-as-you-go Extreme NAS 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)
    • Run the following code to create a subscription Extreme NAS 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')
          # Subscription
          request.set_ChargeType("Subscription")
          request.set_Period(1) # The duration of the subscription. Unit: months.
          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
      Parameter Description
      accessKeyId The AccessKey ID and AccessKey secret of your Alibaba Cloud account. For more information, see How do I obtain an AccessKey pair?
      accessSecret
      Region The 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.
      Zone The 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.
      ProtocolType The protocol of the file system. Extreme NAS file systems support only NFSv3.
      StorageType The 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 file system. Before you can use B_Snapshot to create another file system, you must set the StorageType parameter to standard.

      Capacity The Extreme NAS file system must have the same storage capacity as the file system for which snapshots are created.

      For example, you have created a snapshot named A_Snapshot for a 100 GiB Extreme NAS file system. Before you can use A_Snapshot to create another file system, you must set the Capacity parameter to 100.

      SnapshotId The ID of the snapshot.