CreateInstance 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 ID of the workspace. To obtain the workspace ID, 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 a list of available instance types, see ListEcsSpecs. |
ecs.c6.large |
| ImageId |
string |
No |
The ID of the image. For a list of available images, see ListImages. |
image-05cefd0be2exxxx |
| ImageUrl |
string |
No |
The URL of the image. Call the ListImages operation to obtain the URL. |
registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu |
| Datasets |
array<object> |
No |
The datasets to mount to the instance. |
|
|
object |
No |
A dataset. |
||
| DatasetId |
string |
No |
The ID of the dataset. If a dataset is read-only, you cannot use the To obtain the dataset ID, see ListDatasets. This parameter is mutually exclusive with |
d-vsqjvs****rp5l206u |
| DatasetVersion |
string |
No |
The version of the dataset. You must also specify the |
v1 |
| Uri |
string |
No |
The URI of the storage service directory for direct mounting. This parameter is mutually exclusive with The following list describes the URI formats for different storage types:
|
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/write permissions for the mounted dataset. If the source dataset is read-only, you cannot grant read/write permissions. Valid values:
|
RW |
| Options |
string |
No |
Specifies custom mount properties. This parameter is supported for OSS datasets only. This parameter is mutually exclusive with |
{ "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. This parameter is deprecated and mutually exclusive with |
ReadOnly |
| Dynamic |
boolean |
No |
Specifies whether to enable dynamic mounting. Default value: false.
|
true |
| UserVpc |
object |
No |
The user VPC configurations. |
|
| VpcId |
string |
No |
The VPC ID. |
vpc-xxxxx |
| VSwitchId |
string |
No |
The vSwitch ID. |
vsw-xxxxx |
| SecurityGroupId |
string |
No |
The ID of the security group. |
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 configurations. |
|
| ForwardInfo |
No |
A port forwarding configuration. You can configure parameters such as the mapped port, gateway ID, and SSH public key. |
||
| BandwidthLimit |
BandwidthLimit |
No |
||
| Accessibility |
string |
No |
The visibility of the instance. Valid values:
|
PRIVATE |
| EnvironmentVariables |
object |
No |
The environment variables to inject into the DSW instance. Warning These variables may overwrite preset system environment variables. |
{userName: "Chris"} |
|
string |
No |
A user-defined environment variable. After the DSW instance starts, the system injects this variable into the container. |
MAAS |
|
| ResourceId |
string |
No |
The ID of the resource group. This parameter is required for subscription instances. To learn how to create a dedicated resource group, see Prepare and manage DLC resource groups. |
dsw-123456789 |
| Priority |
integer |
No |
The priority of the instance for resource allocation. Instances with higher priorities are given precedence. Valid values: 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. Unit: GiB. Important You must specify a unit, such as 32Gi. If you omit the unit, the system defaults to MiB.
|
32GB |
| SharedMemory |
string |
No |
The shared memory size. Unit: GiB. Important You must specify a unit, such as 32Gi. If you omit the unit, the system defaults to MiB.
|
32GB |
| GPU |
string |
No |
The number of GPUs. |
4 |
| GPUType |
string |
No |
The GPU type. Valid values:
|
v100 |
| Labels |
array<object> |
No |
The list of custom tags. |
{'foo': 'bar'} |
|
object |
No |
A custom tag. |
||
| Key |
string |
No |
The key of the custom tag. |
stsTokenOwner |
| Value |
string |
No |
The value of the custom tag. |
123xxxxxxxx |
| CloudDisks |
array<object> |
No |
The list of cloud disks. |
[] |
|
array<object> |
No |
A cloud disk. |
||
| Capacity |
string |
No |
If you use public resources or subscription general-purpose computing resources (with at least 2 CPU cores and 4 GiB of memory, or with a GPU): Each instance comes with a complimentary 100 GiB system disk for persistent storage. If the instance is stopped for more than 15 days, data on the cloud disk is deleted. You can expand the cloud disk capacity. For pricing details, see the page in the console. Warning
If you require permanent storage, you can configure dataset mounting or add an OSS, NAS, or CPFS path in the storage path mounting settings. |
100Gi |
| SubType |
string |
No |
The type of the cloud disk:
|
rootfs |
| MountPath |
string |
No |
The mount path of the cloud disk. |
/mnt/systemDisk |
| Path |
string |
No |
The subpath on the cloud disk to mount to the instance. |
workspace |
| Status |
object |
No |
The usage status of the cloud 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 specify one of the following:
If this parameter is left empty:
|
rootfsCloudDisk |
| UserId |
string |
No |
The account ID of the instance owner. This can be an Alibaba Cloud account ID or a RAM user ID. |
161228528250**** |
| Driver |
string |
No |
The NVIDIA driver configuration. |
535.54.03 |
| CredentialConfig | CredentialConfig |
No |
The credential configuration. |
|
| Affinity |
object |
No |
The affinity configuration. |
|
| CPU |
object |
No |
The CPU affinity configuration. This feature is supported only for subscription instances that use general-purpose computing resources. |
|
| Enable |
boolean |
No |
Specifies whether to enable CPU affinity.
|
true |
| ImageAuth |
string |
No |
The Base64-encoded username and password for a private image. The password is hidden in the response. |
**** |
| DynamicMount | DynamicMount |
No |
The dynamic mounting 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 |
A custom command that runs every time the instance starts. The system executes the command after initializing the instance environment and before services such as JupyterLab and Code-Server start. |
|
| Content |
string |
No |
The content of the custom startup command. |
|
| OversoldType |
string |
No |
The type of the preemptible resource. Valid values: |
|
| AssignNodeSpec |
object |
No |
The node scheduling configuration. |
|
| NodeNames |
string |
No |
A comma-separated list of node names to schedule the instance on. Example: "node-a,node-b". |
node-a |
| AntiAffinityNodeNames |
string |
No |
A comma-separated list of nodes where the instance should not be scheduled. Example: "node-a,node-b". |
node-b |
| SpotSpec |
object |
No |
The configurations for the spot instance. |
|
| SpotStrategy |
string |
No |
The preemption strategy. Valid values: |
SpotWithPriceLimit |
| SpotPriceLimit |
string |
No |
The maximum hourly price for the spot instance, with up to three decimal places. This parameter is required if |
0.12 |
| SpotDuration |
string |
No |
The protection period of the spot instance, in hours. The default value is |
0 |
| SpotDiscountLimit |
string |
No |
The maximum hourly discount for the spot instance. This parameter is required for Lingjun instances. |
0.1 |
| DockerConfig |
object |
No |
||
| Enable |
boolean |
No |
||
| ContainersLimit |
integer |
No |
10 |
|
| MountAccessConfigPath |
string |
No |
||
| MigrationOptions |
object |
No |
||
| AccessRestrictionRules |
object |
No |
||
|
string |
No |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| RequestId |
string |
The request ID. |
E7D55162-4489-1619-AAF5-3F97D5FCA948 |
| Success |
boolean |
Indicates whether the request was successful. Possible values:
|
true |
| Message |
string |
The response message. |
"XXX" |
| Code |
string |
The status code. Possible values:
|
null |
| HttpStatusCode |
integer |
The HTTP status code. Possible 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.