# Step 1: Create a File System

You can create a file system and mount it to multiple ECSs. Then the ECSs can share this file system. You can create two types of file systems: SFS Capacity-Oriented and SFS Turbo.

#### Prerequisites

1. Before creating a file system, ensure that a VPC is available.

   If no VPC is available, create a VPC by referring to section "Creating a VPC" in the Virtual Private Cloud User Guide.

2. Before creating a file system, ensure that ECSs are available and reside within the created VPC.

   If no ECS is available, create an ECS by referring to "Creating an ECS" in the Elastic Cloud Server User Guide.

#### Creating an SFS Capacity-Oriented File System

1. Log in to the management console using a cloud account.

   1. Log in to the management console and select a region and a project.
   2. Choose Storage > Scalable File Service.
2. In the upper right corner of the page, click Create File System.
3. Set the parameters as described in Table 1 as shown in Figure 1.

   Figure 1 Creating a file system

   Table 1 Parameter description
   Parameter | Description | Remarks
   --- | --- | ---
   File System Type | Select SFS Capacity-Oriented or SFS Turbo. | Select SFS Capacity-Oriented.
   Region | This parameter is mandatory. Region of the tenant. Select the current region from the drop-down list in the upper left corner of the page. | You are advised to select the same region as that of the ECS.
   AZ | A geographical area with an independent network and an independent power supply. | You are advised to select the same AZ as that of the ECS.
   Protocol Type | SFS supports NFS (only the NFSv3 protocol currently) for file system access. | -

   VPC

   An ECS cannot access file systems in a different VPC. Select the VPC to which the ECS belongs.

   NOTE:
   - By default, all ECSs in a VPC have the same rights. You can modify the VPC in the future.
   - Upon creation, only one VPC can be added for each file system. After a file system is created, you can configure multiple VPCs by referring to Configuring VPCs for the SFS file system.

   Click View VPC to view existing VPCs or create a new one.

   Maximum Capacity | Maximum capacity of a single file system. When the used capacity of a file system reaches this value, no more data can be written to the file system. You need to expand the file system. | The value ranges from 1 GB to 512,000 GB.

   Encryption

   This parameter is optional.

   This parameter specifies whether a file system is encrypted. You can create a file system that is encrypted or not, but you cannot change the encryption settings of an existing file system. If Encryption is selected, the following parameters will be displayed:
   - Create Agency

     If the KMS access rights are not granted to SFS Capacity-Oriented, this button will be displayed. Otherwise, this button will not be displayed.

     Click Create Agency to grant SFS Capacity-Oriented the permissions to access KMS. The system automatically creates an agency and names it SFSAccessKMS. When SFSAccessKMS is displayed for Agency Name, the KMS access rights have been granted to SFS Capacity-Oriented, and SFS Capacity-Oriented can obtain KMS keys for encrypting or decrypting the file system. After the rights are granted, follow-up operations do not need granting rights again.

   - Agency Name
     - Agency: An agency is a trust relationship between two tenants or services. A tenant can create an agency to grant resource access rights to another tenant or service.
     - SFSAccessKMS: If Agency Name is SFSAccessKMS, KMS keys have been assigned to SFS Capacity-Oriented to encrypt or decrypt the file system.
   - KMS key name
     NOTE:

     KMS key name is displayed only after the agency named SFSAccessKMS has been created. For details, see Create Agency above.

     KMS key name is the identifier of the key, and you can use KMS key name to specify the KMS key that is to be used for encryption. You can select one of the following keys:

     - Default master key: After the KMS access rights have been granted to SFS Capacity-Oriented, the system automatically creates a Default master key and names it sfs/default.
     - Customer master keys (CMKs): Existing or newly created CMKs. For details, see "Creating a CMK" in the Key Management Service User Guide.
     NOTE:

     Before you use the encryption function, the KMS access rights must be granted to SFS Capacity-Oriented. If you have the right to grant the permission, grant SFS the permissions to access KMS directly. Otherwise, you need to contact the system administrator to obtain the "Security Administrator" rights first. For details, see File System Encryption.

   -

   Name

   User-defined name of the file system. If you create more than one file system, a name suffix is added to each file system name automatically. For example, if you set the name to sfs-name for two new file systems, the two file system names will be sfs-name-001 and sfs-name-002.

   The value can contain only letters, digits, underscores (_), and hyphens (-). When creating a single file system, the value can contain a maximum of 255 characters. When creating file systems in batches, enter 1 to 251 characters.

   Quantity

   Number of file systems to be created.

   Each cloud account can have a total of 512,000 GB for its file systems. Each cloud account can create a maximum of 10 file systems, one by one or in a batch.

   If the quantity or total capacity of the file systems you are creating exceeds the upper limit, contact customer service to apply for a higher quota. For details, see How Do I Apply for a Higher Quota?

   Tag

   This parameter is optional.

   When creating a file system, you can bind tags to it. Tags are used to identify file system resources, and you can classify and search for file system resources by tag.

   Tags are composed of key-value pairs.
   - Key: Mandatory if the file system is going to be tagged.

     A tag key can contain a maximum of 36 characters. It can only contain letters, digits, hyphens (-), and underscores (_).

   - Value: Optional if the file system is going to be tagged. It can be an empty character string. A tag value can contain a maximum of 43 characters. It can only contain letters, digits, hyphens (-), and underscores (_).
     NOTE:
     - You can add a maximum of 10 tags to one file system.
     - The tag keys of the same file system must be unique.
     - Except for tagging the file system during disk creation, you can also add, modify, or delete tags for existing file systems.

   -

4. Click Create Now.
5. Confirm the file system information and click Submit.
6. Go back to the file system list.

   If the status of the created file system is Available, the file system is created successfully. If the status is Creation failed, contact the administrator.

#### Creating an SFS Turbo File System

1. Log in to the management console using a cloud account.

   1. Log in to the management console and select a region and a project.
   2. Choose Storage > Scalable File Service.
2. In the upper right corner of the page, click Create File System.
3. Set the parameters on the page shown in Figure 2. Table 2 describes the parameters.

   Figure 2 Creating an SFS Turbo file system

   Table 2 Parameter description
   Parameter | Description | Remarks
   --- | --- | ---
   File System Type | This parameter is mandatory. Select SFS Capacity-Oriented or SFS Turbo. | Select SFS Turbo.
   Region | This parameter is mandatory. Region of the tenant. Select the current region from the drop-down list in the upper left corner of the page. | You are advised to select the same region as that of the ECS.
   AZ | This parameter is mandatory. A geographical area with an independent network and an independent power supply. | You are advised to select the same AZ as that of the ECS.
   Protocol Type | This parameter is mandatory. SFS Turbo supports NFS for file system access. | The default value is NFS.

   Storage Class

   This parameter is mandatory.

   Includes SFS Turbo Standard, SFS Turbo Standard – Enhanced, SFS Turbo Performance, and SFS Turbo Performance – Enhanced. For details about the features and application scenarios of each storage class, see File System Types.

   The default value is Standard.

   NOTE:

   Once a file system is created, its storage class cannot be changed. If you want to change the storage class, you need to create another file system. Therefore, you are advised to plan the storage class carefully in advance.

   Capacity (GB)

   Maximum capacity of a single file system. When the used capacity of a file system reaches this value, no more data can be written to the file system. You need to expand the file system. The capacity of an SFS Turbo file system cannot be decreased. Set an appropriate file system capacity based on your service needs.

   Support scope:
   - SFS Turbo Standard: 500 GB to 32 TB
   - SFS Turbo Performance: 500 GB to 32 TB
   - SFS Turbo Standard - Enhanced and SFS Turbo Performance - Enhanced: 10 TB to 320 TB.

   VPC

   This parameter is mandatory.

   Select a VPC and its subnet.
   - VPC: An ECS cannot access file systems in a different VPC. Select the VPC to which the ECS belongs.
   - Subnet: A subnet is an IP address range in a VPC. In a VPC, a subnet segment must be unique. A subnet provides dedicated network resources that are logically isolated from other networks, improving network security.
   NOTE:

   Upon creation, only one VPC can be added for each file system. Multi-VPC and cross-VPC file sharing can be implemented through VPC peering connection.

   For details about VPC peering connection, see section "VPC Peering Connection" in Virtual Private Cloud User Guide.

   -

   Security Group

   This parameter is mandatory.

   A security group is a virtual firewall that provides secure network access control policies for file systems. You can define different access rules for a security group to protect the file systems that are added to this security group.

   When creating an SFS Turbo file system, you can select only one security group.

   You are advised to use an independent security group for an SFS Turbo instance to isolate it from service nodes.

   The security group rule configuration affects the normal access and use of SFS Turbo. For details about how to configure a security group rule, see section "Adding a Security Group Rule" in the Virtual Private Cloud User Guide. After an SFS Turbo file system is created, the system automatically enables the security group port required by the NFS protocol in the SFS Turbo file system. This ensures that the SFS Turbo file system can be accessed by your ECS and prevents file system mounting failures. The inbound ports required by the NFS protocol are ports 111, 2049, 2051, 2052, and 20048. If you need to change the enabled ports, choose Access Control > Security Groups of the VPC console and locate the target security group.

   -

   Encryption

   This parameter is optional.

   This parameter specifies whether a file system is encrypted. You can create a file system that is encrypted or not, but you cannot change the encryption settings of an existing file system. If Encryption is selected, the following parameters will be displayed:
   - KMS key name

     KMS key name is the identifier of the key, and you can use KMS key name to specify the KMS key that is to be used for encryption. Select an existing key from the drop-down list, or click View KMS List to create a new key. For details, see "Creating a CMK" in the Key Management Service User Guide.

   - KMS key ID

     After you select a key name, the system automatically generates a key ID.

   -

   Name | This parameter is mandatory. User-defined name of the file system. | The value can contain only letters, digits, and hyphens (-). The name of the created file system must contain more than four characters and less than or equal to 64 characters.

4. Click Create Now.
5. Confirm the file system information and click Submit.
6. Complete the creation and go back to the file system list.

   If the status of the created file system is Available, the file system is created successfully. If the status is Creation failed, contact the administrator.

Parent topic: Getting Started