EAS supports multiple storage mounting methods to attach model files, code files, or other configuration files to service instances. This feature enables data sharing among multiple instances. You can modify mounted files directly during model iteration or code updates without rebuilding the image, which reduces development and Operations and Maintenance (O&M) costs. This topic describes the mount types that EAS supports and how to configure them.
Mount different types of storage
For unstructured data that is primarily read, such as models, images, and videos, use OSS.
If you frequently read and write small files, or if multiple service instances need to share a read/write directory, use a General-purpose NAS file system.
For high-performance computing (HPC) or AI training that requires extremely low latency and high throughput, use an Extreme NAS file system or CPFS.
For large-scale parallel computing or AI training frameworks, use CPFS.
You can mount CPFS file systems only when you deploy EAS services using Lingjun resource quotas.
NAS supports mounting only from internal network addresses in the same region. You must establish a direct network connection to the vSwitch where the NAS file system is located. For more information, see Configure network connectivity.
OSS mount
This is the most common storage mount method. The following figure shows the configuration interface in the console.

The following code provides a JSON configuration example:
{
"storage": [
{
"oss": {
"path": "oss://bucket/path/",
"readOnly": false
},
"mount_path": "/mnt/data/"
}
]
}Parameters:
Parameter (Console) | Parameter (JSON) | Description |
Uri | oss.path | The path of the source OSS bucket. For more information about how to create a bucket, see Getting Started. |
Mount Path | mount_path | The destination path in the service instance to which the storage is mounted. You can use this path to read source files or data. Example: |
Read-only | oss.readOnly | Specifies whether to mount the storage in read-only mode. |
NAS mount
You can mount a NAS file system, including a General-purpose NAS file system, an Extreme NAS file system, or CPFS, using an internal network address within the same region. You must also establish a direct network connection to the vSwitch where the NAS file system is located. For more information, see Configure network connectivity.
The following figure shows the configuration interface in the console.
The following code provides a JSON configuration example:
{
"storage": [
{
"nfs": {
"path": "/",
"server": "06ba74****-a****.cn-hangzhou.nas.aliyuncs.com",
"readOnly": false
},
"mount_path": "/mnt/data/"
}
]
}Parameters:
Parameter (Console) | Parameter (JSON) | Description |
Storage Permission Resource Group | nfs.resourceGroup | The resource group to which the file system belongs. This parameter filters file systems by resource group. For more information about resource groups, see Best practices for resource group design. If you select All Storage Permission Resource Groups, you do not need to configure this parameter in the JSON file. |
Select File System | None | The ID of the created NAS file system. You can log on to the NAS console to view the NAS file system ID in the corresponding region. |
File System Mount Target | nfs.server | The address of the NAS mount target. EAS accesses the NAS file system through the mount target. For more information about how to view the address, see View mount target addresses. Note After you select a mount target in the console, the system automatically selects the virtual private cloud (VPC) that is associated with the mount target. |
File System Path | nfs.path | The source path in the NAS file system to mount. This is the path within the NAS instance. Example: |
Mount Path | mount_path | The destination path in the service instance to which the storage is mounted. You can use this path to read source files or data. Example: |
Read-only | nfs.readOnly | Specifies whether to mount the storage in read-only mode. |
Mount a custom dataset
You can create a PAI dataset from your data or configuration files and register it as a public AI Asset. This lets you easily mount and reference the dataset when you deploy services.
Only custom datasets that use Object Storage Service (OSS) can be mounted.
The following figure shows the configuration interface in the console.
The following code provides a JSON configuration example:
"storage": [
{
"dataset": {
"id": "d-pcsah1t86bm8******",
"version": "v1",
"read_only": false
},
"mount_path": "/mnt/data/"
}
]Parameters:
Parameter (Console) | Parameter (JSON) | Description |
Custom Dataset | dataset.id | The registered custom dataset of the Object Storage Service (OSS) type. For more information about how to create a custom dataset and obtain its ID, see Create and manage datasets. |
Version | version | The version of the dataset. Example: v1. |
Read-only | dataset.read_only | Specifies whether to mount the dataset in read-only mode. |
Mount Path | mount_path | The destination path in the service instance to which the dataset is mounted. Example: |
Mount code
Git mount: Mounts code from a Git repository to a service instance in read-only mode. The code is pulled when the instance starts. If you change the code, you must restart the service instance for the changes to take effect.
Code configuration: You can create a PAI code set from a Git repository and register it as a public AI Asset. This lets you easily mount and reference the code set when you deploy a service.
Git mount
The following figure shows the configuration interface in the console.
The following code provides a JSON configuration example:
{
"storage": [
{
"git": {
"repo": "https://codeup.aliyun.com/xxx/eas/aitest.git",
"branch": "master",
"commit": "xxx",
"username": "username",
"password": "password or access token"
},
"mount_path": "/mnt/data/"
}
]
}Parameters:
Parameter (Console) | Parameter (JSON) | Description |
Git URL | git.repo | The HTTPS address of the Git repository to mount. The Git protocol is not supported. |
Branch | git.branch | The branch of the Git repository to pull. The default value is master. |
Commit | git.commit | The commit ID of the Git repository to pull. |
Username | git.username | The username that is used to log on to the private Git repository. |
Access Token | git.password | The password or access token that is used to log on to the private Git repository. For more information about how to obtain a token, see Appendix: Obtain a token for your GitHub account. |
Mount Path | mount_path | The destination path in the service instance to which the repository is mounted. Example: |
Code configuration
This method mounts the code set to a service instance in read-only mode.
The following figure shows the configuration interface in the console.
The following code provides a JSON configuration example:
"storage": [
{
"code": {
"id": "code-4d3b42a1152****"
},
"mount_path": "/mnt/data/"
}
]Parameters:
Parameter (Console) | Parameter (JSON) | Description |
Code Configuration | code.id | The registered code set. For more information about how to create a code set and obtain its ID, see Code configuration. |
Mount Path | mount_path | The destination path in the service instance to which the code set is mounted. Example: |
Mount a PAI model
You can register the models that a service requires as public PAI AI Assets to centrally manage them in PAI. For more information, see Register and manage models. You can then mount the models to service instances in read-only mode during service deployment.
The following figure shows the configuration interface in the console.

Parameters:
Parameter (Console) | Description |
PAI Model | The registered PAI model. For more information about how to create a model, see Register and manage models. |
Mount Path | The destination path in the service instance to which the model is mounted. Example: |
Other mounts
Image mount: This method does not mount a directory from a Docker image directly to a service instance. Instead, it first copies files from a specified directory in the source image to a local shared volume and then mounts the local shared volume at runtime. If the directory to be mounted contains a large amount of data, this process can consume significant local storage and increase the instance startup time. Use this feature only when necessary.
EmptyDir mount: Use this method to allow an instance to read from and write to a local disk directory at runtime. This ensures that the written content is not lost if the instance unexpectedly restarts.
Image mount
Configuration method
{ "storage": [ { "image": { "image": "registry-vpc.cn-xxxx.aliyuncs.com/eas/image_name:v1", "path": "/path/to/mount/" }, "mount_path": "/data_image" } ] }NoteYou can mount an image from an internal network address in the same region. If the image is private, you must use the dockerAuth parameter to specify the authentication information for the image repository. For more information about using the dockerAuth parameter, see Use a custom image.
Parameters
Parameter (JSON)
Description
image.image
The internal network address of the image repository to mount.
image.path
The path in the image to mount to the service instance.
mount_path
The destination path in the service instance to which the image is mounted. Example:
/data_image.
EmptyDir mount
Configuration method
{ "name": "service_name", "storage": [ { "empty_dir": {}, "mount_path": "/data_image" } ] }Parameters
Parameter (JSON)
Description
mount_path
The destination path in the service instance.
empty_dir
Indicates an EmptyDir type with an empty map value. This stores data on the local disk. Other properties cannot be configured.
Configure shared memory
If high storage performance is required, use the following configuration to enable shared memory.
{
"storage": [
{
"empty_dir": {
"medium": "memory",
"size_limit": 20
},
"mount_path": "/dev/shm"
}
]
}Where:
Parameter (JSON) | Description |
medium | Set this parameter to memory. |
mount_path | Set this parameter to |
size_limit | The upper limit of the memory. Unit: GB. |
Complete JSON configuration example
The following code provides a complete configuration example. For more information, see Deploy services using JSON.
{
"name": "service_name",
"model_path": "http://path/to/model",
"processor": "pmml",
"storage": [
{
"oss": {
"path": "oss://bucket/path/",
"readOnly": false
},
"mount_path": "/mnt/data/"
},
{
"nfs": {
"path": "/",
"server": "06ba74****-a****.cn-hangzhou.nas.aliyuncs.com",
"readOnly": false
},
"mount_path": "/mnt/data/"
},
{
"image": {
"image": "registry-vpc.cn-shanghai.aliyuncs.com/eas/test_image:v1",
"path": "/path/to/mount/"
},
"mount_path": "/data_image"
},
{
"empty_dir": {
"medium": "memory",
"size_limit": 20
},
"mount_path": "/dev/shm"
},
{
"git": {
"repo": "https://codeup.aliyun.com/xxx/eas/aitest.git",
"branch": "master",
"commit": "xxx",
"username": "username",
"password": "password or access token"
},
"mount_path": "/mnt/data/"
}
],
"metadata": {
"cpu": 1,
"instance": 1,
"resource": "eas-r-xxx"
}
}FAQ
Why am I getting a "file not found" error after mounting an OSS bucket?
This error is usually caused by an incorrect path. Check your mount configuration and the access path.
For example, if you mount
oss://my-bucket/to/mnt/data, the fileoss://my-bucket/subfolder/myfile.txtin OSS must be accessed using the path/mnt/data/subfolder/myfile.txtin the container, not/mnt/data/myfile.txt.Can I use an FTP or SSH tool to connect to an instance to upload or download files?
No. EAS instances do not provide FTP or SSH access.
Can I mount an OSS bucket that is in a different region from my EAS service?
No. EAS cannot mount OSS buckets across regions. Use the cross-region replication feature of OSS to synchronize data to an OSS bucket in the same region as the EAS service.
If no storage is mounted, where are the files that I download to the instance stored? The files are saved to the system disk of the instance. The system disk is cleared when the instance is restarted or updated, resulting in data loss. To make your data persistent, you must mount storage.