You can create a Compute virtual machine (VM) in the web console, or by using the CLI or Terraform provider. You can tailor the VM configuration to your needs and, for example, attach secondary disks and filesystems, or allocate GPU resources to your VM.Documentation Index
Fetch the complete documentation index at: https://docs.nebius.com/llms.txt
Use this file to discover all available pages before exploring further.
Steps
(Optional) Create a user data configuration
- CLI
- Terraform
To add a user for connections to a VM, create a configuration by using the cloud-init format:The configuration contains the following parameters:
-
name: Username for connecting to the VM. The above example sets the value of the machine’sUSERenvironment variable as the username for the VM. Do not use therootoradminusernames. They are reserved for internal needs and are not allowed to connect to a VM by SSH. -
sudo: Sudo policy.ALL=(ALL) NOPASSWD:ALLallows users unrestricted sudo access;Falsedisables sudo access for users. -
shell: Default shell. -
ssh_authorized_keys: User’s authorized keys. Allows configuring SSH access to the VM. To create the key pair, runssh-keygen -t ed25519.
Create a VM
- Web console
- CLI
- Terraform
On the VM creation page (
Compute → Virtual machines → Create virtual machine), set the VM configuration:
- Select the project for the VM location.
- Specify the VM name.
-
Configure the Computing resources section:
- Select whether the VM should have GPUs.
- Specify the VM type: regular or preemptible. VMs without GPUs only support the regular type.
-
(Optional) For a regular VM with GPUs, select Reservation usage. Specify whether Compute should allocate resources for the VM from reservations.
The Reservation usage field is only displayed if you have capacity block groups.
More information about reservation usage
-
With reservations: The resources are allocated from reservations (capacity block groups). For example, if a Nebius manager has created a capacity block group for you, Compute allocates GPUs for the VM from this capacity block group. This ensures that resources are always available, even if the VM is stopped (for example, by you or a maintenance event).
You can use one of the following reservation types:
- Any (default): You do not need to select reservations. The service uses the reservations that are most suitable for the configuration of your VM.
- Specific: Select specific reservations. Make sure to select reservations that have enough capacity and that do not expire in several days.
- Without reservations: The resources are allocated from a common pool, and no reservations are used for the VM.
-
With reservations: The resources are allocated from reservations (capacity block groups). For example, if a Nebius manager has created a capacity block group for you, Compute allocates GPUs for the VM from this capacity block group. This ensures that resources are always available, even if the VM is stopped (for example, by you or a maintenance event).
You can use one of the following reservation types:
- Select the platform and preset.
-
(Optional) If you create a VM with 8 GPUs (for example, for training models), use a GPU cluster for the VM. InfiniBand™ in the cluster allows you to accelerate tasks that require high-performance computing (HPC) power. A single VM without InfiniBand cannot perform these tasks as quickly.
To use a GPU cluster, select an existing one or create a new cluster:
- Click
Create in the GPU cluster field.
- In the window that opens, specify the cluster name and InfiniBand fabric. To select the fabric, see InfiniBand fabrics.
- Click Create.
- Click
-
In the Boot disk section, set the boot disk settings:
-
Click
.
- In the window that opens, select an existing disk or create a new one.
- If you create a new boot disk, choose an operating system image: either a public image provided by Nebius or a custom image or image family that you created yourself. Also, configure the type, encryption, size and block size. Maximum size of a boot disk is 30,720 GiB (30 TiB). For more information about these settings, see Volume parameters.
-
Click
-
(Optional) If you want to attach an additional disk to your VM, in the Additional disks section, specify the settings of this disk:
- Click
Attach disk.
- In the window that opens, select an existing secondary disk or create a new one.
- If you create a new disk, specify its name and configure the type, encryption, size and block size.
- Click Attach disk or Create and attach disk.
- Click
-
(Optional) If you want to attach a filesystem to your VM, in the Shared filesystems section, specify the settings of this filesystem:
-
Click
Attach shared filesystem.
- In the window that opens, select an existing filesystem or create a new one.
- If you create a new filesystem, specify its name, size and the block size.
- Click Attach filesystem or Create and attach filesystem.
-
After the window is closed, specify a mount tag for mounting the filesystem to the VM.
Create your own tag, such as
my-filesystem. Make sure that it is unique within the VM. - To mount the filesystem to the VM automatically, keep the Auto mount option enabled.
-
Click
-
Configure the Network section:
- Select the VM’s network and subnet.
- In the Primary private IP address field, select whether to automatically assign a private IP address or select an already allocated one. For more information, see Private IP addresses.
-
(Optional) In the Secondary private IP address field, assign secondary addresses. Use them as a backup option in case of incidents. For example, a backup node can take a secondary address of the main node when the main one fails. As a result, routing to this address can be preserved.
After you click
Assign secondary address, you can specify a new address or select an already created allocation. You can assign no more than five secondary addresses.
- In the Public IP address field, specify whether the VM should have a public address and whether this address should be dynamic, static or taken from an allocation. If you need to secure your VM and make it isolated, you can create a VM without a public IP address. If you need to connect to this VM from the internet, you can set up a WireGuard jump server. It has an IP address in the internet and an IP address in the VM’s network. As a result, you can access the VM via the jump server from the internet. This approach enhances security and still provides access to the VM. For more information, see How to enable a public IP address for a VM.
-
In the Username and SSH key field, add credentials, so you can connect to the VM:
-
Generate an SSH key pair:
-
In the Username and SSH key field, click
.
-
If you added an SSH key earlier and you want to reuse it, select the key from the drop-down list.
If you want to add a new key, click
Add credentials.
-
In the window that opens, specify the username of the VM user, a public key of your SSH key pair and the credentials name to recognize the key in the list.
Do not use the
rootoradminusernames. They are reserved for internal needs and are not allowed to connect to a VM by SSH.
-
Generate an SSH key pair:
- Click Add credentials.
- (Optional) Select an existing service account or add a new one to associate it with the VM. The service account will perform actions on behalf of the VM, for example, run scripts.
-
(Optional) Select Enable custom cloud-init config and set a configuration in the cloud-init format.
This configuration affects the settings for shared filesystems and access that you set up earlier:
- If you add a cloud-init configuration, you cannot manage the Auto mount option for filesystems. Their mounting settings automatically appear in the configuration.
- The username and SSH key that you specify in the Access section are automatically added to a cloud-init configuration if you enable it. Ultimately, the settings from the configuration apply, not those from the Access section.
name: Username for connecting to the VM. The above example sets the value of your machine’sUSERenvironment variable as the username for the VM.sudo: Sudo policy.ALL=(ALL) NOPASSWD:ALLallows users unrestricted sudo access;Falsedisables sudo access for users.shell: Default shell.ssh_authorized_keys: User’s authorized keys. Allows configuring SSH access to the VM.
- Click Create VM.
Examples
Create a VM without an additional disk or filesystem
- CLI
- Terraform
-
Create a boot disk:
Save the disk ID from the output
metadata.idparameter. For more information about disk creation, see Creating and resizing Compute volumes. -
Create a VM:
The VM is provided with a dynamic public IPv4 address. For more information about the command parameters, see Create a VM.
Create a VM with an additional disk
- CLI
- Terraform
-
Create a boot disk:
Save the disk ID from the output
metadata.idparameter. For more information about disk creation, see Creating and resizing Compute volumes. -
Create an additional disk:
Save the disk ID from the output
metadata.idparameter. -
Create the VM:
The VM is provided with a dynamic public IPv4 address. For more information about the command parameters, see Create a VM.
Create a VM with a filesystem
- CLI
- Terraform
-
Create a boot disk:
Save the disk ID from the output
metadata.idparameter. For more information about disk and filesystem creation, see Creating and resizing Compute volumes. -
Create a filesystem:
Save the filesystem ID from the output
metadata.idparameter. -
Create the VM:
The VM is provided with a dynamic public IPv4 address. For more information about the command parameters, see Create a VM.
Create a VM within a GPU cluster
If you want to create a VM with 8 GPUs (for example, for training models), create a GPU cluster for the VM. By using InfiniBand, the cluster accelerates tasks that require high-performance computing (HPC) power.- CLI
- Terraform
-
Create a boot disk:
Save the disk ID from the output
metadata.idparameter. For more information about disk creation, see Creating and resizing Compute volumes. -
Create a GPU cluster:
To select the fabric, see InfiniBand fabrics. Save the cluster ID from the output
metadata.idparameter. -
Create a VM:
The VM is provided with a dynamic public IPv4 address. For more information about the command parameters, see Create a VM.
Creating a VM and disks together
Instead of creating disks separately and then attaching them to a VM, you can create a boot disk or secondary disks together with a VM. To do that, set the disk configuration in the VM creation command. As a result, you simultaneously create both the VM and the disks. The disks created together with the VM are called managed disks, and their lifecycle is tied to the VM: when you delete the VM, all its managed disks are deleted with it in a single operation. This makes managed disks a good fit for ephemeral workloads, for example, training jobs or inference clusters where the VM and its storage should be cleaned up together. If you need the disk to persist independently after the VM is deleted, for example, to reattach it to another VM or to enable deletion protection, create the disk separately and attach it by ID instead.Creating a VM and a boot disk together
To create a VM and its boot disk in a single command, use the--boot-disk-managed-disk-* parameters instead of --boot-disk-existing-disk-id:
--boot-disk-managed-disk-name: Name of the boot disk.--boot-disk-managed-disk-type: Disk type.--boot-disk-managed-disk-size-gibibytes: Disk size in GiB. Maximum boot disk size is 30,720 GiB (30 TiB).--boot-disk-managed-disk-source-image-family-image-family: Image family of the boot disk.--boot-disk-managed-disk-source-image-id(optional): ID of a custom disk image. If you have a custom image, use it instead of the image family.--boot-disk-managed-disk-block-size-bytes(optional): Block size in bytes. Must be a power of two between 4096 (4 KiB) and 131,072 (128 KiB). Default: 4096.--boot-disk-managed-disk-disk-encryption-type(optional): Disk encryption. Set thedisk_encryption_managedvalue to enable encryption.
Creating a VM and secondary disks together
To create secondary disks together with a VM, use themanaged_disk object instead of the existing_disk object in the --secondary-disks parameter:
--secondary-disks array contains the following parameters:
-
attach_mode: Write permission.READ_ONLYorREAD_WRITE. -
device_id(optional): User-defined ID for mounting the disk. You can use/dev/disk/by-id/virtio-<device_ID>as a device path. -
managed_disk: Specification of the disk to create.-
name: Name of the disk. -
spec: Disk specification.type: Disk type.size_gibibytes: Disk size in GiB.source_image_family(optional): Image family of the disk.source_image_id(optional): ID of a custom disk image. If you have a custom image, use it instead of the image family.block_size_bytes(optional): Block size in bytes. Must be a power of two between 4096 (4 KiB) and 131,072 (128 KiB). Default: 4096.disk_encryption(optional): Disk encryption. Set thedisk_encryption_managedvalue to enable encryption.
-
--secondary-disks parameter. For more information about the remaining VM parameters, see Create a VM.
”Not enough resources” error
Sometimes, demand for virtual machines and GPUs in certain Nebius AI Cloud regions might be higher than the available supply. When this happens, you might see a “Not enough resources” error when creating or restarting VMs in the affected region. For more details, see “Not enough resources” error for virtual machines in Nebius AI Cloud.See also
- Private and public IP addresses of Compute virtual machines
- InfiniBand™ networking for Compute virtual machines with GPUs
- Types of storage volumes in Compute
- Creating and resizing Compute volumes
- Attaching and mounting Compute volumes to VMs
InfiniBand and InfiniBand Trade Association are registered trademarks of the InfiniBand Trade Association.