UpdateInstance
Updates the attributes of a DSW instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
paidsw:UpdatePostPaidInstance |
update |
*All Resource
|
None | None |
Request syntax
PUT /api/v2/instances/{InstanceId} HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The instance ID. For information about how to obtain the instance ID, see ListInstances. |
dsw-730xxxxxxxxxx |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The instance attributes to update. |
|
| Accessibility |
string |
No |
The visibility of the instance. Valid values:
|
PRIVATE |
| Affinity |
object |
No |
The affinity configuration. |
|
| CPU |
object |
No |
The CPU affinity configuration. This parameter is supported only for subscription general-purpose computing instances. |
|
| Enable |
boolean |
No |
Specifies whether to enable CPU affinity. Valid values:
|
true |
| AssignNodeSpec |
object |
No |
The node scheduling configuration. |
|
| AntiAffinityNodeNames |
string |
No |
The nodes to exclude from scheduling. Example: "node-a,node-b". |
node-b |
| NodeNames |
string |
No |
The nodes specified for scheduling. Example: "node-a,node-b". |
node-a |
| CloudDisks |
array<object> |
No |
The list of cloud disks. |
[] |
|
object |
No |
|||
| Capacity |
string |
No |
When Resource Type is set to Public Resources, or Resource Quota is set to upfront general compute resources (with 2 or more CPU cores and 4 GB or more memory, or configured with a GPU): Each instance is provided with a free 100 GiB system cloud disk quota for persistent storage. If the instance is stopped for more than 15 days, the data on the cloud disk is cleared. You can expand the capacity of the cloud disk. For the pricing of capacity expansion, refer to the console interface. Warning
If you need permanent storage, you can configure dataset mounting or add OSS, NAS, or CPFS paths in storage path mounting. |
100Gi |
| 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 object. |
||
| AccessPointId |
string |
No |
The access point ID of BMCPFS (CPFS for AI). This parameter is used for fine-grained access control based on access points. This parameter 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. This parameter must be specified together with DatasetId. If you do not specify this parameter, the default value is v1. |
v1 |
| Dynamic |
boolean |
No |
Specifies whether to enable dynamic mounting. Default value: false.
|
false |
| EnableCache |
boolean |
No |
Specifies whether to enable local cache acceleration for the dataset. If you do not specify this parameter or set it to false, local cache acceleration is disabled. If you set it to true, local cache acceleration is enabled. This parameter takes effect only when the resources to which the instance belongs are 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 |
The mount type. You cannot specify this parameter and Options at the same time. This parameter is deprecated and we recommend that you use the Options parameter instead. |
ReadOnly |
| Options |
string |
No |
The custom dataset mount property. This parameter supports only OSS. You cannot specify this parameter and 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 mounting the dataset. This parameter is used for fine-grained access control for OSS datasets. This parameter is required when you specify AccessPointId to mount a BMCPFS (CPFS for AI) dataset. |
acs:ram::1234567890123456:role/aliyunossmountrole |
| Uri |
string |
No |
The URI of the storage service directory for direct mounting. This parameter is mutually exclusive with DatasetId. For more information about the URI formats of different storage types, see the following examples:
|
oss://bucket-name.oss-cn-shanghai-internal.aliyuncs.com/data/path/ |
| DisassociateAssignNode |
boolean |
No |
Specifies whether to disable specified node scheduling. |
|
| DisassociateCredential |
boolean |
No |
Specifies whether to delete the credential injection information. |
false |
| DisassociateDatasets |
boolean |
No |
Specifies whether to delete the associated datasets. Valid values:
|
false |
| DisassociateDriver |
boolean |
No |
Specifies whether to delete the NVIDIA driver configuration. |
false |
| DisassociateEnvironmentVariables |
boolean |
No |
Deletes the environment variables specified by the user. |
false |
| DisassociateForwardInfos |
boolean |
No |
Specifies whether to delete the associated port forwarding information. |
false |
| DisassociateMigrationOptions |
boolean |
No |
Specifies whether to delete the migration options. |
|
| DisassociateSpot |
boolean |
No |
Specifies whether to disable the spot instance configuration. |
|
| DisassociateUserCommand |
boolean |
No |
Deletes the custom commands specified by the user. |
false |
| DisassociateVpc |
boolean |
No |
Specifies whether to delete the associated user VPC. |
false |
| 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 the ECS instance type, 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. |
{ "ENABLE_TRAIN": "true", "ENABLE_DEBUG":"false", "INSTANCE_ENV":"prod" } |
| ImageAuth |
string |
No |
The Base64 encoding of the username and password for the user's private image. The password 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 |
| 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 oversold resource type. |
ForceQuotaOverSold: Uses only off-peak resources AcceptQuotaOverSold: Accepts off-peak resources ForbiddenQuotaOverSold: Uses guaranteed resources |
| Priority |
integer |
No |
The priority. 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. |
v100 |
| Memory |
string |
No |
The memory size. Unit: GB. |
32 |
| SharedMemory |
string |
No |
The shared memory size. Unit: GB. |
32 |
| 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 |
| StartInstance |
boolean |
No |
Specifies whether to start the instance when the instance is updated. You can only start instances that are in the failed or stopped state. |
|
| UserCommand |
object |
No |
The custom execution commands specified by the user. |
|
| OnStart |
object |
No |
The custom command that is executed each 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. |
apt update && echo initialized |
| UserId |
string |
No |
The ID of the instance user. |
16122********** |
| UserMetricsEndpoints |
array |
No |
The list of custom metric collection endpoints specified by the user. Set this parameter to an empty array to clear the endpoints. |
|
| UserMetricsEndpoint |
No |
|||
| UserVpc |
object |
No |
The user VPC configuration. |
|
| BandwidthLimit | BandwidthLimit |
No |
||
| 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 mapping configuration of the instance. |
|
| ForwardInfo |
No |
The forward information. |
||
| 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 |
| WorkspaceSource |
string |
No |
The storage specified for 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:
|
/mnt/data |
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:
|
400 |
| 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": 400,
"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.