Creates a mount target.
Operation description
- After you call the CreateMountTarget operation, a mount target is not immediately created. Therefore, we recommend that you call the DescribeMountTargets operation to query the status of the mount target. If the mount target is in the Active state, you can then mount the file system. Otherwise, the file system may fail to be mounted.
- 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
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
nas:CreateMountTarget | create | *FileSystem acs:nas:{#regionId}:{#accountId}:filesystem/{#filesystemId} *VSwitch acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
FileSystemId | string | Yes | The ID of the file system.
Note
CPFS file systems are available only on the China site (aliyun.com).
| 174494**** |
AccessGroupName | string | No | The name of the permission group. This parameter is required if you create a mount target for a General-purpose NAS file system or an Extreme NAS file system. The default permission group for virtual private clouds (VPCs) is named DEFAULT_VPC_GROUP_NAME. | vpc-test |
NetworkType | string | Yes | The network type of the mount target. Valid value: Vpc. | Vpc |
VpcId | string | No | The ID of the VPC. This parameter is valid and required if the mount target resides in a VPC. Example: If you set the NetworkType parameter to VPC, you must specify the VpcId parameter. | vpc-2zesj9afh3y518k9o**** |
VSwitchId | string | No | The ID of the vSwitch. This parameter is valid and required if the mount target resides in a VPC. Example: If you set the NetworkType parameter to VPC, you must specify the VSwitchId parameter. | vsw-2zevmwkwyztjuoffg**** |
SecurityGroupId | string | No | The ID of the security group. | sg-bp1fg655nh68xyz9**** |
EnableIpv6 | boolean | No | Specifies whether to create an IPv6 domain name for the mount target. Valid values:
Note
Only Extreme NAS file systems that reside in the Chinese mainland support IPv6. If you want to create an IPv6 domain name for the mount target, you must enable IPv6 for the file system.
| true |
DryRun | boolean | No | Specifies whether to perform a dry run to check for existing mount targets. This parameter is valid only for CPFS file systems. If you set this parameter to true, the system checks whether the request parameters are valid and whether the requested resources are available. In this case, no mount target is created and no fee is incurred.
| false |
Response parameters
Examples
Sample success responses
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. | The vSwitch does not support IPv6. Enable IPv6 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. | The available IP addresses within the CIDR block of the specified vSwitch are 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. | 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. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-09-25 | The Error code has changed | View Change Details |