• SAP HANA

saphana
  1. Help Center
  2. SAP HANA
  3. User Guide (API)
  4. Creating a HANA ECS
  5. Creating a HANA ECS
  6. Attaching Data Disks Including Shared Disks

Attaching Data Disks Including Shared Disks

Attach the data volumes you obtained before creating an ECS to the ECS. For instructions about how to create an EVS disk as a data disk, see section Creating an EVS Disk as a Data Disk.

API Format

Method

URI

Description

POST

/v2/{tenant_id}/servers/{server_id}/os-volume_attachments

To attach disks to ECSs

Restrictions

A disk cannot be attached to an ECS if the OS-EXT-STS:vm_state attribute of the ECS is in SUSPENDED or PAUSED state.

The disk to be attached to an ECS must be available.

In public cloud scenarios, the disk to be attached and the ECS must be in the same cascaded OpenStack system.

Expansion

None

Request Parameters

Parameter

Type

Mandatory or Not

Description

volumeAttachment

Dict

Yes

Specifies the related information of the disk to be attached.

[1] volumeAttachment parameters

Parameter

Type

Mandatory or Not

Description

volumeId

UUID

Yes

Indicates the ID of the disk to be attached.

device

String

Yes

Indicates the name of the device to which the disk will be attached. This parameter must comply with the regular expression /dev/x{0,1}[a-z]{0,1}d{0,1})([a-z]+)[0-9]*.

The range of the disk letter in the SAP HANA cluster provisioning is /dev/sda/dev/sdb, and /dev/sdc. Follow the same rule in other scenarios. Ensure that the HANA ECS where a disk is to be attached has no other disks attached.

Response Parameters

Parameter

Type

Mandatory or Not

Description

device

String

Yes

Specifies the device name.

serverId

UUID

Yes

Specifies the ECS to which the disk is to be attached.

id

String

No

Specifies the UUID of the disk.

volumeId

String

No

Specifies the attaching ID, which is the same as the UUID.

Request Example

POST /v2/6fbe9263116a4b68818cf1edce16bc4f/servers/ab258e25-e351-47c7-b6e3-0749c5d9ed6a/os-volume_attachments 
{ 
   "volumeAttachment":{
     "volumeId":"54667652-3029-4af8-9222-2d53066fd61c",
     "device":"/dev/sdb"
   }
}

Response Example

{ 
   "volumeAttachment": {
        "device": "/dev/vdb",
        "serverId": "ab258e25-e351-47c7-b6e3-0749c5d9ed6a",
        "id": "54667652-3029-4af8-9222-2d53066fd61c",
        "volumeId": "54667652-3029-4af8-9222-2d53066fd61c"
   }
}