CreateMountTarget

更新时间:
复制 MD 格式

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

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

File system ID.

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

  • Extreme NAS: Must start with extreme-, for example, extreme-0015****.

  • CPFS: Must start with cpfs-, for example, cpfs-125487****.

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 :

    VPC

  • vpc :

    VPC

  • VPC :

    VPC

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:

  • true: Create

  • false (default): Do not create

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.

  • true: Sends a dry run request without creating a mount target. The checks include whether required parameters are specified, 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 directly created.

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.