Creates a file system.
Operation description
-
Before you call this operation, make sure that you fully understand the billing rules and pricing of File Storage NAS. For more information, see Billing overview and Pricing.
-
To create a file system, you must pass real-name verification. For more information, see Real-name verification for accounts.
-
When you invoke this operation, the service-linked role for NAS required for the operation is automatically created. For more information, see Manage the service-linked role for NAS.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
nas:CreateFileSystem |
create |
*FileSystem
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| FileSystemType |
string |
No |
The type of the file system. Valid values:
Valid values:
|
standard |
| ChargeType |
string |
No |
The billing method. Valid values:
Valid values:
|
PayAsYouGo |
| Duration |
integer |
No |
The subscription duration. Unit: months. This parameter is required and takes effect only when ChargeType is set to Subscription. When a subscription instance expires, if no renewal is performed, the instance expires and automatic release is triggered. |
1 |
| Capacity |
integer |
No |
The capacity of the file system. Unit: GiB. This parameter is required and takes effect only when FileSystemType is set to extreme, cpfs, or cpfsse. For valid values, refer to the actual specifications on the buy page: |
100 |
| Bandwidth |
integer |
No |
The maximum throughput of the file system. Unit: MB/s. For valid values, refer to the actual specifications on the buy page. |
150 |
| StorageType |
string |
Yes |
The storage type.
Valid values:
|
Performance |
| ZoneId |
string |
No |
The zone ID. A zone is a physical area with independent power grids and networks in the same region. If FileSystemType is set to standard, this parameter is optional. By default, an eligible zone that meets the requirements is randomly selected based on the ProtocolType and StorageType configurations. If FileSystemType is set to extreme or cpfs, this parameter is required. Note
|
cn-hangzhou-b |
| ProtocolType |
string |
Yes |
The file transfer protocol type.
Valid values:
|
NFS |
| EncryptType |
integer |
No |
Specifies whether to encrypt the file system. KMS is used to manage keys and encrypt data at rest in the file system. When reading and writing encrypted data, no decryption is required. Valid values:
Note
Valid values:
|
1 |
| SnapshotId |
string |
No |
The snapshot ID. This parameter is supported only for Extreme NAS file systems of the premium storage type. Note
When you create a file system from a snapshot, the created file system has the same version as the source file system of the snapshot. For example, if the source file system of the snapshot is of version 1 and you want to create a file system of version 2, you can first create File System A from the snapshot, and then create File System B that meets the configurations of version 2. After you copy the data from File System A to File System B, migrate your business to File System B. |
s-extreme-snapsho**** |
| VpcId |
string |
No |
The VPC ID.
|
vpc-bp18cx9a7zoh0h9b4**** |
| VSwitchId |
string |
No |
The vSwitch ID.
|
vsw-bp131dkqilvw5pnlt**** |
| Description |
string |
No |
The description of the file system. Limits:
|
The description of this file system |
| ClientToken |
string |
No |
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 make sure that the value is unique among different requests. The client token can contain only 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 RequestId of the API request as the ClientToken. The RequestId of each API request may be different. |
123e4567-e89b-12d3-a456-42665544**** |
| KmsKeyId |
string |
No |
The ID of the KMS key. This parameter is required only when EncryptType is set to 2. |
fcbd****-62**-4a**-b605-c58cc1d5**** |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run on the creation request. A dry run helps you check whether the parameters are valid and whether resources are sufficient. No instance is created and no fees are charged during a dry run. Valid values:
|
true |
| ResourceGroupId |
string |
No |
The resource group ID. You can view the resource group ID in the Resource Management console. |
rg-acfmwavnfdf**** |
| Tag |
array<object> |
No |
The tags. Array length: 1 to 20. If the array contains multiple tag objects, the tag keys must be unique. |
|
|
object |
No |
The tag object. |
||
| Key |
string |
No |
The tag key. Limits:
|
nastest |
| Value |
string |
No |
The tag value. Limits:
|
testValue |
| RedundancyType |
string |
No |
The storage redundancy type. This parameter takes effect only for CPFS SE. Valid value: ZRS. Valid values:
|
ZRS |
| RedundancyVSwitchIds |
array |
No |
The IDs of the zone-redundant vSwitches. This parameter is required when RedundancyType is set to ZRS. You must specify three vSwitch IDs, and the vSwitches must reside in three different zones. |
|
|
string |
No |
The ID of the zone-redundant vSwitch. |
vsw-123xxx |
|
| HpnZone |
string |
No |
The cluster ID (high-performance network zone). This parameter is required when FileSystemType is set to bmcpfs and cannot be modified after the file system is created. You can call the DescribeSpecifications operation to query available values. High-performance network zone. Example: B1. |
B1 |
Note the following items about API idempotence:
Because the CreateFileSystem operation involves the creation of cloud resources and incurs fees, the client may retry the request if a request timeout or internal server error occurs. Specify the ClientToken parameter in the request to prevent duplicate orders caused by multiple retries.
This operation supports idempotence only when the FileSystemType parameter is set to extreme or cpfs. If the FileSystemType parameter is set to standard, this operation does not support idempotence.
The details of the ClientToken parameter are as follows:
ClientToken is a unique, case-sensitive string of no more than 64 ASCII characters generated by the client. Example:
ClientToken=123e4567-e89b-12d3-a456-42665544****If you provide a ClientToken that has already been used but other request parameters have changed, File Storage NAS returns the IdempotentParameterMismatch error code.
The SignatureNonce, Timestamp, and Signature parameters must change during a retry. This is because File Storage NAS uses SignatureNonce to prevent replay attacks and Timestamp to mark the time of each request. Therefore, a retried request must provide different SignatureNonce and Timestamp values, which also results in a different Signature value.
-
After you add the ClientToken parameter:
If an HTTP status code of 200 is returned, a retry returns the same result to the client without affecting the server state.
If a 4xx HTTP status code is returned and the error message does not suggest trying again later, retries will never succeed. You must troubleshoot the issue based on the error message, modify the request parameters, and then retry the request.
If a 5xx HTTP status code is returned, it indicates that a network timeout or an internal server error may have occurred. You can resend the same request, which must include the same ClientToken and business request parameters, to confirm the result.
-
A ClientToken is valid for 30 days.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response structure. |
||
| FileSystemId |
string |
The ID of the created file system. |
1ca404**** |
| RequestId |
string |
The request ID. |
98696EF0-1607-4E9D-B01D-F20930B6**** |
Examples
Success response
JSON format
{
"FileSystemId": "1ca404****",
"RequestId": "98696EF0-1607-4E9D-B01D-F20930B6****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 202 | RequestAccepted | The request has been accepted by the server. | The request has been accepted by the server. |
| 400 | IdempotentParameterMismatch | The same client token was passed in to different parameters. | The same client token was passed in to different parameters. |
| 400 | InvalidParameter.KmsServiceNotEnabled | Key Management Service is not enabled. | Key Management Service is not enabled. |
| 400 | DryRunOperation | The request is validated with DryRun flag set. | The request is validated with DryRun flag set. |
| 400 | SubAccount.NoExtremeSLRPermission | The 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. |
| 400 | SubAccount.NoStandardSLRPermission | The 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. |
| 400 | SubAccount.NoEncryptionSLRPermission | The 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. |
| 400 | InvalidParam.NotSupportBYOK | The specified file system type does not support the BYOK encryption function. | The specified file system type does not support the BYOK encryption function. |
| 400 | MissingParameter.KmsKeyId | When 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. |
| 400 | InvalidParameter.InvalidKmsKeyId | The specified KMS key ID is invalid. | The specified KMS key ID is invalid. |
| 400 | InvalidParameter.KmsKeyIdNotFound | The specified KMS key ID does not exist. | The specified KMS key ID does not exist. |
| 403 | OperationDenied.InvalidState | The operation is not permitted when the status is processing. | The operation is not permitted when the status is processing. |
| 403 | InvalidFileSystem.AlreadyExisted | The specified file system already exists. | The specified file system already exists. |
| 403 | Resource.OutOfStock | The inventory of the specified zone is insufficient. | The inventory of the specified zone is insufficient. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.