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 mount may fail.
  • 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.

DryRun Boolean Yes false

Check whether one or more mount targets exist.

This parameter is required if you want to create a mount target for a Cloud Paralleled File System (CPFS). The dry run does not create a mount target.

Default value: false.

FileSystemId String Yes 174494****

The ID of the file system.

NetworkType String Yes Vpc

The network type of the mount target.

Valid values:

  • Vpc: virtual private cloud (VPC)
  • Classic: the classic network
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).

VpcId String No vpc-2zesj9afh3y518k9o****

The ID of the VPC.

This parameter is valid and required if the mount target resides in a VPC.

VSwitchId String No vsw-2zevmwkwyztjuoffg****

The ID of the vSwitch.

This parameter is valid and required if the mount target resides in a VPC.

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: An IPv6 domain name is not created for the mount target.
Note Only Extreme NAS file systems that reside in the China (Hohhot) region support IPv6.

Response parameters

Parameter Type Example Description
MountTargetDomain String 174494b666-x****.cn-hangzhou.nas.aliyuncs.com

The IPv4 domain name of the mount target.

MountTargetExtra Struct

The list of mount targets.

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

The dual-stack domain name of the mount target.

RequestId String 70EACC9C-D07A-4A34-ADA4-77506C42****

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateMountTarget
&DryRun=false
&FileSystemId=174494****
&NetworkType=Vpc
&<Common request parameters>

Sample success responses

XML format

<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>

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

HttpCode 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 dry run 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 RAM user is not authorized to create the service-linked role AliyunServiceRoleForNasStandard. Grant the RAM user the ram:CreateServiceLinkedRole permission.
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 status.
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.