All Products
Search
Document Center

Apsara File Storage NAS:CreateFileSystem

Last Updated:Mar 14, 2024

Creates a file system.

Operation description

  • Before you call this operation, you must understand the billing and pricing of Apsara File Storage NAS. For more information, see Billing and Pricing .
  • Before you create a file system, you must complete real-name verification.
  • When you call this operation, a service-linked role of NAS is automatically created. For more information, see Manage the service-linked roles of NAS.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
FileSystemTypestringNo

The type of the file system.

Valid values:

  • standard (default): General-purpose NAS file system
  • extreme: Extreme NAS file system
  • cpfs: Cloud Parallel File Storage (CPFS) file system
Note CPFS file systems are available only on the China site (aliyun.com).
standard
ChargeTypestringNo

The billing method.

Valid values:

  • PayAsYouGo (default): pay-as-you-go
  • Subscription: subscription
PayAsYouGo
DurationintegerNo

The subscription duration.

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 when the file system expires, the file system is automatically released.

1
CapacitylongNo

The capacity of the file system. Unit: GiB.

This parameter is valid and required if the FileSystemType parameter is set to extreme.

Specify a value based on the specifications on the following buy page:

Extreme NAS file system (Pay-as-you-go)

100
BandwidthlongNo

The maximum throughput of the file system.

Unit: MB/s.

Specify a value based on the specifications on the buy page.

150
StorageTypestringYes

The storage type.

  • If the FileSystemType parameter is set to standard, you can set the StorageType parameter to Performance or Capacity.
  • If the FileSystemType parameter is set to extreme, you can set the StorageType parameter to standard or advance.
Performance
ZoneIdstringNo

The zone ID.

Each region has multiple isolated locations known as zones. Each zone has its own independent power supply and networks.

This parameter is not required if the FileSystemType parameter is set to standard. By default, a random zone is selected based on the protocol type and storage type.

This parameter is required if the FileSystemType parameter is set to extreme.

Note
  • An Elastic Compute Service (ECS) instance and a NAS file system that reside in different zones of the same region can access each other.
  • 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.
  • cn-hangzhou-b
    ProtocolTypestringYes

    The protocol type.

    • If the FileSystemType parameter is set to standard, you can set the ProtocolType parameter to NFS or SMB.
    • If the FileSystemType parameter is set to extreme, you can set the ProtocolType parameter to NFS.
    NFS
    EncryptTypeintegerNo

    Specifies whether to encrypt the data in the NAS file system.

    You can use a key that is managed by Key Management Service (KMS) to encrypt the data that is stored in a file system. When you read and write the encrypted data, the data is automatically decrypted.

    Valid values:

    • 0: The data in the file system is not encrypted.
    • 1: A NAS-managed key is used to encrypt the data in the file system. This value is valid only if the FileSystemType parameter is set to standard or extreme.
    • 2: A KMS-managed key is used to encrypt the data in the file system. This value is valid only if the FileSystemType parameter is set to extreme.
    Note You can use KMS-managed keys only in the following regions: US (Silicon Valley), US (Virginia), UK (London), Australia (Sydney), Germany (Frankfurt), India (Mumbai), and Singapore.
    1
    SnapshotIdstringNo

    The snapshot ID.

    This parameter is available only for Extreme NAS file systems.

    Note You can create a file system from a snapshot. In this case, the version of the file system is the same as that of the source file system. For example, the source file system of the snapshot uses 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.
    s-xxx
    VpcIdstringNo

    The ID of the virtual private cloud (VPC).

    This parameter is reserved and does not take effect. You do not need to configure this parameter.

    VSwitchIdstringNo

    The ID of the vSwitch.

    This parameter is reserved and does not take effect. You do not need to configure this parameter.

    DescriptionstringNo

    The description of the file system.

    Limits:

    • The description must be 2 to 128 characters in length.
    • The description must start with a letter and cannot start with http:// or https://.
    • The description can contain letters, digits, colons (:), underscores (_), and hyphens (-).
    ClientTokenstringNo

    The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How do I ensure the idempotence?

    Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
    123e4567-e89b-12d3-a456-42665544****
    KmsKeyIdstringNo

    The ID of the KMS-managed key.

    This parameter is required only if the EncryptType parameter is set to 2.

    DryRunbooleanNo

    Specifies whether to perform a dry run.

    During the dry run, the system checks whether the request parameters are valid and whether the requested resources are available. During the dry run, no file system is created and no fee is incurred.

    Valid values:

    • true: performs a dry run. The system checks the required parameters, request syntax, limits, and available NAS resources. If the request fails the dry run, an error message is returned. If the request passes the precheck, the HTTP status code 200 is returned. No value is returned for the FileSystemId parameter.
    • false (default): performs a dry run and sends the request. If the request passes the dry run, a file system is created.
    true

    Take note of the following information about API idempotence:
    The CreateFileSystem operation creates a file system and incurs fees. Therefore, if the request times out or an internal error occurs, the client may attempt to resend the request. In this case, you can specify the ClientToken parameter in the request. This ensures that the request is not repeatedly sent by the client.

    Note This operation supports idempotence only if the FileSystemType parameter is set to extreme. This operation does not support idempotence when the FileSystemType parameter is set to standard.

    The following list provides more details about the ClientToken parameter.

    • A client token is a unique and case-sensitive string that is generated by the client. The token can contain only ASCII characters and cannot exceed 64 characters in length. Example: ClientToken=123e4567-e89b-12d3-a456-426655440000.
    • If you specify a used client token and modify other request parameters, NAS returns the IdempotentParameterMismatch error code.
    Note If you call the operation again, you must change the values of the SignatureNonce, Timestamp, and Signature parameters. This is because NAS uses the SignatureNonce parameter to prevent replay attacks and uses the Timestamp parameter 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 changes.
    • If you specify the ClientToken parameter and the request fails, the request is resent based on the following HTTP status codes and error messages:

      • If the HTTP status code 200 is returned, the client can receive the same result as the last request after the request is resent. However, 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 occurred. In this case, you can resend the same request and the request must contain the same client token and request parameters.
    • A client token is valid for 30 days.

    Response parameters

    ParameterTypeDescriptionExample
    object

    The response parameters.

    RequestIdstring

    The request ID.

    98696EF0-1607-4E9D-B01D-F20930B6****
    FileSystemIdstring

    The ID of the file system that is created.

    1ca404****

    Examples

    Sample success responses

    JSONformat

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

    Error codes

    HTTP status codeError codeError messageDescription
    202RequestAcceptedThe request has been accepted by the server.The request has been accepted by the server.
    400IdempotentParameterMismatchThe same client token was passed in to different parameters.The same client token was passed in to different parameters.
    400InvalidParameter.KmsServiceNotEnabledKey Management Service is not enabled.Key Management Service is not enabled.
    400InvalidParameter.KmsKeyIdNotFoundThe KMS key ID does not exist.-
    400InvalidParameter.InvalidKmsKeyIdThe KMS key ID is invalid.-
    400DryRunOperationThe request is validated with DryRun flag set.The request is validated with DryRun flag set.
    400SubAccount.NoExtremeSLRPermissionThe RAM user does not have the permission to create service linked role AliyunServiceRoleForNasExtreme. Please authorize the RAM user the permission ram:CreateServiceLinkedRole.The RAM user does not have the permission to create service linked role AliyunServiceRoleForNasExtreme. Please authorize the RAM user the permission ram:CreateServiceLinkedRole.
    400SubAccount.NoStandardSLRPermissionThe RAM user does not have the permission to create service linked role AliyunServiceRoleForNasStandard. Please authorize the RAM user the permission ram:CreateServiceLinkedRole.The RAM user does not have the permission to create service linked role AliyunServiceRoleForNasStandard. Please authorize the RAM user the permission ram:CreateServiceLinkedRole.
    400SubAccount.NoEncryptionSLRPermissionThe RAM user does not have the permission to create service linked role AliyunServiceRoleForNasEncryption. Please authorize the RAM user the permission ram:CreateServiceLinkedRole.The RAM user does not have the permission to create service linked role AliyunServiceRoleForNasEncryption. Please authorize the RAM user the permission ram:CreateServiceLinkedRole.
    400InvalidParam.NotSupportBYOKThe specified file system type does not support the BYOK encryption function.The specified file system type does not support the BYOK encryption function.
    400MissingParameter.KmsKeyIdWhen parameter EncryptType equals 2, the parameter KmsKeyId is mandatory for your request.When parameter EncryptType equals 2, the parameter KmsKeyId is mandatory for your request.
    403OperationDenied.InvalidStateThe operation is not permitted when the status is processing.The operation is not permitted when the status is processing.
    403InvalidFileSystem.AlreadyExistedThe specified file system already exists.The specified file system already exists.
    403Resource.OutOfStockThe inventory of the specified zone is insufficient.The inventory of the specified zone is insufficient.

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2024-01-25The Error code has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 202
      delete Error Codes: 400
      delete Error Codes: 403
    2023-12-26The Error code has changed. The request parameters of the API has changedsee changesets
    Change itemChange content
    Error CodesThe Error code has changed.
      delete Error Codes: 202
      delete Error Codes: 400
      delete Error Codes: 403
    Input ParametersThe request parameters of the API has changed.
      Added Input Parameters: ResourceGroupId