This topic describes how to mount a NAS file system on an Elastic Compute Service (ECS) instance when you purchase the ECS instance.

Prerequisites

A NAS file system is created. For more information, see Create a file system.

Background information

To mount a NAS file system, we recommend that you purchase an ECS instance after you create the file system. During the purchase process, you can mount the file system on the ECS instance. This topic describes how to mount one or more NAS file systems when you purchase an ECS instance. For more information about how to purchase an ECS instance, see Purchase an ECS instance. You can mount one or more file systems on an ECS instance when you create the ECS instance. You can mount a maximum of five NAS file systems on an ECS instance.

Mount a NAS file system

  1. Log on to the ECS console.
  2. On the Buy page, set the required parameters:
    • Region: Select a region where the NAS file system resides. To achieve optimal performance, select a zone where the NAS file system resides.
    • Instance Type: If you can specify a network type for the ECS instance in some regions, specify VPC. Specify other parameters 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 and a Windows image of Windows Server 2019 Datacenter.
    • Storage: Click Apsara File Storage NAS File System and click Add NAS File System. In the Add NAS File System section, set the required parameters. The following legends show the parameters that you must specify.Mount a NAS file system on an ECS instance
      The following table lists the parameters that are remarked by the legends.
      Legend Parameter Description
      3 File system ID
      • Linux images support file systems only of the NFS type.
      • Windows images support file systems only of the SMB type.
      4 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 same VPC.
      • If no mount target is available, add a mount target to the file system. For more information, see Create a mount target.
      5 Local directory A local directory of the ECS instance on which you can mount the NAS file system.
      • You can specify /mnt for a Linux image.
      • You can specify Z for a Windows image.
      6 Protocol type
      • You can specify NFSv3.0 or NFSv4.0 for an NFS file system. If you do not use file locks, we recommend that you specify NFSv3.0.
      • Only the SMB protocol is available for SMB file systems.

Mount multiple file systems

If you want to mount multiple file systems on the ECS instance, click Add NAS File System. Before you proceed, note 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.
  • Local directory:
    • Each local directory must be unique.
    • You can use multilevel directories for Linux images, for example, /mnt and /mnt/sub.
Note If you want to mount extra file systems, submit a ticket.

Limits

The following limits are set when you mount a NAS file system on an ECS instance:
  • Image: You can mount NAS file systems only on official images. You cannot mount a NAS file system on a custom image that is created by using an ECS snapshot.
  • Local directory: You can mount only the root directory of a NAS file system. You cannot mount the subdirectories of a NAS file system.
Note If the feature cannot meet your requirements, mount a NAS file system after an ECS instance is created. For more information, see Mount a NAS file system.

Verify the mount results

After you complete the payment for an ECS instance, the NAS file system that you specify is mounted on the ECS instance. The NAS file system is also mounted at the first restart of the ECS instance. You can use the following methods to verify the mount results:
  • Linux ECS instances
    After you connect to an ECS instance, run the df -h command to view the details of the NAS file system that you specify.Linux_ECSIn the preceding figure,
    • Used indicates the used space.
    • Size indicates the maximum size of the file system. You are not charged based on the maximum size of a NAS file system.
    Note 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 Enable an automatic mount at startup for an NFS file system.
  • Windows ECS instances
    After you connect to an ECS instance, start File Explorer. The SMB file that you specify is mounted as a network drive.Windows_ECS
    Note 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.