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, follow the instructions in Generating SSH keys.
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.
-
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, configure its source, type, encryption, size and block size. For information about these settings, see Volume parameters.
-
(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.
-
(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.
-
(Optional) If the selected platform and preset support local SSD disks, enable Local SSD disks to add ephemeral local storage to your VM.
Local SSD disks are available only for supported platforms and presets. For details, see Availability.
-
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.
- 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
To create a VM, run the following command: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 VM, its boot disk and an additional disk together: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 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 with local SSD disks
Local SSD disks are available only for supported platforms and presets. For details, see Availability.
- CLI
- Terraform
To create a VM with local SSD disks, run the following command:This adds ephemeral local storage to the VM.The example creates a private IPv4 address and doesn’t assign a public IPv4 address. For more information about the command parameters, see Create a VM.
Create a VM with standalone boot and additional disks
By default, when you create a VM, its disks are created along with this VM. Such disks are called VM-managed: their lifecycle is tied to the VM, so when you delete the VM, its disks are deleted along with it. Alternatively, if you already have a disk or you want to keep the disk after the VM deletion, create a standalone disk first and attach it to the VM afterward. To create standalone disks and a VM with them, do the following:- CLI
- Terraform
-
Create a boot disk:
Save the disk ID from the output
metadata.idparameter. For more information about disk creation, see Managing Compute volumes. -
Create an additional disk:
Save the disk 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.
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 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.
“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
- Managing Compute volumes
- Attaching and mounting Compute volumes to VMs
InfiniBand and InfiniBand Trade Association are registered trademarks of the InfiniBand Trade Association.