All Products
Search
Document Center

Apsara File Storage NAS:CreateMountTarget

Last Updated:Mar 14, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
FileSystemIdstringYes

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-, for example, extreme-0015****.
  • The IDs of Cloud Parallel File Storage (CPFS) file systems must start with cpfs-, for example, cpfs-125487****.
Note CPFS file systems are available only on the China site (aliyun.com).
174494****
AccessGroupNamestringNo

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
NetworkTypestringYes

The network type of the mount target. Valid value: Vpc.

Vpc
VpcIdstringNo

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

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

The ID of the security group.

sg-bp1fg655nh68xyz9****
EnableIpv6booleanNo

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): 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.
true
DryRunbooleanNo

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.

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

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

The IPv4 domain name of the mount target.

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

The information about the mount target.

DualStackMountTargetDomainstring

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

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

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
202RequestAcceptedThe request has been accepted by the server.The request has been accepted by the server.
400InvalidFileSystem.NotsupportedIPv6The file system does not support IPv6.The file system does not support IPv6.
400InvalidVSwitch.Ipv6NotTurnOnThe 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.
400IdempotentParameterMismatchThe same client token was passed in to different parameters.The same client token was passed in to different parameters.
400MissingParameter.AccessGroupNameYou 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.
400InvalidVSwitchId.IpNotEnoughThe number of the specified VSwitch IP address is insufficient.The available IP addresses within the CIDR block of the specified vSwitch are insufficient.
400InvalidParameter.ConflictVpcCidrThe specified VPC CIDR conflicts with the server.The specified VPC CIDR conflicts with the server.
400DryRunOperationThe request is validated with DryRun flag set.The request is validated with DryRun flag set.
400SubAccount.NoStandardSLRPermissionThe 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.
403OperationDenied.InvalidStateThe operation is not permitted when the status is processing.The operation is not permitted when the status is processing.
403InvalidRamRole.NotExistThe specified RAM role does not exist.The specified RAM role does not exist.
403InvalidRamRole.NoPermissionThe specified RAM role does not have sufficient permission.The specified RAM role does not have sufficient permission.
403InvalidMountTarget.AlreadyExistedThe specified mount target already exists.The specified mount target already exists.
403Resource.OutOfStockThe inventory of the specified zone is insufficient.The inventory of the specified zone is insufficient.
403OperationDenied.MountTargetExceedLimitThe 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.
404InvalidParameter.VswNotFoundThe specified VSwitch does not exist.The specified vSwitch does not exist.
404InvalidParameter.VpcNotFoundThe specified VPC does not exist.The specified VPC does not exist.
404InvalidFileSystem.NotFoundThe specified file system does not exist.The specified file system does not exist.

For a list of error codes, visit the Service error codes.