Create a VM with disks restored from snapshots
You can create a VM with disks restored from the snapshots that exist in the folder. For information on creating a disk snapshot, please see Creating a disk snapshot.
-
In the management console
, select the folder to create the virtual machine in. -
In the list of services, select Compute Cloud.
-
At the top right, click Create VM.
-
Under Basic parameters:
-
Enter a name for the VM. The naming requirements are as follows:
- The length can be from 3 to 63 characters.
- It may contain lowercase Latin letters, numbers, and hyphens.
- The first character must be a letter. The last character can't be a hyphen.
Note
The VM name is used to generate an internal FQDN only once: when creating a VM. If the internal FQDN is important to you, choose an appropriate name for the VM at the creation stage.
-
Select an availability zone to place your virtual machine in.
-
-
Under Image/boot disk selection, choose a snapshot:
- Go to the Custom tab and click Choose.
- In the window that opens, go to the Snapshot tab.
- Select a disk snapshot from the list and click Apply.
-
Under Disks, add a disk:
-
Click Add disk.
-
Enter the disk name.
-
Select the disk type.
-
Specify the desired disk size.
-
(Optional) Enable the Delete with the VM option if you need to automatically delete the disk when deleting the VM it will be attached to.
-
Select
Snapshot
as content. -
Click Add.
-
-
(Optional) Under Disks and file storages, select the File storages tab and attach the file storage:
- Click Attach file storage.
- In the window that opens, select the file storage.
- Enter the device name.
- Click Attach file storage.
-
Under Computing resources:
- Choose a platform.
- Specify the required number of vCPUs, as well as the amount of RAM.
- If required, make your VM preemptible.
-
Under Network settings:
- (Optional) Select the Public IP checkbox to assign the VM a public IP address.
-
Under Access, specify the information required to access the instance:
-
Enter username in the Login field.
Alert
Do not use the
root
username or other names reserved by the operating system. To perform operations that require superuser permissions, use thesudo
command. -
In the SSH key field, paste the contents of the public key file.
In public Linux images provided by Nebius AI, the functionality of connecting over SSH using login and password is disabled by default.
-
-
Click Create VM.
The virtual machine will appear in the list. When a VM is created, it is assigned an IP address and hostname (FQDN).
If you don't have the Nebius AI command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI command for creating a VM:
ncp compute instance create --help
-
Prepare snapshots of the required disks, see Creating a disk snapshot.
-
Get a list of snapshots in the default folder:
ncp compute snapshot list +----------------------+-----------------+----------------------+--------+----------------------------+ | ID | NAME | PRODUCT IDS | STATUS | DESCRIPTION | +----------------------+-----------------+----------------------+--------+----------------------------+ | fd8rlt1u2rf0lps3rqm9 | first-snapshot | f2ecl5vhsftdean0sr6s | READY | my first snapshot via CLI | | fhmolt1u2rf0lps3lsaf | second-snapshot | f2eclmol5lps3rqmfl5f | READY | my second snapshot via CLI | +----------------------+-----------------+----------------------+--------+----------------------------+
-
Select the identifier (
ID
) or name (NAME
) of the necessary snapshots. -
Create a VM:
ncp compute instance create \ --name first-instance \ --zone eu-north1-c \ --public-ip \ --create-boot-disk snapshot-name=first-snapshot \ --create-disk snapshot-name=second-snapshot \ --ssh-key ~/.ssh/id_ed25519.pub
This command creates a VM named
first-instance
in theeu-north1-c
availability zone, with a public IP and the disks from the snapshots.Note
The VM name is used to generate an internal FQDN only once: when creating a VM. If the internal FQDN is important to you, choose an appropriate name for the VM at the creation stage.
To create a VM without a public IP, remove the
--public-ip
flag.