All Products
Search
Document Center

E-MapReduce:CreateRayCluster

Last Updated:Sep 03, 2026

Creates a Ray cluster.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

emr-serverless-spark:CreateRayCluster

create

*All Resource

*

None None

Request syntax

POST /api/v1/workspaces/{workspaceId}/rayCluster HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

workspaceId

string

No

The workspace ID.

w-d2d82aa09155

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request struct.

name

string

No

The name of the Ray cluster. The name must be 1 to 64 characters in length.

testRayCluster

displayReleaseVersion

string

No

The Ray DPI engine version.

ray-1.0.0 (Ray 2.47.1, Python 3.12)

description

string

No

The description.

Ray Cluster for dev.

networkServiceName

string

No

The network connectivity name.

vpc

headSpec

object

No

The parameters of the Ray cluster head node.

queueName

string

No

The queue name.

root_queue

cpu

string

No

The number of CPU cores.

2

memory

string

No

The memory size. Unit: Gi.

8Gi

enableAutoScaling

boolean

No

Specifies whether to enable automatic scaling for workers.

false

idleTimeoutSeconds

integer

No

The idle timeout period of workers after automatic scaling is enabled.

60

gpuSpec

string

No

The GPU model.

ecs.gn6i-c4g1.xlarge

gftEnabled

boolean

No

Specifies whether to enable GCS Fault Tolerance.

gftConfig

object

No

The GCS Fault Tolerance configuration.

redisUrl

string

No

The Redis URL.

10.12.3.4:6379

redisUsername

string

No

The Redis username.

default

redisPassword

string

No

The Redis password.

redispasswd

env

string

No

The environment variables.

MY_ENV=hello\nMY_ENV2=hello2

rayStartParams

string

No

The Ray node startup parameters.

--num-cpus=0 --num-gpus=0

displayReleaseVersion

string

No

The Ray DPI engine version.

ray-1.2.0 (Ray 2.55.1, Python 3.12)

workerSpec

array<object>

No

The parameters of the Ray cluster worker nodes. A maximum of 50 groups are supported.

object

No

The worker node struct.

groupName

string

No

The worker group name.

WorkerGroup1

workerType

string

No

The worker type.

CPU

replica

integer

No

The number of workers. Minimum value: 1.

2

queueName

string

No

The queue name.

root_queue

cpu

string

No

The number of CPU cores.

4

memory

string

No

The memory size. Unit: Gi.

16Gi

minReplica

integer

No

The minimum number of workers after automatic scaling is enabled. Minimum value: 1. The value must be less than or equal to maxReplica.

1

maxReplica

integer

No

The maximum number of workers after automatic scaling is enabled. Minimum value: 1.

10

gpuSpec

string

No

The GPU model.

ecs.gn6i-c4g1.xlarge

displayReleaseVersion

string

No

The engine version. If this parameter is not specified, the value is the same as that of the head node.

ray-1.2.0 (Ray 2.55.1, Python 3.12)

env

string

No

The environment variables.

MY_ENV=hello\nMY_ENV2=hello2

rayStartParams

string

No

The Ray node startup parameters.

--num-cpus=0 --num-gpus=0

extraParam

string

No

The extra parameters. The value must be in JSON format.

{}

volumeIds

array

No

The list of managed directory IDs to mount.

string

No

The managed directory ID.

vol-1234567890

Response elements

Element

Type

Description

Example

object

Schema of Response

requestId

string

The request ID.

DD6B1B2A-5837-5237-ABE4-FF0C8944

clusterId

string

The Ray cluster ID.

ray-k7nm8ahl5te4tg91

Examples

Success response

JSON format

{
  "requestId": "DD6B1B2A-5837-5237-ABE4-FF0C8944",
  "clusterId": "ray-k7nm8ahl5te4tg91"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.