Creating a Linux VM with a connection to Cloud Backup
You can back up your Yandex Compute Cloud VMs with supported Linux-based operating systems.
For the proper Cloud Backup agent operation, the VM must meet the minimum requirements.
Getting started
-
Create a service account with the
backup.userrole or higher.You do not have to use a service account when creating a VM using the management console
. However, the user creating the VM must have thebackup.userrole or higher for the folder in which the VM is created.Warning
Starting August 1, 2026, the compute.editor and compute.admin roles get new permissions from the backup.user role, allowing them to connect VM instances to Yandex Cloud Backup, link and unlink them from backup policies.
If you do not plan to connect your resources to Cloud Backup and do not want to grant such permissions to your users, you can proactively disable these features using the
backup.denyActivationauthorization policy assigned to your folder, cloud, or organization. For more information on how to create an authorization policy, see Creating an access policy for a resource. -
Set up network access for your VM.
Creating a VM
Note
If you are using LVM
-
In the management console
, select the folder where you want to create a VM. -
Navigate
to Compute Cloud. -
In the left-hand panel, select
Virtual machines and click Create virtual machine. -
Under Boot disk image, select an operating system supported in Cloud Backup.
-
Under Location, select an availability zone where your VM will reside.
-
Under Disks and file storages and Computing resources, set up your VM.
The minimum resource specification required to install and correctly run the Cloud Backup agent is as follows:
-
Free disk space:
- For Linux-based VMs: 2 GB.
- For Windows-based VMs: 1.2 GB.
-
RAM: For backups, 1 GB of RAM is required per 1 TB of backup. The RAM requirement depends on the amount and type of data processed by the Cloud Backup agent.
Tip
Installing a Cloud Backup agent is a resource-intensive operation. If you want to use a VM in the minimum possible configuration or, for example, a VM with a vCPU performance level below 100%, we recommend increasing the VM's resources during the Cloud Backup agent installation.
To speed up data backup and recovery, the Cloud Backup agent tends to consume significant amounts of RAM of the resource it is backing up. The agent can even use up all the available RAM, which in some cases may disrupt the resource's other services and make it impossible to complete the backup or recovery process.
To prevent such issues, limit the amount of data the agent caches in RAM.
Note
Limiting the Cloud Backup agent's use of RAM may slow down the backup and recovery operations.
-
-
Under Network settings:
- Choose a subnet in the selected availability zone.
- In the Public IP address field, select
Auto. - Select a security group configured to work with Cloud Backup.
-
Under Access, select SSH key and specify the VM access credentials:
- In the Login field, enter a username.
- In the SSH key field, select the SSH key saved in your organization user profile.
If your profile has no SSH keys, click Add key to add a new key.
-
Activate a backup:
-
Enable Backup.
-
Select Cloud Backup.
-
Under Cloud Backup, click Select policy
and, in the list that opens, select the backup policy that will be used by Cloud Backup to work with the VM.Optionally, click
Create policy to create a new policy.
To create a new VM with a Cloud Backup connection, your account must have the
backup.userrole or higher for the folder you are creating the VM in.Note
If your account does not have the
backup.userrole or higher, you can connect the VM to Cloud Backup using a service account which has that role.To do this, expand the Additional section and select the service account under Service account. If required, create a new service account and assign it the
backup.userrole.For more information, see Connecting Yandex Compute Cloud VMs to Cloud Backup.
-
-
Under General information, specify the VM name and description. The naming requirements are as follows:
- Length: between 3 and 63 characters.
- It can only contain lowercase Latin letters, numbers, and hyphens.
- It must start with a letter and cannot end with a hyphen.
Note
The VM name is used to generate an internal FQDN, which is set only once, when you create the VM. If the internal FQDN is important to you, make sure to choose an appropriate name for your VM.
-
Specify the other VM parameters as needed. For more information, see Creating a VM from a public Linux image.
-
Click Create VM.
After the VM status changes to Running, the Cloud Backup agent installation will start automatically. This may take from 5 to 10 minutes.
Once you install the agent, the Cloud Backup VM will be added to Cloud Backup in the
If the VM is not automatically associated with the policy, associate it manually.
-
Select a folder:
yc resource-manager folder listResult:
+----------------------+--------------------+------------------+--------+ | ID | NAME | LABELS | STATUS | +----------------------+--------------------+------------------+--------+ | wasdcjs6be29******** | my-folder | | ACTIVE | | qwertys6be29******** | default | | ACTIVE | +----------------------+--------------------+------------------+--------+ -
Select a subnet:
yc vpc subnet list --folder-id <folder_ID>Result:
+----------------------+---------------------------+----------------------+----------------+-------------------+-----------------+ | ID | NAME | NETWORK ID | ROUTE TABLE ID | ZONE | RANGE | +----------------------+---------------------------+----------------------+----------------+-------------------+-----------------+ | b0c6n43f9lgh******** | default-ru-central1-d | enpe3m3fa00u******** | | ru-central1-d | [10.***.0.0/24] | | e2l2da8a20b3******** | default-ru-central1-b | enpe3m3fa00u******** | | ru-central1-b | [10.***.0.0/24] | | e9bnlm18l70a******** | default-ru-central1-a | enpe3m3fa00u******** | | ru-central1-a | [10.***.0.0/24] | +----------------------+---------------------------+----------------------+----------------+-------------------+-----------------+ -
Create a VM:
yc compute instance create \ --folder-id <folder_ID> \ --name <VM_name> \ --zone <availability_zone> \ --network-interface subnet-name=<subnet_name>,nat-ip-version=ipv4,security-group-ids=<security_group_ID> \ --create-boot-disk image-id=<image_ID>,size=<boot_disk_size> \ --cores 2 \ --core-fraction 100 \ --memory 4 \ --service-account-name <service_account_name> \ --ssh-key <path_to_public_SSH_key>Where:
-
--folder-id: Folder ID. -
--name: Name of the new VM.Note
The VM name is used to generate an internal FQDN, which is set only once, when you create the VM. If the internal FQDN is important to you, make sure to choose an appropriate name for your VM.
-
--zone: Availability zone matching the selected subnet. -
subnet-name: Name of the selected subnet. -
security-group-ids: ID of the security group configured to work with Cloud Backup. -
image-id: OS image ID. See the list of supported Linux-based operating systems. -
size: Boot disk size. -
--cores: Number of vCPUs in the VM. -
--core-fraction: Guaranteed vCPU share, in %. -
--memory: VM RAM size. -
--service-account-name: Name of the service account with thebackup.userrole or higher. -
--ssh-key: Path to the file with the public SSH key. The VM will automatically create a user namedyc-userfor this key.
In this example, we are creating a VM running Ubuntu 20.04:
yc compute instance create \ --folder-id wasdcjs6be29******** \ --name my-vm \ --zone ru-central1-b \ --network-interface subnet-name=my-vpc-ru-central1-b,nat-ip-version=ipv4,security-group-ids=abcd3570sbqg******** \ --create-boot-disk image-id=fd8ecgtorub9********,size=25 \ --cores 2 \ --core-fraction 100 \ --memory 4 \ --service-account-name backup-user \ --ssh-key my-key.pubResult:
done (46s) id: abcdho6nspdk******** folder_id: wasdcjs6be29******** created_at: "2023-10-09T14:57:06Z" name: my-vm ... one_to_one_nat: address: 158.***.**.*** ... placement_policy: {} -
-
Connect to the VM over SSH. Establish a connection as
yc-userand use the VM's public IP address from thecreate VMcommand output underone_to_one_nat. -
Install the Cloud Backup agent:
Ubuntu
sudo apt update && \ sudo apt install -y jq && \ curl https://storage.yandexcloud.net/backup-distributions/agent_installer.sh | sudo bashResult:
... Agent registered with id D9CA44FC-716A-4B3B-A702-C6**********CentOS
sudo yum install epel-release -y && \ sudo yum update -y && \ sudo yum install jq -y && \ curl https://storage.yandexcloud.net/backup-distributions/agent_installer.sh | sudo bashResult:
... Agent registered with id D9CA44FC-716A-4B3B-A702-C6**********
After the VM status changes to Running, the Cloud Backup agent installation will start automatically. This may take from 5 to 10 minutes.
Once you install the Cloud Backup agent, the VM will be added to Cloud Backup in the
Note
If the Cloud Backup agent fails to install within 10 minutes, contact