All Products
Search
Document Center

File Storage NAS:CreateMountTarget

Last Updated:Jun 25, 2026

Creates a mount target.

Operation description

  • When you call the CreateMountTarget operation to create a mount target, some resources are generated asynchronously. After the CreateMountTarget operation succeeds, first invoke the DescribeMountTargets operation to query the mount target status. Execute the file system mount operation only after the mount target status changes to Active. Otherwise, the mount operation may fail.

  • Invoking this operation triggers the automatic creation of the service-linked role required for the operation. For more information, see Manage the service-linked role for NAS.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

nas:CreateMountTarget

create

*FileSystem

acs:nas:{#regionId}:{#accountId}:filesystem/{#filesystemId}

*VSwitch

acs:vpc:{#regionId}:{#accountId}:vswitch/{#VSwitchId}

  • vpc:Vpc
None

Request parameters

Parameter

Type

Required

Description

Example

FileSystemId

string

Yes

The file system ID.

  • General-purpose NAS: 31a8e4****.

  • Extreme NAS: The ID must start with extreme-, such as extreme-0015****.

  • Cloud Parallel File Storage (CPFS): The ID must start with cpfs-, such as cpfs-125487****.

174494****

AccessGroupName

string

No

The name of the permission group.

This parameter is required if the file system is a General-purpose NAS or Extreme NAS file system.

Default permission group: DEFAULT_VPC_GROUP_NAME (the default permission group for VPCs).

vpc-test

NetworkType

string

Yes

The network type of the mount target. Set the value to Vpc, which indicates a virtual private cloud (VPC).

Valid values:

  • Vpc :

    VPC.

  • vpc :

    VPC.

  • VPC :

    VPC.

Vpc

VpcId

string

No

The VPC ID.

This parameter is required and valid only when the network type is VPC. For example: If NetworkType is set to VPC, VpcId is required.

vpc-2zesj9afh3y518k9o****

VSwitchId

string

No

The vSwitch ID.

This parameter is required and valid only when the network type is VPC. For example: If NetworkType is set to VPC, VSwitchId is required.

vsw-2zevmwkwyztjuoffg****

SecurityGroupId

string

No

The security group ID.

sg-bp1fg655nh68xyz9****

EnableIpv6

boolean

No

Specifies whether to create an IPv6 mount target.

Valid values:

  • true: creates an IPv6 mount target.

  • false (default): does not create an IPv6 mount target.

Note

IPv6 is supported only by Extreme NAS file systems in all regions in the Chinese mainland. The file system must have IPv6 enabled.

true

DryRun

boolean

No

Specifies whether to check for existing mount targets. Only CPFS file systems are supported.

A dry run checks parameter validity and inventory without actually creating a mount target or incurring fees.

  • true: sends a dry run request without creating a mount target. The check items include required parameters, request format, business limits, and CPFS inventory. If the check fails, the corresponding error is returned. If the check passes, 200 HttpCode is returned, but MountTargetDomain is empty.

  • false (default): sends a normal request. After the check passes, a mount target is created.

false

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

MountTargetDomain

string

The IPv4 mount target.

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

MountTargetExtra

object

The mount target information.

DualStackMountTargetDomain

string

The dual-stack mount target that supports both IPv4 and IPv6.

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.