Help Center/ ModelArts/ SDK Reference/ Lite Server Lifecycle Management/ Mounting a Disk to a Lite Server (Supported Only by A3 Servers)
Updated on 2025-12-04 GMT+08:00

Mounting a Disk to a Lite Server (Supported Only by A3 Servers)

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 Server and provide project ID (project_id).

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

Operation status.

operation_type

String

Operation type.