Creates a mount target.

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

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 CreateMountTarget

The operation that you want to perform.

Set the value to CreateMountTarget.

FileSystemId String Yes 174494****

The ID of the file system.

  • Sample ID of a General-purpose NAS file system: 31a8e4****.
  • The IDs of Extreme NAS file systems must start with extreme-. Example: extreme-0015****.
  • The IDs of Cloud Parallel File Storage (CPFS) file systems must start with cpfs-. Example: cpfs-125487****.
Note CPFS file systems are available only on the China site (aliyun.com).
AccessGroupName String No classic-test

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.

Default permission groups: DEFAULT_VPC_GROUP_NAME (the default permission group for VPCs) and DEFAULT_CLASSIC_GROUP_NAME (the default permission group for the classic network).

NetworkType String Yes Vpc

The network type of the mount target.

Valid values:

  • Vpc: virtual private cloud (VPC)
  • Classic: the classic network
VpcId String No vpc-2zesj9afh3y518k9o****

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.

VSwitchId String No vsw-2zevmwkwyztjuoffg****

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.

SecurityGroupId String No sg-bp1fg655nh68xyz9****

The ID of the security group.

EnableIpv6 Boolean No true

Specifies whether to create an IPv6 domain name for the mount target.

Valid values:

  • true: An IPv6 domain name is created for the mount target.
  • false (default value): No IPv6 domain name is created for the mount target.
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.
DryRun Boolean No false

Specifies whether 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.

  • true: performs a precheck but does not create a mount target. In the precheck, the system checks the request format, service limits, available CPFS resources, and whether the required parameters are specified. If the request fails to pass the precheck, an error message is returned. If the request passes the precheck, the HTTP status code 200 is returned. No value is returned for the MountTargetDomain parameter.
  • false (default value): sends the request. If the request passes the precheck, a mount target is created.

Response parameters

Parameter Type Example Description
RequestId String 70EACC9C-D07A-4A34-ADA4-77506C42****

The ID of the request.

MountTargetDomain String 174494b666-x****.cn-hangzhou.nas.aliyuncs.com

The IPv4 domain name of the mount target.

MountTargetExtra Object

The list of mount targets.

DualStackMountTargetDomain String 174494b666-x****.dualstack.cn-hangzhou.nas.aliyuncs.com

The dual-stack (IPv4 and IPv6) domain name of the mount target.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateMountTarget
&FileSystemId=174494****
&AccessGroupName=classic-test
&NetworkType=Vpc
&VpcId=vpc-2zesj9afh3y518k9o****
&VSwitchId=vsw-2zevmwkwyztjuoffg****
&SecurityGroupId=sg-bp1fg655nh68xyz9****
&EnableIpv6=true
&DryRun=false
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateMountTargetResponse>
    <RequestId>70EACC9C-D07A-4A34-ADA4-77506C42****</RequestId>
    <MountTargetDomain>174494b666-x****.cn-hangzhou.nas.aliyuncs.com</MountTargetDomain>
    <MountTargetExtra>
        <DualStackMountTargetDomain>174494b666-x****.dualstack.cn-hangzhou.nas.aliyuncs.com</DualStackMountTargetDomain>
    </MountTargetExtra>
</CreateMountTargetResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "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 message returned because the request has been accepted by the backend.
400 InvalidFileSystem.NotsupportedIPv6 The file system does not support IPv6. The error message returned because 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 error message returned because the vSwitch does not support IPv6. Enable IPv6 and try again.
400 IdempotentParameterMismatch The same client token was passed in to different parameters. The error message returned because the same client token is specified in different requests.
400 MissingParameter.AccessGroupName You must specify AccessGroupName when you create a standard or extreme file system mount target. The error message returned because you have not specified the AccessGroupName parameter. This parameter is required if you create a mount target for a General-purpose NAS file system or an Extreme NAS file system.
400 InvalidVSwitchId.IpNotEnough The number of the specified VSwitch IP address is insufficient. The error message returned because 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 error message returned because the specified CIDR block of the VPC conflicts with the server.
400 DryRunOperation The request is validated with DryRun flag set. The message returned because the request is validated.
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 error message returned because the current RAM user is not authorized to create the service-linked role AliyunServiceRoleForNasStandard. Grant the ram:CreateServiceLinkedRole permission to the RAM user.
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 state.
403 InvalidRamRole.NotExist The specified RAM role does not exist. The error message returned because the specified RAM role does not exist.
403 InvalidRamRole.NoPermission The specified RAM role does not have sufficient permission. The error message returned because the specified RAM role does not have the permissions to create a mount target.
403 InvalidMountTarget.AlreadyExisted The specified mount target already exists. The error message returned because the specified mount target already exists.
403 Resource.OutOfStock The inventory of the specified zone is insufficient. The error message returned because the available resources in the specified zone are insufficient.
403 OperationDenied.MountTargetExceedLimit The maximum number of mount target in the specified file system is exceeded. The error message returned because the maximum number of mount targets has been reached.
404 InvalidParameter.VswNotFound The specified VSwitch does not exist. The error message returned because the specified vSwitch does not exist.
404 InvalidParameter.VpcNotFound The specified VPC does not exist. The error message returned because the specified VPC does not exist.
404 InvalidFileSystem.NotFound The specified file system does not exist. The error message returned because the specified file system does not exist.

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