curl --request POST \
--url https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"flavor": "g3-ai-32-192-1500-l40s-48-1",
"name": "gpu-cluster-1",
"servers_count": 3,
"servers_settings": {
"interfaces": [
{
"type": "<string>",
"ip_family": "ipv4",
"name": "eth0",
"port_security_enabled": true,
"security_groups": [
{
"id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98"
}
]
}
],
"volumes": [
{
"boot_index": 1,
"name": "my-data-disk",
"size": 100,
"source": "<string>",
"delete_on_termination": true,
"tags": {
"key1": "value1"
}
}
],
"credentials": {
"password": "securepassword",
"ssh_key_name": "my-ssh-key",
"username": "admin"
},
"file_shares": [
{
"id": "a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a",
"mount_path": "/mnt/vast"
}
],
"security_groups": [
{
"id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98"
}
],
"user_data": "eyJ0ZXN0IjogImRhdGEifQ=="
},
"tags": {}
}
'import requests
url = "https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters"
payload = {
"flavor": "g3-ai-32-192-1500-l40s-48-1",
"name": "gpu-cluster-1",
"servers_count": 3,
"servers_settings": {
"interfaces": [
{
"type": "<string>",
"ip_family": "ipv4",
"name": "eth0",
"port_security_enabled": True,
"security_groups": [{ "id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98" }]
}
],
"volumes": [
{
"boot_index": 1,
"name": "my-data-disk",
"size": 100,
"source": "<string>",
"delete_on_termination": True,
"tags": { "key1": "value1" }
}
],
"credentials": {
"password": "securepassword",
"ssh_key_name": "my-ssh-key",
"username": "admin"
},
"file_shares": [
{
"id": "a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a",
"mount_path": "/mnt/vast"
}
],
"security_groups": [{ "id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98" }],
"user_data": "eyJ0ZXN0IjogImRhdGEifQ=="
},
"tags": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
flavor: 'g3-ai-32-192-1500-l40s-48-1',
name: 'gpu-cluster-1',
servers_count: 3,
servers_settings: {
interfaces: [
{
type: '<string>',
ip_family: 'ipv4',
name: 'eth0',
port_security_enabled: true,
security_groups: [{id: 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'}]
}
],
volumes: [
{
boot_index: 1,
name: 'my-data-disk',
size: 100,
source: '<string>',
delete_on_termination: true,
tags: {key1: 'value1'}
}
],
credentials: {password: 'securepassword', ssh_key_name: 'my-ssh-key', username: 'admin'},
file_shares: [{id: 'a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a', mount_path: '/mnt/vast'}],
security_groups: [{id: 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'}],
user_data: 'eyJ0ZXN0IjogImRhdGEifQ=='
},
tags: {}
})
};
fetch('https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'flavor' => 'g3-ai-32-192-1500-l40s-48-1',
'name' => 'gpu-cluster-1',
'servers_count' => 3,
'servers_settings' => [
'interfaces' => [
[
'type' => '<string>',
'ip_family' => 'ipv4',
'name' => 'eth0',
'port_security_enabled' => true,
'security_groups' => [
[
'id' => 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'
]
]
]
],
'volumes' => [
[
'boot_index' => 1,
'name' => 'my-data-disk',
'size' => 100,
'source' => '<string>',
'delete_on_termination' => true,
'tags' => [
'key1' => 'value1'
]
]
],
'credentials' => [
'password' => 'securepassword',
'ssh_key_name' => 'my-ssh-key',
'username' => 'admin'
],
'file_shares' => [
[
'id' => 'a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a',
'mount_path' => '/mnt/vast'
]
],
'security_groups' => [
[
'id' => 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'
]
],
'user_data' => 'eyJ0ZXN0IjogImRhdGEifQ=='
],
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters"
payload := strings.NewReader("{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"volumes\": [\n {\n \"boot_index\": 1,\n \"name\": \"my-data-disk\",\n \"size\": 100,\n \"source\": \"<string>\",\n \"delete_on_termination\": true,\n \"tags\": {\n \"key1\": \"value1\"\n }\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"volumes\": [\n {\n \"boot_index\": 1,\n \"name\": \"my-data-disk\",\n \"size\": 100,\n \"source\": \"<string>\",\n \"delete_on_termination\": true,\n \"tags\": {\n \"key1\": \"value1\"\n }\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"volumes\": [\n {\n \"boot_index\": 1,\n \"name\": \"my-data-disk\",\n \"size\": 100,\n \"source\": \"<string>\",\n \"delete_on_termination\": true,\n \"tags\": {\n \"key1\": \"value1\"\n }\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}Create virtual GPU cluster
Create a new virtual GPU cluster with the specified configuration.
curl --request POST \
--url https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"flavor": "g3-ai-32-192-1500-l40s-48-1",
"name": "gpu-cluster-1",
"servers_count": 3,
"servers_settings": {
"interfaces": [
{
"type": "<string>",
"ip_family": "ipv4",
"name": "eth0",
"port_security_enabled": true,
"security_groups": [
{
"id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98"
}
]
}
],
"volumes": [
{
"boot_index": 1,
"name": "my-data-disk",
"size": 100,
"source": "<string>",
"delete_on_termination": true,
"tags": {
"key1": "value1"
}
}
],
"credentials": {
"password": "securepassword",
"ssh_key_name": "my-ssh-key",
"username": "admin"
},
"file_shares": [
{
"id": "a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a",
"mount_path": "/mnt/vast"
}
],
"security_groups": [
{
"id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98"
}
],
"user_data": "eyJ0ZXN0IjogImRhdGEifQ=="
},
"tags": {}
}
'import requests
url = "https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters"
payload = {
"flavor": "g3-ai-32-192-1500-l40s-48-1",
"name": "gpu-cluster-1",
"servers_count": 3,
"servers_settings": {
"interfaces": [
{
"type": "<string>",
"ip_family": "ipv4",
"name": "eth0",
"port_security_enabled": True,
"security_groups": [{ "id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98" }]
}
],
"volumes": [
{
"boot_index": 1,
"name": "my-data-disk",
"size": 100,
"source": "<string>",
"delete_on_termination": True,
"tags": { "key1": "value1" }
}
],
"credentials": {
"password": "securepassword",
"ssh_key_name": "my-ssh-key",
"username": "admin"
},
"file_shares": [
{
"id": "a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a",
"mount_path": "/mnt/vast"
}
],
"security_groups": [{ "id": "b4849ffa-89f2-45a1-951f-0ae5b7809d98" }],
"user_data": "eyJ0ZXN0IjogImRhdGEifQ=="
},
"tags": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
flavor: 'g3-ai-32-192-1500-l40s-48-1',
name: 'gpu-cluster-1',
servers_count: 3,
servers_settings: {
interfaces: [
{
type: '<string>',
ip_family: 'ipv4',
name: 'eth0',
port_security_enabled: true,
security_groups: [{id: 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'}]
}
],
volumes: [
{
boot_index: 1,
name: 'my-data-disk',
size: 100,
source: '<string>',
delete_on_termination: true,
tags: {key1: 'value1'}
}
],
credentials: {password: 'securepassword', ssh_key_name: 'my-ssh-key', username: 'admin'},
file_shares: [{id: 'a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a', mount_path: '/mnt/vast'}],
security_groups: [{id: 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'}],
user_data: 'eyJ0ZXN0IjogImRhdGEifQ=='
},
tags: {}
})
};
fetch('https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'flavor' => 'g3-ai-32-192-1500-l40s-48-1',
'name' => 'gpu-cluster-1',
'servers_count' => 3,
'servers_settings' => [
'interfaces' => [
[
'type' => '<string>',
'ip_family' => 'ipv4',
'name' => 'eth0',
'port_security_enabled' => true,
'security_groups' => [
[
'id' => 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'
]
]
]
],
'volumes' => [
[
'boot_index' => 1,
'name' => 'my-data-disk',
'size' => 100,
'source' => '<string>',
'delete_on_termination' => true,
'tags' => [
'key1' => 'value1'
]
]
],
'credentials' => [
'password' => 'securepassword',
'ssh_key_name' => 'my-ssh-key',
'username' => 'admin'
],
'file_shares' => [
[
'id' => 'a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a',
'mount_path' => '/mnt/vast'
]
],
'security_groups' => [
[
'id' => 'b4849ffa-89f2-45a1-951f-0ae5b7809d98'
]
],
'user_data' => 'eyJ0ZXN0IjogImRhdGEifQ=='
],
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters"
payload := strings.NewReader("{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"volumes\": [\n {\n \"boot_index\": 1,\n \"name\": \"my-data-disk\",\n \"size\": 100,\n \"source\": \"<string>\",\n \"delete_on_termination\": true,\n \"tags\": {\n \"key1\": \"value1\"\n }\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"volumes\": [\n {\n \"boot_index\": 1,\n \"name\": \"my-data-disk\",\n \"size\": 100,\n \"source\": \"<string>\",\n \"delete_on_termination\": true,\n \"tags\": {\n \"key1\": \"value1\"\n }\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v3/gpu/virtual/{project_id}/{region_id}/clusters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"flavor\": \"g3-ai-32-192-1500-l40s-48-1\",\n \"name\": \"gpu-cluster-1\",\n \"servers_count\": 3,\n \"servers_settings\": {\n \"interfaces\": [\n {\n \"type\": \"<string>\",\n \"ip_family\": \"ipv4\",\n \"name\": \"eth0\",\n \"port_security_enabled\": true,\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ]\n }\n ],\n \"volumes\": [\n {\n \"boot_index\": 1,\n \"name\": \"my-data-disk\",\n \"size\": 100,\n \"source\": \"<string>\",\n \"delete_on_termination\": true,\n \"tags\": {\n \"key1\": \"value1\"\n }\n }\n ],\n \"credentials\": {\n \"password\": \"securepassword\",\n \"ssh_key_name\": \"my-ssh-key\",\n \"username\": \"admin\"\n },\n \"file_shares\": [\n {\n \"id\": \"a3f2d1b8-45e6-4f8a-bb5d-19dbf2cd7e9a\",\n \"mount_path\": \"/mnt/vast\"\n }\n ],\n \"security_groups\": [\n {\n \"id\": \"b4849ffa-89f2-45a1-951f-0ae5b7809d98\"\n }\n ],\n \"user_data\": \"eyJ0ZXN0IjogImRhdGEifQ==\"\n },\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Path Parameters
Project ID
1
Region ID
7
Body
Cluster flavor ID
"g3-ai-32-192-1500-l40s-48-1"
Cluster name
63^[a-zA-Z0-9][a-zA-Z 0-9._\-]{1,61}[a-zA-Z0-9._]$"gpu-cluster-1"
Number of servers in the cluster
3
Configuration settings for the servers in the cluster
Show child attributes
Show child attributes
Key-value tags to associate with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Both tag keys and values have a maximum length of 255 characters. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
Show child attributes
Show child attributes
{ "my-tag": "my-tag-value" }
Response
OK
List of task IDs representing asynchronous operations. Use these IDs to monitor operation progress:
GET /v1/tasks/{task_id}- Check individual task status and details Poll task status until completion (FINISHED/ERROR) before proceeding with dependent operations.
["d478ae29-dedc-4869-82f0-96104425f565"]
Was this page helpful?