Skip to content

Create Instance / VM

POST
/notebooks/
curl --request POST \
--url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/notebooks/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"name": "my-vm",
"cluster_type": "tir-cluster",
"image_type": "pre-built",
"is_jupyterlab_enabled": true,
"notebook_type": "new",
"notebook_url": "",
"disk_size_in_gb": 30,
"dataset_id_list": [],
"enable_ssh": false,
"add_ons": [],
"init_script_id_list": [
120
],
"sfs_id": 62,
"sfs_path": "/mnt/sfs",
"image_version_id": 59,
"sku_id": 4,
"sku_item_price_id": 4,
"app_id": 1,
"instance_type": "paid_usage",
"kind": "vm",
"public_key": [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGEGHcYy..."
],
"security_group_id": 11442,
"is_pvc_encrypted": false,
"pfs_id": 18,
"pfs_path": "/mnt/pfs",
"pfs_read_only": false,
"snapshot_id": 212,
"quantity": 1,
"reserve_ip_id": 330,
"vpc_id": 12,
"subnet_id": 20
}'

Creates a new compute resource.

To create a Virtual Machine, set "kind": "vm" in the request body along with "image_type": "pre-built" and a valid sku_item_price_id from the Plans List API.

Omitting kind (or setting it to any other value) creates a container-based Instance.

A VM refuses is_spot_instance (“Spot instances are not supported for VM notebooks”) and local_pv_id (“Invalid data provided”). A VM’s disk is 30 GB to 2000 GB. Set quantity to launch several identical VMs in one request.

project_id
required
integer

Project ID

active_iam
integer

Active IAM ID (To access contact person account) Find your Active IAM ID here

location
required
string
Allowed values: Delhi Chennai

Location

Media typeapplication/json
object
name

Up to 50 characters. It starts with a letter, ends with a letter or digit, uses only letters, digits, hyphens and underscores, and differs from every other VM and Instance in the project.

string

Example

my-vm
cluster_type
string

Example

tir-cluster
image_type
string

Example

pre-built
is_jupyterlab_enabled

Not used for a VM.

boolean

Example

true
notebook_type

Not used for a VM.

string

Example

new
notebook_url
string

Example

disk_size_in_gb

Size of the VM’s disk in GB. The default and the minimum are 30. A VM’s disk is at most 2000 GB, or less if the account has a smaller storage limit; a size outside the range is refused with “Notebook disk size must be between 30 and 2000 GB.” With snapshot_id, it must be at least the size of the snapshot’s source disk.

integer

Example

30
dataset_id_list
Array<integer>

Example

[]
enable_ssh

Ignored by the backend. SSH access is determined solely by whether public_key is provided. Include this field for compatibility but it has no effect.

boolean

Example

false
add_ons
Array<string>

Example

[]
init_script_id_list

List of initialization script IDs

Array<integer>

Example

[
120
]
sfs_id

ID of a Shared File System to mount. Send sfs_path with it.

integer

Example

62
sfs_path

Mount path of the Shared File System. Read only when sfs_id is sent.

string

Example

/mnt/sfs
image_version_id
integer

Example

59
sku_id

Not needed. The plan comes from sku_item_price_id.

integer

Example

4
sku_item_price_id
integer

Example

4
app_id

Not needed for a pre-built image. It is taken from image_version_id.

integer

Example

1
instance_type
string

Example

paid_usage
kind

Set to "vm" to create a full OS Virtual Machine instead of a container-based Instance. Omit or leave empty for Instances.

string
Allowed values: vm

Example

vm
public_key

SSH public key strings to authorize at creation time. The key must already be saved in your TIR account (via Security → SSH Keys) — the backend looks up keys by exact string match against your saved keys. Providing an unregistered key string is silently ignored and SSH will remain disabled. This is the only way to enable SSH; enable_ssh has no effect. Send security_group_id with it, or the request is refused with “At least one security group must be attached to the node when SSH is enabled.”

Array<string>

Example

[
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGEGHcYy..."
]
security_group_id

ID of a Security Group to attach at creation time. Required when public_key is sent. The group must allow port 22 for SSH to work.

integer

Example

11442
is_pvc_encrypted

Whether to encrypt the workspace disk. Defaults to false.

boolean

Example

false
pfs_id

ID of a Parallel File System to mount. Available in Delhi. Send pfs_path with it.

integer

Example

18
pfs_path

Mount path of the Parallel File System. Read only when pfs_id is sent.

string

Example

/mnt/pfs
pfs_read_only

Whether to mount the Parallel File System read-only. Defaults to false.

boolean

Example

false
snapshot_id

ID of a snapshot to launch the VM’s disk from, instead of a fresh image. The snapshot must be in the same project and its status must be ready; otherwise the request is refused with “Snapshot not found in this project.” or “Snapshot is not ready; wait for it to finish before launching from it.” A disk_size_in_gb smaller than the snapshot’s source disk is refused with “Disk size N GB is smaller than the snapshot’s source disk (M GB). Choose M GB or more.”

integer

Example

212
quantity

Number of identical VMs to launch, 1 to 10. Defaults to 1. With more than one, the names get a -1, -2 suffix and the response lists the VMs in created and the ones that failed in failed; some can succeed while others fail. A VM-only field.

integer

Example

1
reserve_ip_id

ID of a reserved IP to attach. Without it the VM gets a public IP of its own.

integer

Example

330
vpc_id

ID of an active VPC to attach the VM to. Only a CPU VM in Delhi or Chennai can join a VPC; a GPU VM and a private cluster VM are refused. With no vpc_id, a CPU VM there joins the project’s default private network.

integer

Example

12
subnet_id

Subnet of that VPC. Without it, the VPC’s first subnet is used.

integer

Example

20

Node created successfully

Media typeapplication/json
object
code
integer
message
string
data
object
id
integer
name
string
project_id
integer
image_type
string
image_details
object
image_id
integer
version_id
integer
name
string
icon_url
string
image_description
string
version_description
string
sku_details
object
specs
object
sku_id
integer
name
string
series
string
cpu
integer
gpu
integer
memory
integer
is_free
boolean
is_active
boolean
gpu_switch_type
string
nullable
local_storage_in_gb
integer
plan
object
sku_item_price_id
integer
sku_type
string
committed_days
integer
unit_price
number format: float
currency
string
is_active
boolean
description
string
nullable
status
string
last_activity
string format: date-time
nullable
created_by
object
id
integer
name
string
email
string
username
string
created_at
string format: date-time
updated_at
string format: date-time
lab_url
string
nullable
disk_size_in_gb
integer
instance_type
string
ssh_keys
Array<string>
disable_ssh_login_password
boolean
public_ip
string
e2e_registry_image_url
string
nullable
egress_gateway_ip
string
add_ons
object
key
additional properties
any
is_jupyterlab_enabled
boolean
is_ssh_enabled
boolean
custom_ports
Array<string>
private_cloud_id
string
nullable
custom_sku
string
nullable
errors
object

Example

{
"code": 201,
"message": "Created Successfully",
"data": {
"id": 5633,
"name": "node-11131656asd3232",
"project_id": 124,
"image_type": "pre-built",
"image_details": {
"image_id": 9,
"version_id": 56,
"name": "Transformers",
"icon_url": "/notebook_images/hf-logo.png",
"image_description": "Transformers v4.31.0 with Python 3.10 and NVIDIA Cuda 12.1 pre-installed on Ubuntu 22.04",
"version_description": "Transformers v4.45.2 with Python 3.10 and NVIDIA Cuda 12.4 pre-installed on Ubuntu 22.04"
},
"sku_details": {
"specs": {
"sku_id": 4,
"name": "C3.8GB",
"series": "CPU",
"cpu": 4,
"gpu": 0,
"memory": 8,
"is_free": false,
"is_active": true,
"gpu_switch_type": null,
"local_storage_in_gb": 0
},
"plan": {
"sku_item_price_id": 4,
"sku_type": "hourly",
"committed_days": 0,
"unit_price": 3.1,
"currency": "INR",
"is_active": true,
"description": null
}
},
"status": "waiting",
"last_activity": null,
"created_by": {
"id": 3573,
"name": "Nipun",
"email": "nipun.arora@e2enetworks.com",
"username": "nipun.arora@e2enetworks.com"
},
"created_at": "2024-11-13T11:30:13.267193Z",
"updated_at": "2024-11-13T11:30:13.327815Z",
"lab_url": null,
"disk_size_in_gb": 30,
"instance_type": "paid_usage",
"ssh_keys": [],
"disable_ssh_login_password": true,
"public_ip": "",
"e2e_registry_image_url": null,
"egress_gateway_ip": "116.204.174.145",
"add_ons": {},
"is_jupyterlab_enabled": true,
"is_ssh_enabled": false,
"custom_ports": [],
"private_cloud_id": null,
"custom_sku": null
},
"errors": {}
}