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.

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.

Mount a NAS file system

  1. Log on to the ECS console.
  2. Create an ECS instance. For more information, see Create an instance by using the wizard.
    On the buy page, set the following 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 or a Windows image of Windows Server 2019 Datacenter.
    • Storage: Click NAS File System, click Add NAS File System, and then set the parameters. The following table describes the parameters.Mount a NAS file system on an ECS instance
      Legend Parameter Description
      1 File system ID
      • Linux images support only NFS file systems.
      • Windows images support only 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 same VPC.
      • If no mount target is available, add a mount target to the file system. For more information, see Create a mount target.
      3 Local directory 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
      • 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.
      • For an SMB file system, select SMB.

Mount multiple NAS file systems

If you want to mount multiple file systems on the ECS instance, click Add NAS 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.
  • 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 more than five NAS file systems, submit a ticket.

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.
  • Local directory: You can specify only the root directory of NAS file systems. You cannot specify the subdirectories of NAS file systems.
Note If the feature cannot meet your business requirements, mount NAS file systems after the ECS instance is created. For more information, see Mount a NAS file system on an ECS instance.

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:
  • ECS Linux instances
    Connect to the ECS instance and run the df -h command to view the details of the mounted NAS file system. Linux_ECSIn 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.
    Note
    • 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.
    • For information about how to connect to an ECS instance, see Guidelines on instance connection.
  • ECS Windows instances
    Connect to the ECS instance and start File Explorer. The SMB file that you specify is mounted as a network drive.Windows_ECS
    Note 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.