Help Center/ ModelArts/ SDK Reference/ Managing the Lifecycle of Lite Servers/ Mounting a Disk to a Lite Server (Supported Only for Snt9b23)
Updated on 2026-04-03 GMT+08:00

Mounting a Disk to a Lite Server (Supported Only for Snt9b23)

Example Code

In ModelArts Notebook, you do not need to enter authentication parameters for session authentication. For details about session authentication of other development environments, see Session Authentication.

from modelarts.server_mgmt import ServerManagement
from modelarts.session import Session
from modelarts.servers.server_def import Volume

volume = Volume(volume_id="b0e1f17b-019c-43d3-99f7-5e1703c1e9b7")
ServerManagement.attach_volume(session = Session(), server_id = "server_id", volume = volume)     #Enter server_id.

Parameters

Table 1 URI parameters

Parameter

Mandatory

Type

Description

server_id

Yes

String

Lite Server ID.

session

Yes

Class

Manage the interaction with Lite Servers. The project ID is provided.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

volume_id

Yes

String

ID of the attached disk.

Table 3 ServerResponse

Parameter

Type

Description

operation_id

String

Operation ID.

operation_status

String

Operating status.

operation_type

String

Operation type.