Creates a DSW instance.
Try it now
Test
RAM authorization
Request syntax
POST /api/v2/instances HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The properties of the instance. |
|
| WorkspaceId |
string |
No |
The workspace ID. For more information, see ListWorkspaces. |
40823 |
| InstanceName |
string |
No |
The instance name. The name must meet the following requirements:
|
training_data |
| EcsSpec |
string |
No |
The ECS instance type. For more information, see ListEcsSpecs. |
ecs.c6.large |
| ImageId |
string |
No |
The image ID. For more information, see ListImages. |
image-05cefd0be2exxxx |
| ImageUrl |
string |
No |
The image URL. For more information, see ListImages. |
registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu |
| Datasets |
array<object> |
No |
The list of datasets. |
|
|
object |
No |
A dataset. |
||
| DatasetId |
string |
No |
The dataset ID. If a dataset is read-only, you cannot use MountAccess to change its permissions to read/write. For more information, see ListDatasets. This parameter is mutually exclusive with the Uri parameter. |
d-vsqjvs****rp5l206u |
| DatasetVersion |
string |
No |
The version of the dataset. You must also specify DatasetId. If you leave this parameter empty, the default value is v1. |
v1 |
| Uri |
string |
No |
The URI of the storage service directory for direct mounting. This parameter is mutually exclusive with the DatasetId parameter. The URI formats for different storage types are as follows:
|
oss://bucket-name.oss-cn-shanghai-internal.aliyuncs.com/data/path/ |
| MountPath |
string |
No |
The mount path of the dataset. |
/mnt/data |
| MountAccess |
string |
No |
The read and write permissions on the mounted dataset. If the dataset is read-only, you cannot change the permissions to read/write. Valid values:
|
RW |
| Options |
string |
No |
Custom mount properties. Currently, only OSS is supported. You cannot specify OptionType when you use this parameter. For more information, see DSW mount configurations. |
{ "fs.oss.download.thread.concurrency": "10", "fs.oss.upload.thread.concurrency": "10", "fs.jindo.args": "-oattr_timeout=3 -oentry_timeout=0 -onegative_timeout=0 -oauto_cache -ono_symlink" } |
OptionType
deprecated
|
string |
No |
The mount type. You cannot specify Options when you use this parameter. This parameter is deprecated. We recommend that you use the Options parameter instead. |
ReadOnly |
| Dynamic |
boolean |
No |
Specifies whether to enable dynamic mounting. The default value is false.
|
true |
| UserVpc |
object |
No |
The UserVpc configuration. |
|
| VpcId |
string |
No |
The VPC ID. |
vpc-xxxxx |
| VSwitchId |
string |
No |
The vSwitch ID. |
vsw-xxxxx |
| SecurityGroupId |
string |
No |
The security group ID. |
sg-xxxxxx |
| ExtendedCIDRs |
array |
No |
The extended CIDR blocks.
|
["192.168.0.1/24", "192.168.1.1/24"] |
|
string |
No |
An extended CIDR block. |
"172.16.19.0/24","172.16.2.0/24","172.16.12.0/24" |
|
| DefaultRoute |
string |
No |
The default route. Valid values:
|
eth0 |
| ForwardInfos |
array |
No |
The port forwarding information. |
|
| ForwardInfo |
No |
A list of port forwarding information. You can configure parameters such as the mapped port, gateway ID, and Secure Shell (SSH) public key. |
||
| BandwidthLimit |
BandwidthLimit |
No |
||
| Accessibility |
string |
No |
The visibility of the instance. Valid values:
|
PRIVATE |
| EnvironmentVariables |
object |
No |
The environment variables to be injected into the DSW instance. Warning The environment variables that you specify here may overwrite the preset system environment variables. |
{userName: "Chris"} |
|
string |
No |
The user-defined environment variables. After the DSW instance starts, the specified environment variables are injected into the container. |
MAAS |
|
| ResourceId |
string |
No |
The resource group ID. This parameter is configured for subscription instances. For more information, see Prepare and manage a DLC resource group cluster. |
dsw-123456789 |
| Priority |
integer |
No |
The priority. When resources are allocated to instances, instances with higher priorities are given precedence. The value must be an integer from 1 to 9.
|
1 |
| RequestedResource |
object |
No |
The resource configuration. |
{"CPU":"4","Memory":"8Gi","SharedMemory":"4Gi","GPU":"1","GPUType":"Tesla-V100-16G"} |
| CPU |
string |
No |
The number of CPU cores. |
32 |
| Memory |
string |
No |
The memory size, in GiB. Important When you pass this parameter, specify the unit. For example, enter 8Gi instead of 8. If you do not specify a unit, MiB is used by default.
|
32GB |
| SharedMemory |
string |
No |
The shared memory size, in GiB. Important When you pass this parameter, specify the unit. For example, enter 4Gi instead of 4. If you do not specify a unit, MiB is used by default.
|
32GB |
| GPU |
string |
No |
The number of GPUs. |
4 |
| GPUType |
string |
No |
The GPU card type. Valid values:
|
v100 |
| Labels |
array<object> |
No |
The custom labels. |
{'foo': 'bar'} |
|
object |
No |
A custom label. |
||
| Key |
string |
No |
The key of the custom label. |
stsTokenOwner |
| Value |
string |
No |
The value of the custom label. |
123xxxxxxxx |
| CloudDisks |
array<object> |
No |
The list of disks. |
[] |
|
array<object> |
No |
A list of disks. |
||
| Capacity |
string |
No |
If you set Resource Type to Public Resources, or if you select a subscription general computing resource quota (with at least 2 CPU cores and 4 GB of memory, or with a GPU): Each instance is provided with a 100 GiB system disk for free for persistent storage. If the instance is stopped for more than 15 days, the content on the disk is deleted. You can scale out the disk. The pricing for the scale-out is subject to the information on the console page. Warning
For persistent storage, configure dataset mounting or add an OSS, NAS, or CPFS path for storage path mounting. |
100Gi |
| SubType |
string |
No |
The disk type:
|
rootfs |
| MountPath |
string |
No |
The mount path of the disk. |
/mnt/systemDisk |
| Path |
string |
No |
The subpath of the disk that is mounted to the instance. |
workspace |
| Status |
object |
No |
The usage of the disk or snapshot. |
|
| Available |
integer |
No |
The available space in bytes. |
31841058816 |
| Usage |
integer |
No |
The used space in bytes. |
371195904 |
| Capacity |
integer |
No |
The total capacity in bytes. |
32212254720 |
| WorkspaceSource |
string |
No |
Specifies the storage for the working directory. You can mount a disk or a dataset from Datasets to the /mnt/workspace working directory. OSS datasets and dynamically mounted datasets are not supported. Specify one of the following values:
If this parameter is empty:
|
rootfsCloudDisk |
| UserId |
string |
No |
The ID of the account that owns the instance. The account can be an Alibaba Cloud account or a RAM user. |
161228528250**** |
| Driver |
string |
No |
The NVIDIA driver configuration. |
535.54.03 |
| CredentialConfig | CredentialConfig |
No |
The credential configuration. |
|
| Affinity |
object |
No |
The affinity configuration information. |
|
| CPU |
object |
No |
The CPU affinity configuration information. This feature is supported only for subscription instances that use general computing resources. |
|
| Enable |
boolean |
No |
Specifies whether to enable CPU affinity.
|
true |
| ImageAuth |
string |
No |
The username and password information for the user's private image, which is Base64-encoded. The password is hidden. |
**** |
| DynamicMount | DynamicMount |
No |
The dynamic mount configuration. |
|
| Tag |
array<object> |
No |
The list of tags. |
|
|
object |
No |
A tag. |
||
| Key |
string |
No |
The key of the tag. |
tag1 |
| Value |
string |
No |
The value of the tag. |
value1 |
| UserCommand |
object |
No |
The user-defined commands. |
|
| OnStart |
object |
No |
The custom command that is executed every time the instance starts. The command is executed after the instance environment is initialized and before services such as jupyter-lab and code-server start. |
|
| Content |
string |
No |
The content of the custom startup command. |
|
| OversoldType |
string |
No |
The type of preemptible resources. Valid values: `ForceQuotaOverSold`: Use only preemptible resources. `AcceptQuotaOverSold`: Accept preemptible resources. `ForbiddenQuotaOverSold`: Use guaranteed resources. |
|
| AssignNodeSpec |
object |
No |
The node scheduling configuration. |
|
| NodeNames |
string |
No |
The nodes to which the instance is scheduled. Example: "node-a,node-b". |
node-a |
| AntiAffinityNodeNames |
string |
No |
The nodes that are excluded from scheduling. Example: "node-a,node-b". |
node-b |
| SpotSpec |
object |
No |
The configuration of the spot instance. |
|
| SpotStrategy |
string |
No |
The preemption strategy. Valid values: `SpotWithPriceLimit`: Set a custom maximum hourly price for the spot instance. `SpotAsPriceGo`: The system automatically bids based on the real-time market price. |
SpotWithPriceLimit |
| SpotPriceLimit |
string |
No |
The maximum hourly price for the spot instance. The value can be accurate to three decimal places. This parameter is required when SpotStrategy is set to SpotWithPriceLimit. |
0.12 |
| SpotDuration |
string |
No |
The protection period of the spot instance. The default value is 1. You can set the value to 0 to indicate that no protection period is provided. This parameter is not valid for Lingjun specifications. |
0 |
| SpotDiscountLimit |
string |
No |
The maximum hourly discount for the spot instance. This parameter is required for Lingjun specifications. |
0.1 |
| MigrationOptions |
object |
No |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The result of the operation. |
||
| RequestId |
string |
The request ID. |
E7D55162-4489-1619-AAF5-3F97D5FCA948 |
| Success |
boolean |
Indicates whether the request was successful. Valid values:
|
true |
| Message |
string |
The description of the returned result. |
"XXX" |
| Code |
string |
The status code. Valid values:
|
null |
| HttpStatusCode |
integer |
The HTTP status code. Valid values:
|
200 |
| InstanceId |
string |
The instance ID. |
dsw-730xxxxxxxxxx |
Examples
Success response
JSON format
{
"RequestId": "E7D55162-4489-1619-AAF5-3F97D5FCA948",
"Success": true,
"Message": "\"XXX\"",
"Code": "null",
"HttpStatusCode": 200,
"InstanceId": "dsw-730xxxxxxxxxx"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.