CreateMountTarget
Create a mount target.
Operation description
When using the CreateMountTarget API to create a mount target, some resources are generated asynchronously. Therefore, after the CreateMountTarget API is successfully called, please first call the DescribeMountTargets API to query the mount target status. Proceed with the file system mounting operation only after the mount target status is Active; otherwise, the mounting may fail.
Calling this API will automatically create the NAS service-linked role required for the operation. For more information, see Manage NAS service-linked roles.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
nas:CreateMountTarget |
create |
*FileSystem
*VSwitch
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| FileSystemId |
string |
Yes |
File system ID.
|
174494**** |
| AccessGroupName |
string |
No |
Permission group name. This parameter is required when the target file system is General-purpose NAS or Extreme NAS. Default permission group: DEFAULT_VPC_GROUP_NAME (VPC default permission group). |
vpc-test |
| NetworkType |
string |
Yes |
Mount target network type. The value is Vpc, indicating VPC (Virtual Private Cloud). Valid values:
|
Vpc |
| VpcId |
string |
No |
VPC ID. When the network type is VPC, this field is required and meaningful. For example: When NetworkType=VPC, VpcId is required. |
vpc-2zesj9afh3y518k9o**** |
| VSwitchId |
string |
No |
vSwitch ID. When the network type is VPC, this field is required and meaningful. For example: When NetworkType=VPC, VSwitchId is required. |
vsw-2zevmwkwyztjuoffg**** |
| SecurityGroupId |
string |
No |
Security group ID. |
sg-bp1fg655nh68xyz9**** |
| EnableIpv6 |
boolean |
No |
Whether to create an IPv6 mount target. Valid values:
Note
Currently, only Extreme NAS in Chinese mainland regions supports the IPv6 feature, and the file system must have IPv6 enabled. |
true |
| DryRun |
boolean |
No |
Checks whether there are existing mount targets. Only CPFS file systems are supported for validation. The dry run operation helps you check parameter validity, verify inventory, etc., without actually creating a mount target or incurring any charges.
|
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
Request ID. |
70EACC9C-D07A-4A34-ADA4-77506C42**** |
| MountTargetDomain |
string |
IPv4 mount target. |
174494b666-x****.cn-hangzhou.nas.aliyuncs.com |
| MountTargetExtra |
object |
Mount target information collection. |
|
| DualStackMountTargetDomain |
string |
IPv4 and IPv6 dual-stack mount target. |
174494b666-x****.dualstack.cn-hangzhou.nas.aliyuncs.com |
Examples
Success response
JSON format
{
"RequestId": "70EACC9C-D07A-4A34-ADA4-77506C42****",
"MountTargetDomain": "174494b666-x****.cn-hangzhou.nas.aliyuncs.com",
"MountTargetExtra": {
"DualStackMountTargetDomain": "174494b666-x****.dualstack.cn-hangzhou.nas.aliyuncs.com"
}
}
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 | InvalidFileSystem.NotsupportedIPv6 | The file system does not support IPv6. | The file system does not support IPv6. |
| 400 | InvalidVSwitch.Ipv6NotTurnOn | The VSwitch you are currently using has not enabled the IPv6 function. Please enable this function first and try again. | |
| 400 | IdempotentParameterMismatch | The same client token was passed in to different parameters. | The same client token was passed in to different parameters. |
| 400 | MissingParameter.AccessGroupName | You must specify AccessGroupName when you create a standard or extreme file system mount target. | You must specify AccessGroupName when you create a standard or extreme file system mount target. |
| 400 | InvalidVSwitchId.IpNotEnough | The number of the specified VSwitch IP address is insufficient. | |
| 400 | InvalidParameter.ConflictVpcCidr | The specified VPC CIDR conflicts with the server. | The specified VPC CIDR conflicts with the server. |
| 400 | DryRunOperation | The request is validated with DryRun flag set. | The request is validated with DryRun flag set. |
| 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. |
| 403 | OperationDenied.InvalidState | The operation is not permitted when the status is processing. | The operation is not permitted when the status is processing. |
| 403 | InvalidRamRole.NotExist | The specified RAM role does not exist. | The specified RAM role does not exist. |
| 403 | InvalidRamRole.NoPermission | The specified RAM role does not have sufficient permission. | The specified RAM role does not have sufficient permission. |
| 403 | InvalidMountTarget.AlreadyExisted | The specified mount target already exists. | The specified mount target already exists. |
| 403 | Resource.OutOfStock | The inventory of the specified zone is insufficient. | The inventory of the specified zone is insufficient. |
| 403 | OperationDenied.MountTargetExceedLimit | The maximum number of mount target in the specified file system is exceeded. | The maximum number of mount target in the specified file system is exceeded. |
| 404 | InvalidParameter.VswNotFound | The specified VSwitch does not exist. | |
| 404 | InvalidParameter.VpcNotFound | The specified VPC does not exist. | The specified VPC does not exist. |
| 404 | InvalidFileSystem.NotFound | The specified file system does not exist. | The specified file system does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.