In this article, you will learn how to use Compute disks and shared filesystems on virtual machines (VMs).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.
This article only covers additional volumes: non-boot disks and shared filesystems. You add a boot disk when you create a VM.
- Attach it to the VM by using Nebius AI Cloud interfaces.
- Mount it to the VM inside the VM’s operating system.
How to attach volumes to VMs
To attach disks or shared filesystems to a VM:- Web console
- CLI
-
New VM
On the VM creation page (
Compute → Virtual machines → Create virtual machine), do the following:
- Click Attach disk or Attach shared filesystem.
-
Set up the volume:
- Select whether you want to add a new or existing volume. If an existing disk is already added to another VM, you cannot add it to the new VM. A filesystem can be shared by multiple VMs.
- For a new volume, set its parameters.
- Set a device ID if you are adding a disk, or a mount tag if you are attaching a filesystem. Device IDs and mount tags are used to mount volumes to VMs.
- Click the attach-volume button at the end of the window.
- If you want to manually mount the filesystem that you added to the VM, turn off the Auto mount option for the filesystem. By default, Compute automatically mounts filesystems that you add to VMs via the web console. If you add a disk, you always need to mount it manually.
-
Existing VM
Disks
-
In the sidebar, go to
Compute → Virtual machines.
- Open the page of the required VM.
- Switch to the Disks tab.
- Click Attach resource → Disk.
- Select whether you want to attach a new or existing disk. If an existing disk is already attached to another VM, you cannot attach it to a new VM.
- For a new disk, set its parameters.
- Set a device ID for the disk. Device IDs are used to mount disks to VMs.
- Click the attach-volume button at the end of the window.
-
In the sidebar, go to
Compute → Virtual machines.
- Open the page of the required VM.
-
If the VM is not in the
Stoppedstatus, click Stop VM and then confirm the action. -
After the VM has the
Stoppedstatus, switch to the Filesystems tab. - Click Attach resource → Filesystem.
- Select whether you want to attach a new or existing filesystem. A filesystem can be shared by multiple VMs.
- For a new filesystem, set its parameters.
- Set a mount tag for the filesystem. Mount tags are used to mount filesystems to VMs.
- Click the attach-volume button at the end of the window.
-
In the sidebar, go to
How to mount volumes to VMs
Disks
- Attach the disk to a VM.
-
If you have not saved the disk’s device ID, for example, when adding it to the VM, get it from the information about the VM:
To get the VM ID, run
nebius compute instance list. To get the disk ID, runnebius compute disk list. - Connect to the VM over SSH.
-
Switch to the
rootuser: -
Partition the device. For example, you can use
cfdisk. In the example below, we assume that you have named the devicedisk-0; for disks, all device IDs are prefixed withvirtio-:-
Run
cfdisk:Referring to a device by its name, e.g.,/dev/vdb, does not guarantee it will function properly. Use the device ID instead, e.g.,/dev/disk/by-id/virtio-disk-0. - Under Select label type, select gpt and press Enter.
- Select New (partition) and press Enter.
-
Enter the partition size and press Enter. This will create a
/dev/disk/by-id/virtio-disk-0-part1partition. -
Select Write (the partition table to the device) and press Enter, then type
yesand press Enter. - Select Quit and press Enter.
-
Run
-
Format the partition:
-
Mount the partition and configure permissions for it by using
chmod. In the example below, the partition is mounted at/mnt/disk-0, and all VM users are granted write access to it: -
If you want the partition to be mounted automatically after every VM restart, add it to
/etc/fstabby its UUID: -
Exit the
rootuser shell:
Shared filesystems
If you create a VM in the web console, you can automatically attach and mount a shared filesystem to the VM by using the Auto mount option. If you do not use it, mount the filesystem manually. To do this:- Attach the shared filesystem to a VM.
-
If you have not saved the filesystem’s mount tag, for example, when adding it to the VM, get the mount tag from the information about the VM:
To get the VM ID, run
nebius compute instance list. To get the disk ID, runnebius compute filesystem list. - Connect to the VM over SSH.
-
Switch to the
rootuser: -
Mount the filesystem as a
virtiofsdevice and configure permissions for it by usingchmod. In the example below, a filesystem has the mount tagfilesystem-0and is mounted at/mnt/fs. All VM users are granted write access to it: -
If you want the filesystem to be mounted automatically after every VM restart, add it to
/etc/fstab: -
Exit the
rootuser shell: