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 instance properties. |
|
| AccessRestrictionRules |
object |
No |
The instance access restriction rules. |
|
|
string |
No |
The configuration values for the instance access restriction rules. |
PAI.AlgoOperator,PAI.AlgoDeveloper,PAI.LabelManager,PAI.WorkspaceGuest,PAI.MaxComputeDeveloper |
|
| Accessibility |
string |
No |
The visibility of the instance. Valid values:
|
PRIVATE |
| Affinity |
object |
No |
The affinity configuration information. |
|
| CPU |
object |
No |
The CPU affinity configuration information. Only general-purpose subscription instances are supported. |
|
| Enable |
boolean |
No |
Specifies whether to enable CPU affinity. Valid values:
|
true |
| AssignNodeSpec |
object |
No |
The specified node scheduling configuration. |
|
| AntiAffinityNodeNames |
string |
No |
The nodes excluded from scheduling, such as node-a,node-b. |
node-b |
| NodeNames |
string |
No |
The specified nodes for scheduling, such as node-a,node-b. |
node-a |
| CloudDisks |
array<object> |
No |
The list of cloud disks. |
[] |
|
array<object> |
No |
The list of cloud disks. |
||
| Capacity |
string |
No |
When Resource Type is set to Public Resources, or when Resource Quota is set to upfront general-purpose compute resources (with at least 2 CPU cores and 4 GB of memory, or configured with a GPU): Each instance includes a free 100 GiB system cloud disk quota for persistent storage. If the instance remains stopped for more than 15 days, the data on the cloud disk is cleared. You can expand the capacity of the cloud disk. For pricing details, refer to the console interface. Warning
For permanent storage, configure Dataset Mounting or add OSS, NAS, or CPFS paths in Storage Path Mounting. |
100Gi |
| MountPath |
string |
No |
The mount path of the cloud disk. |
/mnt/systemDisk |
| Path |
string |
No |
The subpath of the cloud disk mounted to the instance. |
workspace |
| Status |
object |
No |
The usage status of the cloud disk or snapshot. |
|
| Available |
integer |
No |
The available capacity, in bytes. |
31841058816 |
| Capacity |
integer |
No |
The total capacity, in bytes. |
32212254720 |
| Usage |
integer |
No |
The used capacity, in bytes. |
371195904 |
| SubType |
string |
No |
The cloud disk type. Valid values:
|
rootfs |
| CredentialConfig | CredentialConfig |
No |
The credential configuration. |
|
| Datasets |
array<object> |
No |
The list of datasets. |
|
|
object |
No |
The dataset. |
||
| AccessPointId |
string |
No |
The access point ID of BMCPFS (CPFS for AI). This is used for fine-grained access control based on access points. It must be specified together with RoleArn and takes effect only on Lingjun resources. |
ap-bp15victorick1132***** |
| DatasetId |
string |
No |
The dataset ID. If the dataset is read-only, you cannot change it to read/write by using MountAccess. For information about how to obtain the dataset ID, see ListDatasets. You cannot specify both DatasetId and Uri. |
d-vsqjvs****rp5l206u |
| DatasetVersion |
string |
No |
The dataset version. DatasetId must be specified at the same time. If you do not specify this parameter, the default value is v1. |
v1 |
| Dynamic |
boolean |
No |
Specifies whether dynamic mounting is enabled. Default value: false.
|
true |
| EnableCache |
boolean |
No |
Specifies whether to enable local cache acceleration for the dataset. If this parameter is not passed or is set to false, the feature is disabled. If it is set to true, the feature is enabled. This parameter takes effect only when the resource to which the instance belongs is connected to the cache service. |
true |
| MountAccess |
string |
No |
The read and write permission after the dataset is mounted. If the dataset is read-only, you cannot change the permission to read and write. Valid values:
|
RW |
| MountPath |
string |
No |
The mount path of the dataset. |
/mnt/data |
OptionType
deprecated
|
string |
No |
[Deprecated] The mount type. You cannot specify Options at the same time. This parameter is deprecated. We recommend that you use the Options parameter instead. |
ReadOnly |
| Options |
string |
No |
The custom mount attributes. Currently, only OSS is supported. You cannot specify OptionType at the same time. 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" } |
| RoleArn |
string |
No |
The ARN of the RAM role used for dataset mounting. For OSS datasets, it is used for fine-grained access control. For BMCPFS (CPFS for AI), it is required when AccessPointId is specified for mounting. |
acs:ram::1234567890123456:role/aliyunossmountrole |
| Uri |
string |
No |
The URI of the storage service directory for direct mounting. This field is mutually exclusive with DatasetId. For the URI formats of different storage types, see the following examples:
|
oss://bucket-name.oss-cn-shanghai-internal.aliyuncs.com/data/path/ |
| DockerConfig |
object |
No |
The Docker configuration of the instance. |
|
| ContainersLimit |
integer |
No |
The maximum number of subcontainers in the instance. |
10 |
| Enable |
boolean |
No |
Specifies whether to start Docker in the instance. |
|
| MountAccessConfigPath |
string |
No |
The path where the mount permission configuration for secondary containers is located. |
/etc/dsw/mount-access.json |
| Driver |
string |
No |
The NVIDIA driver configuration. |
535.54.03 |
| DynamicMount | DynamicMount |
No |
The dynamic mounting configuration. |
|
| EcsSpec |
string |
No |
The ECS instance type of the instance. For information about how to obtain ECS instance types, see ListEcsSpecs. |
ecs.c6.large |
| EnvironmentVariables |
object |
No |
The environment variables injected into the DSW instance. Warning The environment variables passed here may override the system preset environment variables. |
{"userName":"Chris"} |
|
string |
No |
The user-specified environment variables. After the DSW instance starts, the specified environment variables are injected into the container. |
MAAS |
|
| ImageAuth |
string |
No |
The value after Base64 encoding of the account and password information for the user's private image. The password part is hidden. |
ZXhhbXBsZS11c2VyOkV4YW1wbGVQYXNzd29yZDEyMw== |
| ImageId |
string |
No |
The image ID. For information about how to obtain the image ID, see ListImages. |
image-05cefd0be2exxxx |
| ImageUrl |
string |
No |
The image URL. For information about how to obtain the image URL, see ListImages. |
registry.cn-shanghai.aliyuncs.com/pai_product/tensorflow:py36_cpu_tf1.12_ubuntu |
| InstanceName |
string |
No |
The instance name. Format requirements:
|
training_data |
Labels
deprecated
|
array<object> |
No |
The custom labels. |
{'foo': 'bar'} |
|
object |
No |
The custom label. |
||
| Key |
string |
No |
The key of the custom label. |
stsTokenOwner |
| Value |
string |
No |
The value of the custom label. |
123xxxxxxxx |
| MigrationOptions |
object |
No |
The instance migration options. This parameter is supported only for Lingjun instances with persistent storage enabled. Supported options:
|
{"EnableProcessesPreservation":true} |
| OversoldType |
string |
No |
The type of oversold resources. Valid values:
|
ForceQuotaOverSold |
| Priority |
integer |
No |
The priority of the instance. When resources are allocated to instances, instances with higher priorities are allocated first. 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 |
| GPU |
string |
No |
The number of GPUs. |
4 |
| GPUType |
string |
No |
The GPU type. Valid values:
|
v100 |
| Memory |
string |
No |
The memory size. Unit: GB. Important Specify the unit when you pass this parameter, such as 32GB, instead of 32.
If you do not specify the unit, the default unit is MB.
|
32GB |
| SharedMemory |
string |
No |
The shared memory size. Unit: GB. Important Specify the unit when you pass this parameter, such as 32GB, instead of 32.
If you do not specify the unit, the default unit is MB.
|
32GB |
| ResourceId |
string |
No |
The resource group ID. Configure this parameter for subscription resources. For information about how to create a dedicated resource group, see Prepare and manage DLC resource group clusters. |
dsw-123456789 |
| SpotSpec |
object |
No |
The spot instance configuration. |
|
| SpotDiscountLimit |
string |
No |
The maximum hourly discount for spot instances. This parameter is required for Lingjun instance types. |
0.1 |
| SpotDuration |
string |
No |
The protection period of the spot instance. Default value: 1. You can set this parameter to 0 to specify no protection period. This parameter does not take effect for Lingjun instance types. |
0 |
| SpotPriceLimit |
string |
No |
The maximum hourly price for the spot instance. The price is accurate to three decimal places. This parameter is required when the spot strategy is set to SpotWithPriceLimit. |
0.12 |
| SpotStrategy |
string |
No |
The spot strategy. Valid values:
|
SpotWithPriceLimit |
| Tag |
array<object> |
No |
The list of tags. |
|
|
object |
No |
The tag. |
||
| Key |
string |
No |
The key of the tag. |
tag1 |
| Value |
string |
No |
The value of the tag. |
value1 |
| UserCommand |
object |
No |
The custom execution commands. |
|
| OnStart |
object |
No |
The custom commands that are executed each time the instance starts. The commands are 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 commands. |
echo hello |
| UserId |
string |
No |
The ID of the account that owns the instance. Alibaba Cloud accounts and Resource Access Management (RAM) users are supported. |
161228528250**** |
| UserMetricsEndpoints |
array |
No |
The list of custom metrics collection endpoints. |
|
| UserMetricsEndpoint |
No |
The custom metrics collection endpoint, including the collection path and port. |
||
| UserVpc |
object |
No |
The user VPC configuration. |
|
| BandwidthLimit | BandwidthLimit |
No |
The Internet bandwidth throttling configuration. |
|
| DefaultRoute |
string |
No |
The default routing. Valid values:
|
eth0 |
| ExtendedCIDRs |
array |
No |
The extended CIDR blocks.
|
["192.168.0.1/24", "192.168.1.1/24"] |
|
string |
No |
The extended CIDR block. |
"172.16.19.0/24","172.16.2.0/24","172.16.12.0/24" |
|
| ForwardInfos |
array |
No |
The port forwarding information. |
|
| ForwardInfo |
No |
The port forwarding information list. You can configure parameters such as the mapped port, gateway ID, and SSH public key. |
||
| SecurityGroupId |
string |
No |
The security group ID. |
sg-xxxxxx |
| VSwitchId |
string |
No |
The vSwitch ID. |
vsw-xxxxx |
| VpcId |
string |
No |
The VPC ID. |
vpc-xxxxx |
| WorkspaceId |
string |
No |
The workspace ID. For information about how to obtain the workspace ID, see ListWorkspaces. |
40823 |
| WorkspaceSource |
string |
No |
The storage that corresponds to the working directory. You can mount cloud disks or datasets in Datasets to the /mnt/workspace working directory at the same time. OSS datasets and dynamically mounted datasets are not supported. Valid values:
If this parameter is left empty:
|
rootfsCloudDisk |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The execution result. |
||
| Code |
string |
The status code. Valid values:
|
null |
| HttpStatusCode |
integer |
The HTTP status code. Valid values:
|
200 |
| InstanceId |
string |
The instance ID. |
dsw-730xxxxxxxxxx |
| Message |
string |
The description of the returned result. |
"XXX" |
| RequestId |
string |
The request ID. |
E7D55162-4489-1619-AAF5-3F97D5FCA948 |
| Success |
boolean |
The success flag. Valid values:
|
true |
Examples
Success response
JSON format
{
"Code": "null",
"HttpStatusCode": 200,
"InstanceId": "dsw-730xxxxxxxxxx",
"Message": "\"XXX\"",
"RequestId": "E7D55162-4489-1619-AAF5-3F97D5FCA948",
"Success": true
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.