This topic describes how to mount one or more NAS file systems on an Elastic Compute Service (ECS) instance when you purchase the ECS instance.
Prerequisites
One or more NAS file systems are created. For more information, see Create a General-purpose NAS file system in the NAS console.
One or more mount targets are created. For more information, see Create a mount target.
Background information
After you create NAS file systems, you can purchase an ECS instance and mount the NAS file systems on the ECS instance on the buy page. This is the easiest way to mount NAS file systems. The following steps show you how to mount NAS file systems when you purchase an ECS instance. You can mount one or more NAS file systems on an ECS instance when you create the ECS instance. You can mount up to five NAS file systems on an ECS instance.
Limits
When you mount NAS file systems on an ECS instance, take note of the following limits:
Image: You can mount NAS file systems only on official images. You cannot mount NAS file systems on a custom image that is created by using an ECS snapshot.
Mount directory: You can specify only the root directory of NAS file systems. You cannot specify the subdirectories of NAS file systems.
If the feature cannot meet your business requirements, mount NAS file systems after the ECS instance is created. For more information, see Usage notes.
Mount a NAS file system
Log on to the ECS console.
Create an ECS instance. For more information, see Create an instance on the Custom Launch tab.
On the Custom Launch tab, configure the following parameters:
Region: Select a region where the NAS file system resides.
Network and Zone: Select the same virtual private cloud (VPC) as the NAS file system and the vSwitch and zone that are created in the VPC. To achieve optimal performance, select a zone where the NAS file system resides.
Instance: Select an instance type based on your business requirements.
Image: Select an image based on your business requirements. We recommend that you specify a Linux image of CentOS 7.6 or a Windows image of Windows Server 2019 Datacenter.
Storage: Click NAS File System(Optional), click Add File System, and then configure the parameters. The following table describes the parameters.
Legend
Parameter
Description
1
File System
Linux images support only Network File System (NFS) file systems.
Windows images support only Server Message Block (SMB) file systems.
2
Mount Target
You can use the mount target to establish a connection between the NAS file system and the ECS instance. The mount target and the ECS instance must reside in the VPC.
If no mount target is available, create a mount target for the file system. For more information, see Create a mount target.
3
Mount Path
A local directory of the ECS instance on which you can mount the NAS file system. For example, you can enter /mnt for a Linux image or Z for a Windows image.
4
Protocol Type
You can specify NFSv3 or NFSv4.0 for an NFS file system. If you do not use file locks, we recommend that you specify NFSv3.
For an SMB file system, select SMB.
Mount multiple NAS file systems
If you want to mount multiple NAS file systems on the ECS instance, click Add File System. Before you proceed, take note of the following parameters:
Mount Target:
All mount targets must reside in the same VPC.
If no mount target is available in the VPC where the ECS instance resides, add a mount target that matches the VPC. For more information, see Create a mount target.
Mount Path:
Each local directory must be unique.
You can specify nested directories for Linux images. For example, you can specify /mnt and /mnt/sub.
If you want to mount more than five NAS file systems, submit a ticket.
Check the mount result
After you purchase the ECS instance, the NAS file system that you specify is automatically mounted on the ECS instance. If you restart the ECS instance, the NAS file system is also automatically mounted on the ECS instance. You can use the following methods to check the mount result:
Linux ECS instance
Run the
df -h
command to view the details of the mounted NAS file system. In the command output, Used indicates the used space. Size indicates the maximum size of the file system. The billing of the file system is not related to the maximum size.
The settings for an automatic mount are stored in the /etc/fstab file. You can change a local directory based on your business requirements. For more information, see Mount an NFS file system.
Windows ECS instance
Start File Explorer. The SMB file that you specify is mounted as a network drive.
If no drive letter is found, you can enter
\\192.168.xx.xx\myshare
in the File Explorer to access the drive.192.168.xx.xx
is the IP address of the server. Replace it with the actual IP address.
The settings for an automatic mount are stored in the c:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\my_mount.bat file. You can change these settings based on your business requirements.