To enable file sharing, create a General-purpose NAS or an Extreme NAS file system and then mount it on multiple compute nodes. You can mount NAS file systems on cloud compute nodes such as ECS instances, containers, Function Compute (FC), and Platform for AI (PAI). You can also mount and access NAS file systems from on-premises data centers.
Background information
General-purpose NAS file systems and Extreme NAS file systems offer different features and are suitable for different business scenarios. For more information, see General-purpose NAS file systems and Extreme NAS file systems.
Prerequisites
Ensure that File Storage NAS is activated. When you log on to the product page of File Storage NAS for the first time, follow the on-screen instructions to activate the service.
The product that you purchase on the activation page is a NAS resource plan, not a NAS file system. NAS resource plans are used to offset the storage capacity fees for NAS file systems. For more information, see Resource plans.
Create a General-purpose NAS file system in the console
Log on to the NAS console.
In the lower section of the Overview page, click Create General-purpose NAS File System.
On the General-purpose NAS (Pay-as-you-go) page, configure the parameters for the file system.
Parameter
Description
Region
Select the region where you want to create the file system.
NoteFile systems and ECS instances in different regions cannot communicate with each other directly. We recommend that you create the file system in the same region as the ECS instance on which you want to mount the file system. You can also use Cloud Enterprise Network (CEN) to mount a file system across regions. However, cross-region mounting results in poor data transfer performance. For more information, see Mount a NAS file system across VPCs in the same region using CEN.
Each Alibaba Cloud account can create a maximum of 20 General-purpose NAS file systems in a single region.
Zone
A zone is a physical area that has independent power supplies and networks within the same region. File systems and ECS instances in different zones of the same region can communicate with each other.
When you select a zone, we recommend that you select the same zone as the ECS instance to prevent latency caused by cross-zone access.
Storage Class
The storage class of the file system. Valid values:
Performance: suitable for latency-sensitive file sharing workloads that require low latency responses, such as Linux/Windows enterprise applications, container PersistentVolumes (PVs), web content management, and genetic computing.
Capacity: suitable for cost-sensitive file sharing workloads that do not require low latency responses, such as database backups, log storage, Windows user directories, and Linux home directories.
Premium: suitable for latency-sensitive file sharing workloads that require low latency responses, such as container data persistence, AI training data storage, industrial simulation, and genetic computing.
For a performance comparison of the Capacity, Performance, and Advanced storage classes, see General-purpose NAS file systems.
Protocol Type
The protocol of the file system. Valid values: NFS and SMB.
The NFS protocol is suitable for file sharing on Linux ECS instances. The SMB protocol is suitable for file sharing on Windows ECS instances.
Recycle Bin
Specifies whether to enable the recycle bin feature.
Enable: This is the default configuration. The recycle bin feature is enabled after the file system is created.
After the recycle bin feature is enabled, deleted files or directories are temporarily stored in the recycle bin. If you accidentally delete a file from a General-purpose NAS file system, restore the file and its metadata, such as the UID, GID, and access control list (ACL), from the recycle bin. For more information, see Recycle bin.
Disable: The recycle bin feature is not enabled.
Retention Period
If you enable the recycle bin feature, select a retention period for files or directories from the drop-down list.
Encryption Type
The type of server-side encryption. Valid values:
ImportantServer-side encryption and lifecycle management cannot be used at the same time.
Not Encrypted: Server-side encryption is not enabled.
NAS-managed Key: A key that is fully managed by NAS is used to encrypt each file system.
KMS-managed Key: A custom key that you manage in Key Management Service (KMS) is used to encrypt and decrypt the file system.
If you select NAS-managed Key or KMS-managed Key, the data in the file system is encrypted using a key that is managed by Key Management Service (KMS). When you access the data, the data is automatically decrypted. For more information, see Server-side encryption.
Service-linked Role
If you set Encryption Type to KMS-managed Key, you must grant the service-linked role for the encryption service. For more information, see Service-linked role for File Storage NAS.
Key ID
If you set Encryption Type to KMS-managed Key, select a key ID from the drop-down list.
Key Alias
If you set Encryption Type to KMS-managed Key, verify the key alias.
Data Backup
Specifies whether to enable data backup. Valid values:
Disable: The backup service is not enabled.
Enable: A fully managed backup service is used. You can restore data from any historical backup point.
For more information, see Back up a General-purpose NAS file system.
Service-linked Role
If you enable data backup, you must grant the service-linked role that has the permissions to access backup service resources to NAS. For more information, see Service-linked role for File Storage NAS.
Resource Group
Select the resource group to which the file system belongs. Use resource groups to manage NAS resources within your Alibaba Cloud account by category. This lets you manage permissions, deploy resources, and monitor resources based on groups without the need to process each resource separately. For more information, see Best practices for designing resource groups.
If you do not select a resource group, the file system is automatically added to the default resource group after it is created.
To create a resource group, click Create Resource Group. In the Create Resource Group dialog box, configure Resource Group Identifier and Resource Group Name, and then click OK.
Tag
Add tags to the file system. You can add a maximum of 20 tag pairs to a single file system.
To add a tag, click Add Tag, select an existing tag key, and then select or enter a tag value.
Network Type
Set Network Type for the mount target to VPC.
VPC
Select the same VPC as the ECS instance. If you have not created a VPC, go to the VPC console to create one.
NoteYou must select the same VPC as the ECS instance. If you select a different VPC, you must first use Cloud Enterprise Network to connect the networks before mounting the file system. For more information, see Mount a NAS file system across VPCs in the same region using CEN.
vSwitch
Select a vSwitch that is created in the VPC.
Click Buy Now to create the file system.
After the file system is created, you are charged hourly based on the maximum storage usage of the General-purpose NAS file system. For more information about pricing, see Pricing of File Storage NAS. To offset storage capacity fees, purchase General-purpose NAS resource plans, which are more cost-effective than the pay-as-you-go billing method. Resource plans are not attached to specific file systems and can be used to offset storage fees for multiple file systems. For more information, see Purchase a resource plan.
NoteAfter a file system is created, the default permission group is attached to it. To modify the permission group, see Manage permission groups.
Create an Extreme NAS file system in the console
Log on to the NAS console.
In the lower section of the Overview page, click Create Extreme NAS File System.
On the Extreme NAS (Pay-as-you-go) page, configure the parameters for the file system.
Parameter
Description
Region
Select the region where you want to create the file system.
NoteFile systems and ECS instances in different regions cannot communicate with each other directly. We recommend that you create the file system in the same region as the ECS instance on which you want to mount the file system. You can also use Cloud Enterprise Network (CEN) to mount a file system across regions. However, cross-region mounting results in poor data transfer performance. For more information, see Mount a NAS file system across VPCs in the same region using CEN.
Each Alibaba Cloud account can create a maximum of 200 Extreme NAS file systems in a single region.
Currently, only Extreme NAS file systems in regions in the Chinese mainland support IPv6. To enable IPv6 in other regions, submit a ticket.
Zone
A zone is a physical area that has independent power supplies and networks within the same region. File systems and ECS instances in different zones of the same region can communicate with each other.
We recommend that you select the same zone as the ECS instance to prevent latency caused by cross-zone access.
Storage Class
The storage class of the Extreme NAS file system. Valid values:
Standard: suitable for shared file storage that requires high-speed read/write operations on many small files, intensive metadata operations, low latency, and moderate overall throughput.
Advanced: suitable for shared file storage that requires high-speed read/write operations on many small files, low latency, and moderate overall throughput. The backend uses a Remote Direct Memory Access (RDMA) network. Compared with the Standard storage class, the Advanced storage class provides lower read/write latency and better write performance.
NoteEach zone supports only one of the Standard and Advanced storage classes. We recommend that you deploy your services in a zone that supports the Advanced storage class.
Protocol Type
Extreme NAS file systems support only the NFS protocol.
Provisioned Capacity of Extreme NAS File System
Move the slider to select a storage capacity for the file system. The value ranges from 100 GiB to 262,143 GiB.
Encryption Type
The type of server-side encryption. Valid values:
Not Encrypted: Server-side encryption is not enabled.
NAS-managed Key: A key that is fully managed by NAS is used to encrypt each file system.
Custom Key (KMS): A custom key that you manage in Key Management Service (KMS) is used to encrypt and decrypt the file system.
If you select NAS-managed Key or Custom Key (KMS), the data in the file system is encrypted using a key that is managed by KMS. When you access the data, the data is automatically decrypted. For more information, see Server-side encryption.
Key ID
If you set Encryption Type to Custom Key (KMS), select a key ID from the drop-down list.
Resource Group
Select the resource group to which the file system belongs. You can use resource groups to manage NAS resources within your Alibaba Cloud account by category. This lets you manage permissions, deploy resources, and monitor resources based on groups without the need to process each resource separately. For more information, see Best practices for designing resource groups.
If you do not select a resource group, the file system is automatically added to the default resource group after it is created.
To create a resource group, click Create Resource Group. In the Create Resource Group dialog box, configure Resource Group Identifier and Resource Group Name, and then click OK.
Tag
Add tags to the file system. You can add a maximum of 20 tag pairs to a single file system.
To add a tag, click Add Tag, select an existing tag key, and then select or enter a tag value.
Click Buy Now to create the file system.
After the file system is created, you are charged hourly based on the maximum provisioned capacity of the Extreme NAS file system. For more information about pricing, see Pricing of File Storage NAS. To offset provisioned capacity fees, purchase Extreme NAS resource plans, which are more cost-effective than the pay-as-you-go billing method. Resource plans are not attached to specific file systems and can be used to offset storage fees for multiple file systems. For more information, see Purchase a resource plan.
NoteThe unit price displayed on the page for creating an Extreme NAS file system is the hourly fee. If you have purchased an Extreme NAS resource plan, the fee is offset based on deduction rules and you are not charged.
Create an advanced Extreme NAS file system from a snapshot
Only advanced Extreme NAS file systems support the snapshot feature.
Call an API operation to create an advanced Extreme NAS file system from a file system snapshot.
Install the Python SDK.
pip install alibabacloud_nas20170626==3.1.3 pip install alibabacloud_tea_openapi pip install alibabacloud_tea_utilRun the code to create a file system.
NoteBefore you call the API operation, you must configure environment variables for your access credentials. For more information, see Configure environment variables on Linux, macOS, and Windows.
# -*- coding: utf-8 -*- import os import sys from typing import List from alibabacloud_nas20170626.client import Client as NAS20170626Client from alibabacloud_credentials.client import Client as CredentialClient from alibabacloud_tea_openapi import models as open_api_models from alibabacloud_nas20170626 import models as nas20170626_models from alibabacloud_tea_util import models as util_models from alibabacloud_tea_util.client import Client as UtilClient class Sample: def __init__(self): pass @staticmethod def create_client() -> NAS20170626Client: """ Use credentials to initialize the client. @return: Client @throws Exception """ # We recommend that you use the default credential. For information about other credential types, see https://www.alibabacloud.com/help/en/alibaba-cloud-sdk-262060/latest/configure-credentials-378659. credential = CredentialClient() config = open_api_models.Config( credential=credential ) # For more information, see https://api.alibabacloud.com/product/NAS. config.endpoint = f'nas.cn-hangzhou.aliyuncs.com' return NAS20170626Client(config) @staticmethod def main( args: List[str], ) -> None: client = Sample.create_client() create_file_system_request = nas20170626_models.CreateFileSystemRequest( file_system_type='extreme', charge_type='PayAsYouGo', capacity=100, storage_type='advance', zone_id='cn-hangzhou-k', protocol_type='NFS', snapshot_id='s-extreme-00******m' ) runtime = util_models.RuntimeOptions() try: # To run the code, copy it and print the return value of the API operation. client.create_file_system_with_options(create_file_system_request, runtime) except Exception as error: # This is only an example of how to print the error. Handle exceptions with care. Do not ignore exceptions in your projects. # Error message print(error.message) # For troubleshooting, visit the following URL: print(error.data.get("Recommend")) UtilClient.assert_as_string(error.message) @staticmethod async def main_async( args: List[str], ) -> None: client = Sample.create_client() create_file_system_request = nas20170626_models.CreateFileSystemRequest( file_system_type='extreme', charge_type='PayAsYouGo', capacity=100, storage_type='advance', zone_id='cn-hangzhou-k', protocol_type='NFS', snapshot_id='s-extreme-00******m' ) runtime = util_models.RuntimeOptions() try: # To run the code, copy it and print the return value of the API operation. await client.create_file_system_with_options_async(create_file_system_request, runtime) except Exception as error: # This is only an example of how to print the error. Handle exceptions with care. Do not ignore exceptions in your projects. # Error message print(error.message) # For troubleshooting, visit the following URL: print(error.data.get("Recommend")) UtilClient.assert_as_string(error.message) if __name__ == '__main__': Sample.main(sys.argv[1:])The following table describes the key parameters. For more information, see CreateFileSystem.
Parameter
Description
StorageType
The storage type of the file system. Set the value to `advance`, which indicates the Advanced edition.
For example, if you create a snapshot named B_Snapshot for an advanced file system and then use B_Snapshot to create a new file system, you must set
StorageTypetoadvance.ProtocolType
The protocol supported by the file system. Extreme NAS file systems support only NFSv3.
Capacity
The storage capacity of the Extreme NAS file system. The value must be the same as that of the file system from which the snapshot was created.
For example, if you create a snapshot named A_Snapshot for an advanced Extreme NAS file system with a capacity of 100 GiB and then use A_Snapshot to create a new file system, you must set
Capacityto100.ZoneId
The zone in the region where the snapshot is located. Example:
cn-hangzhou-g. Call the DescribeZones operation to query zone information.SnapshotId
The ID of the snapshot.
What to do next
After a file system is created, you must mount it on compute nodes to access it. Before you mount the file system, see Mount scenarios to select an appropriate mount scenario.