To share files across multiple compute nodes, you can create a General-purpose NAS, Extreme NAS, or AgenticFS file system and then mount it on your compute nodes. You can mount a File Storage NAS file system on various cloud compute resources, such as ECS, containers, Function Compute (FC), and Platform for AI (PAI), or on-premises clients.
Background
General-purpose NAS and Extreme NAS file systems have different features and suit different use cases. For more information, see General-purpose NAS and Extreme NAS. To manage large-scale workspaces for AI Agent scenarios, see AgenticFS.
Prerequisites
File Storage NAS must be activated. When you log on to the File Storage NAS product details page 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 only offset the storage capacity fees of 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.
On the Overview page, in the File System Selection Guide table, click Create under General-purpose NAS.
On the Create panel, configure the following parameters.
Parameter
Description
Region
Select the region for the file system.
NoteFile systems and ECS instances in different regions cannot communicate directly. For optimal performance, create your file system in the same region as the ECS instances that will mount it. Although you can use Cloud Enterprise Network (CEN) to mount file systems across regions, this reduces data transfer performance. For more information, see Mount a NAS file system across VPCs in the same region by 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 with independent power supplies and networks within a region. File systems and ECS instances in different zones of the same region can communicate with each other.
To minimize latency, select the same zone for the file system and the ECS instances.
Storage Class
The storage class for the file system. Options include:
Performance: Suitable for latency-sensitive file sharing workloads that require low-latency responses, such as Linux or 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 Premium storage classes, see General-purpose NAS.
Protocol Type
The protocol type for the file system. Options include NFS and Organization.
Use NFS for file sharing with Linux-based ECS instances and SMB for Windows-based ECS instances.
Recycle Bin
Specifies whether to enable the recycle bin feature.
Enable: This is the default setting. The recycle bin is enabled after the file system is created.
When the recycle bin is enabled, deleted files or directories are temporarily moved to the recycle bin. This allows you to recover accidentally deleted files and their metadata, such as UIDs, GIDs, and ACLs. For more information, see Recycle bin.
Disable: The recycle bin feature is not enabled.
Retention Period
If you enable the recycle bin, select a retention period for deleted files and directories from the drop-down list.
Lifecycle Management
Configures the lifecycle management feature for the file system.
Enable: This is the default setting. The lifecycle management feature is enabled after the file system is created.
After you enable this feature, data that has not been accessed for a specified period is transitioned to the IA storage class to reduce storage costs. For more information, see Lifecycle management.
Disable: The lifecycle management feature is not enabled.
Lifecycle Management Policy
If you enable lifecycle management, configure a lifecycle management policy. For more information, see Set a lifecycle policy.
Encryption Type
The type of server-side encryption. Options include:
ImportantServer-side encryption and lifecycle management cannot be used together.
Not Encrypted: Server-side encryption is not enabled.
NAS-managed Key: A key fully managed by NAS is used to encrypt each file system.
KMS-managed key: A 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, data in the file system is encrypted by using a key managed by Key Management Service (KMS) and is automatically decrypted when you access it. For more information, see Server-side encryption.
Service-linked Role
When the encryption type is set to KMS-managed key, you must authorize the service-linked role for encryption. For more information, see Service-linked roles 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. Options include:
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 authorize the service-linked role, which grants NAS permission to access backup service resources. For more information, see Service-linked roles for File Storage NAS.
Resource Group
Select the resource group to which the file system belongs. Resource groups allow you to manage your Alibaba Cloud resources by category, which simplifies permission management, resource deployment, and monitoring. 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 creation.
To create a resource group, click Create Resource Group. In the Create Resource Group dialog box, configure the Resource Group Identifier and Resource Group Name, and then click OK.
Tag
Assigns tags to the file system. You can assign up to 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.
Mount Target Type
Select VPC as the network type for the mount target.
VPC
Select the same VPC as your ECS instance. If you have not created a VPC, create one in the VPC console.
NoteYou must select the same VPC as the ECS instance. If you select a different VPC, you must first connect the VPCs by using Cloud Enterprise Network (CEN) before you can mount the file system. For more information, see Mount a NAS file system across VPCs in the same region by using CEN.
vSwitch
Select a vSwitch that is created in the VPC.
Terms of Service
By clicking Buy Now, you acknowledge that you have read and agree to the NAS Product Terms of Service, Service Level Agreement, and any product-specific terms you have selected on this page. Please read these terms carefully before you proceed.
Click Buy Now to create the file system.
After the file system is created, you are billed hourly based on its peak storage usage. For pricing information, see Pricing of File Storage NAS. You can also purchase a General-purpose NAS resource plan to offset storage capacity fees. Resource plans offer significant discounts compared to the pay-as-you-go billing method and can cover storage fees for multiple file systems without being bound to a specific one. For more information, see Purchase a resource plan.
NoteA default permission group is automatically bound to the file system upon creation. 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 File System Selection Guide table on the Overview page, click Create under Extreme NAS.
On the Create panel, configure the following parameters.
Parameter
Description
Region
Select the region where you want to create the file system.
NoteFile systems and ECS instances in different regions cannot communicate directly. For optimal performance, create your file system in the same region as the ECS instances that will mount it. Although you can use Cloud Enterprise Network (CEN) to mount file systems across regions, this reduces data transfer performance. For more information, see Mount a NAS file system across VPCs in the same region by 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 with independent power supplies and networks within a region. File systems and ECS instances in different zones of the same region can communicate with each other.
To minimize latency, select the same zone for the file system and the ECS instances.
Storage Class
The storage class of the Extreme NAS file system. Options include:
Standard: Suitable for shared file storage with high-speed read/write operations on many small files, intensive metadata operations, low latency, and moderate overall throughput.
Advanced: Suitable for shared file storage with high-speed read/write operations on many small files, low latency, and moderate overall throughput. It uses a Remote Direct Memory Access (RDMA) network, providing lower read/write latency and superior write performance compared to the Standard storage class.
NoteA zone supports either the Standard or Advanced storage class, but not both. We recommend deploying your services in a zone that supports the Advanced storage class.
Protocol Type
Extreme NAS file systems support only the NFS protocol.
Provisioned Capacity
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. Options include:
Not Encrypted: Server-side encryption is not enabled.
NAS-managed Key: A key fully managed by NAS is used to encrypt each file system.
KMS-managed key: A 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 by using a key managed by KMS. When you access the data, it is automatically decrypted. For more information, see Server-side encryption.
Key ID
If you set Encryption Type to KMS-managed key, select a key ID from the drop-down list.
Resource Group
Select the resource group to which the file system belongs. Resource groups allow you to manage your Alibaba Cloud resources by category, which simplifies permission management, resource deployment, and monitoring. 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 creation.
To create a resource group, click Create Resource Group. In the Create Resource Group dialog box, configure the Resource Group Identifier and Resource Group Name, and then click OK.
Tag
Assigns tags to the file system. You can assign up to 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.
Terms of Service
By clicking Buy Now, you acknowledge that you have read and agree to the NAS Product Terms of Service, Service Level Agreement, and any product-specific terms you have selected on this page. Please read these terms carefully before you proceed.
Click Buy Now to create the file system.
After the file system is created, you are charged hourly based on its provisioned capacity. For pricing information, see Pricing of File Storage NAS. You can also purchase an Extreme NAS resource plan to offset these fees. Resource plans offer significant discounts compared to the pay-as-you-go billing method and can be used to cover storage fees for multiple file systems. For more information, see Purchase a resource plan.
NoteThe unit price displayed on the creation page is the hourly fee. If you have purchased an Extreme NAS resource plan, the resource plan offsets the fee according to deduction rules, and you are not charged for the portion that it covers.
Create an Advanced Extreme NAS file system from a snapshot
Only Advanced Extreme NAS file systems support snapshots.
You can also create an Advanced Extreme NAS file system from a snapshot by calling an API operation.
-
Install the Python SDK.
pip install alibabacloud_nas20170626==3.1.3 pip install alibabacloud_tea_openapi pip install alibabacloud_tea_util -
Run the code to create a file system.
NoteBefore you call the API operation, 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: """ Initializes a client with access credentials. @return: Client @throws Exception """ # For production environments, use a more secure method such as a RAM role to avoid hard-coding the AccessKey pair. # For more information about how to configure credentials, see https://help.aliyun.com/document_detail/378659.html. credential = CredentialClient() config = open_api_models.Config( credential=credential ) # For more information about endpoints, see https://api.aliyun.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( charge_type='PayAsYouGo', file_system_type='extreme', capacity=10, protocol_type='NFS', storage_type='advance', snapshot_id='s-extreme-00******m', zone_id='cn-hangzhou-k' ) runtime = util_models.RuntimeOptions() try: # Print the API response after you run the code. client.create_file_system_with_options(create_file_system_request, runtime) except Exception as error: # This is a sample of error handling. In a production environment, you must handle exceptions with care and not ignore them. # Error message print(error.message) # Troubleshooting 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( charge_type='PayAsYouGo', file_system_type='extreme', capacity=10, protocol_type='NFS', storage_type='advance', snapshot_id='s-extreme-00******m', zone_id='cn-hangzhou-k' ) runtime = util_models.RuntimeOptions() try: # Print the API response after you run the code. await client.create_file_system_with_options_async(create_file_system_request, runtime) except Exception as error: # This is a sample of error handling. In a production environment, you must handle exceptions with care and not ignore them. # Error message print(error.message) # Troubleshooting 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 for 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 file access protocol. Extreme NAS file systems support only NFSv3.
Capacity
The storage capacity of the Extreme NAS file system. This value must be the same as the capacity of the original file system from which the snapshot was created.
For example, if you create a snapshot named A_Snapshot for a 100 GiB advanced Extreme NAS file system and then use A_Snapshot to create a new file system, you must set
Capacityto100.ZoneId
The ID of the zone where the new file system will be created. Example:
cn-hangzhou-g. You can call the DescribeZones operation to query available zones.SnapshotId
The ID of the snapshot.
Create an AgenticFS file system
To create an AgenticFS file system for AI Agent scenarios, see Create an AgenticFS file system.
What to do next
After creating a file system, you must mount it to a compute node to access it. Before mounting, see the Mounting scenarios and decision guide to select a suitable mount scenario for your workload.