File Storage NAS is seamlessly integrated with Alibaba Cloud Platform for AI (PAI). Configure a NAS file system as a dataset to store data persistently for deployment and training. This topic describes how to quickly mount a NAS file system to a Data Science Workshop (DSW) instance in the console.
Prerequisites
You have activated PAI and created a default workspace. For more information, see Activate PAI and create a default workspace.
NAS is activated.
The first time you visit the product page of NAS, follow the instructions to activate the NAS service.
You have created a virtual private cloud (VPC). If you do not have a VPC, go to the VPC console to create one.
Step 1: Create a file system
If you already have a file system, skip this step.
Log on to the NAS console.
At the bottom of the Overview page, click Create General-purpose NAS File System.
On the General-purpose NAS (Pay-as-you-go) page, configure the following parameters.
Parameter
Description
Region
The file system and the service must be in the same region. This tutorial uses the China (Hangzhou) region as an example.
Zone
Select the zone where the vSwitch is located to avoid cross-zone latency. This tutorial uses Hangzhou Zone F as an example.
Storage Class
Premium
Protocol Type
NFS
Recycle Bin
Enable the recycle bin. After this feature is enabled, deleted files or directories are temporarily stored in the recycle bin. This helps prevent accidental deletion.
Encryption Type
Not Encrypted
Data Backup
Disable
Network Type
VPC.
VPC
Select the VPC that you created from the drop-down list.
vSwitch
Select a vSwitch that is in the VPC.
Click Buy Now and follow the on-screen instructions to complete the purchase.
Step 2: Create a DSW instance
This section describes how to create a DSW instance in a public resource group and configure a NAS file system as a dataset.
Log on to the PAI console.
On the Overview page, select the destination region.
In the navigation pane on the left, click Workspaces. On the Workspaces page, click the name of the workspace that you want to manage.
In the navigation pane on the left of the Workspace Details page, navigate to .
On the Instance tab of the Data Science Workshop (DSW) page, click Create Instance.
On the Create Instance page, configure the following key parameters. Leave the other parameters at their default values. For more information, see Create a DSW instance.
Parameter
Description
Instance Name
Customize the instance name. This tutorial uses test_01 as an example.
Resource Type
This tutorial uses Public Resources in pay-as-you-go mode.
Instance Type
Select GPU. The instance type name is ecs.gn7i-c8g1.2xlarge.
Image config
This tutorial uses the following Alibaba Cloud Image:
stable-diffusion-webui-develop:1.0-pytorch2.0-gpu-py310-cu117-ubuntu22.04.Mount storage
Click General-purpose NAS and configure the following key parameters. Keep the default values for other parameters. For more information about datasets, see Create and manage datasets.
File System: Select the NAS file system that you created in the preceding steps from the drop-down list.
Mount Target: Select a mount target for the file system.
File System Path:
/Mount Path: /mnt/data/
Network Information
Security Group: Select your created security group from the drop-down list.
Visibility
Select Visible to the Instance Owner.
Click Yes.
It takes about 10 minutes to create the DSW instance. After the instance is created, its status changes to Running.
Step 3: Verify the mounting
Return to the DSW page. In the Actions column of the instance that you created, click Open.
In the top menu bar of the DSW instance page, click the Terminal tab to open a terminal.
In the Terminal, run the following command to check whether the NAS dataset is mounted.
mount | grep nasIf output similar to the following is returned, the dataset is mounted.

In the output, /mnt/data is the mount path that you specified when you created the DSW instance. Your data and code will be stored persistently as long as the NAS file system and its service are running.
References
For information about the billing of DSW, see Billing of DSW.
When you use NAS for data storage, purchase resource plans to offset storage fees. For more information, see Resource plans.
For information about how to release a NAS file system instance, see Release a file system instance.
NAS also supports data storage for PAI-DLC and PAI-EAS. For more information, see Create and manage datasets (DSW and DLC) or Advanced configurations for EAS: Mount storage.
For more DSW best practices, see Data Science Workshop (DSW).