Creates a file system.

Description

Before you call this operation, make sure that you understand the billing and pricing of Apsara File Storage NAS. For more information, see Billing of General-purpose NAS file systems and Pricing.

Before you create a file system, you must pass real-name verification.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateFileSystem

The operation that you want to perform.

Set the value to CreateFileSystem.

EncryptType Integer Yes 1

Specifies whether to encrypt the file system.

This parameter is valid only if the FileSystemType parameter is set to standard or extreme.

You can use keys that are hosted by Key Management Service (KMS) to encrypt data that is stored in the file system. Data is automatically decrypted when you access encrypted data.

Valid values:

  • 0: The file system is encrypted.
  • 1: The file system is not encrypted.
ProtocolType String Yes NFS

The type of the protocol.

Valid values:

  • If the FileSystemType parameter is set to standard, you can specify NFS and SMB for this parameter.
  • If the FileSystemType parameter is set to extreme, you can specify NFS for this parameter.
  • If the FileSystemType parameter is set to cpfs, you can specify cpfs for this parameter.
StorageType String Yes Performance

The type of the storage.

Valid values:

  • If the FileSystemType parameter is set to standard, you can specify Performance and Capacity for this parameter.
  • If the FileSystemType parameter is set to extreme, you can specify standard and advance for this parameter.
  • If the FileSystemType parameter is set to cpfs, you can specify advance_100 (100 MB/s/TiB baseline) and advance_200 (200MB/s/TiB baseline) for this parameter.
ZoneId String Yes cn-hangzhou-b

The ID of the zone.

Each region has multiple isolated locations known as zones. The power supply and network of each zone are independent.

Note
  • An ECS instance can access a NAS file system in the same region but a different zone.
  • We recommend that you select the zone where the ECS instance resides. This prevents cross-zone latency between the file system and the ECS instance.
FileSystemType String No standard

The type of the file system.

Default value: standard. Valid values:

  • standard: General-purpose NAS file systems.
  • extreme: Extreme NAS file systems.
  • cpfs: CPFS file systems.
ChargeType String No PayAsYouGo

The billing method of the file system.

Valid values:

  • PayAsYouGo: The pay-as-you-go billing method is used.
  • Subscription: The subscription billing method is used.
Duration Integer No 1

The subscription period.

This parameter is valid and required only if the ChargeType parameter is set to Subscription. Unit: months.

If you do not renew a subscription file system before the file system expires, the file system is automatically released.

Capacity Long No 100

The capacity of the file system.

This parameter is valid and required only if the FileSystemType parameter is set to extreme or cpfs. Unit: GiB.

For more information about how to select specifications, go to the following buy pages:

Bandwidth Long No 150

The maximum throughput of the file system.

This parameter is valid and required only if the FileSystemType parameter is set to cpfs. Unit: MB/s.

For more information about how to select specifications, go to the following buy pages:

SnapshotId String No s-xxx

The ID of the snapshot.

This parameter is available only for Extreme NAS file systems.

Note If you create a file system from a snapshot, the version of the file system is the same as that of the source file system from which the snapshot is created. Assume that the source file system of the snapshot is version 1. To create a file system of version 2, you can create file system A from the snapshot and create file system B of version 2. You can then copy the data and migrate your business from file system A to file system B.
VpcId String No vpc-xxx

The VpcId parameter is reserved for future use. You do not need to specify this parameter.

VSwitchId String No vsw-xxx

The VSwitchId parameter is reserved for future use. You do not need to specify this parameter.

Description String No The description of the file system.

The description of the file system.

Limits:

  • The name must be 2 to 128 characters in length.
  • The name must start with a letter and cannot start with http:// or https://.
  • It can contain digits, colons (:), underscores (_), and hyphens (-).
ClientToken String No 123e4567-e89b-12d3-a456-42665544****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The ID of each request is unique.
KmsKeyId String No N/A

The ID of the key that is managed by Key Management Service (KMS).

DryRun Boolean No true

Specifies whether to perform a dry run for the request.

The dry run checks whether the request parameters are valid and whether the requested resources are available. The dry run does not create a file system or incur fees.

Default value: false. Valid values:

  • true: A dry-run request is sent and no file system is created. The check items include the request format, service limits, available NAS resources, and whether the required parameters are set. If the check fails, the corresponding error is returned. If the check succeeds, the HTTP status code 200 is returned, but no FileSystemId is returned.
  • false: A normal request is sent, and a file system is created after the check succeeds.

Note the following information about API idempotence:

The CreateFileSystem operation creates a file system and incur fees. Therefore, the client may attempt to resend the request if the request times out or an internal error occurs. In this case, you can specify the ClientToken parameter in the request to prevent the client from repeatedly sending the request.

The ClientToken parameter has the following details:

  • The client token is a unique and case-sensitive string that is generated by the client. It can only contain ASCII characters and cannot exceed 64 characters in length. Example:
    ClientToken=123e4567-e89b-12d3-a456-426655440000
  • If you specify a used client token and other request parameters are modified, the ECS instance will return the IdempotentParameterMismatch error code.
    Note You must change the values of the SignatureNonce, Timestamp, and Signature parameters if you call the operation again. This is because the ECS instance uses SignatureNonce to prevent replay attacks and uses Timestamp to identify the timestamp of each request. Therefore, a retry request requires different values of the SignatureNonce and Timestamp parameters. In this case, the value of the Signature parameter also changes.
  • If you specify the ClientToken parameter, resend the request based on the following HTTP status codes and error messages:
    • If the HTTP status code 200 is returned, the retry generates the same result as the last request and your server status is not affected.
    • If a 4xx HTTP status code is returned and the error message does not indicate "try it later", the request parameters are invalid. In this case, you must modify the request parameters based on the returned error message and then resend the request.
    • If a 5xx HTTP status code is returned, a network timeout or an internal error may occur. In this case, resend the same request that contains the same client token and other request parameters.
  • The ClientToken is valid for 30 days.

Response parameters

Parameter Type Example Description
FileSystemId String 1ca404****

The ID of the file system that is created.

RequestId String 98696EF0-1607-4E9D-B01D-F20930B6****

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CreateFileSystem
&EncryptType=1
&ProtocolType=NFS
&StorageType=Performance
&ZoneId=cn-hangzhou-b
&<Common request parameters>

Sample success responses

XML format

<CreateFileSystemResponse>
      <FileSystemId>1ca404****</FileSystemId>
      <RequestId>98696EF0-1607-4E9D-B01D-F20930B6****</RequestId>
</CreateFileSystemResponse>

JSON format

{
    "CreateFileSystemResponse": {
        "FileSystemId": "1ca404****",
        "RequestId": "98696EF0-1607-4E9D-B01D-F20930B6****"
    }
}

Error codes

HttpCode Error code Error message Description
400 IdempotentParameterMismatch The same client token was passed in to different parameters. The error message returned because the same client token is passed into two different parameters.
202 RequestAccepted The request has been accepted by the server. The message returned because the request has been accepted by the backend.
400 InvalidParameter.KmsServiceNotEnabled Key Management Service is not enabled. The error message returned because KMS is disabled.
403 OperationDenied.InvalidState The operation is not permitted when the status is processing. The error message returned because the file system is in an invalid status.
403 InvalidFileSystem.AlreadyExisted The specified file system already exists. The error message returned because the specified file system already exists.
403 Resource.OutOfStock The inventory of the specified zone is insufficient. The error message returned because the resources in the specified zone is insufficient.
400 DryRunOperation The request is validated with DryRun flag set. The message returned because the dry-run request is validated.

For a list of error codes, visit the API Error Center.