How to get started with Yandex Cloud Backup on an existing VM
Before you get started with Cloud Backup, make sure you have a linked billing account and its status is ACTIVE or TRIAL_ACTIVE.
Make sure you have a Yandex Compute Cloud VM instance. In this tutorial, you will connect a Linux
The cost of VM backup resources includes:
- Fee for VM computing resources and disks (see Yandex Compute Cloud pricing).
- Fee for backed up VMs and backup retention (see Yandex Cloud Backup pricing).
To get started with Cloud Backup:
- Set up the infrastructure.
- Activate Cloud Backup.
- Install the Cloud Backup agent.
- Link your VM to a backup policy.
If you no longer need the resources you created, delete them.
Set up the infrastructure
-
In the cloud network hosting the VM you want to connect to Cloud Backup, create a security group with the following outgoing traffic rules:
Port range Protocol Destination name CIDR blocks 80TCPCIDR213.180.193.0/2480TCPCIDR213.180.204.0/24443TCPCIDR84.47.172.0/24443TCPCIDR84.201.181.0/24443TCPCIDR178.176.128.0/24443TCPCIDR213.180.193.0/24443TCPCIDR213.180.204.0/247770-7800TCPCIDR84.47.172.0/248443TCPCIDR84.47.172.0/2444445TCPCIDR51.250.1.0/24Tip
When installing the Cloud Backup agent on your VM or BareMetal server, you might need to install missing software components from the internet. To do this, add the following outgoing traffic rule to the security group:
- Port range:
0-65535. - Protocol:
Any. - Destination name:
CIDR. - CIDR blocks:
0.0.0.0/0.
Once the Cloud Backup agent is installed, you can delete this rule.
- Port range:
-
Assign the new security group to the VM you are connecting to Cloud Backup:
Management console-
In the management console
, select the folder where you want to connect a VM to Cloud Backup. -
In the list of services, select Compute Cloud and then select the VM.
-
Under Network interface, add a security group to the VM network interface:
- In the top-right corner of the section, click
and select Edit. - In the window that opens, select the previously created security group in the Security groups field.
- Click Save.
- In the top-right corner of the section, click
-
If the VM does not have a public IP address, then under Network, click
in the top-right corner of the relevant network interface section and select Add public IP address. In the window that opens:- In the Public address field, select
Autoto get an IP address automatically orListto choose a reserved address from the list. - Optionally, if you selected
Autoin the Public address field, enable DDoS protection. For more information, see Yandex DDoS Protection in Virtual Private Cloud. - If you selected
Listin the Public address field, choose the IP address you want to assign to your VM. The IP address and the VM must be in the same availability zone. - Click Add.
Instead of assigning a public IP address to your VM, you can associate the subnet hosting this VM with a route table allowing internet access via a NAT gateway or a custom router.
- In the Public address field, select
-
-
Create a service account and assign the
backup.editorrole to it. -
Link the new service account to the VM you are connecting to Cloud Backup:
Note
You can only link one service account to a virtual machine.
To link a service account to a VM, you need a permission to use this account. This permission comes with the iam.serviceAccounts.user and editor roles or higher.
Management console- In the management console
, select the folder where you want to connect a VM to Cloud Backup. - In the list of services, select Compute Cloud and then a VM from the list that opens.
- In the top-right corner of the page, click
Edit VM. - Under Additional, select a service account with the
backup.editorrole. - Click Save changes.
- In the management console
Activate Cloud Backup
To activate the service, you need at least the backup.editor role for the folder in which you want to create backups of VMs or BareMetal servers.
When you enable the service, the backup provider starts. For more information about the backup provider and data sent to it, see Service activation and backup provider.
-
In the management console
, select the folder where you want to connect a VM to Cloud Backup. -
In the list of services, select Cloud Backup.
-
If you have not activated Cloud Backup yet, click Activate.
If there is no Activate button, and you can create a VM connected to Cloud Backup, Cloud Backup has already been activated. Proceed to the next step.
Install the Cloud Backup agent
-
Connect to the VM over SSH.
-
Install the Cloud Backup agent on the VM by running this command in the Linux terminal:
UbuntuCentOSsudo 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**********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**********
Link your VM to a backup policy
Once you install the agent, the VM will be added to Cloud Backup in the
-
Make sure the Cloud Backup agent has been installed:
Management console- In the management console
, select the folder where the service is activated. - In the list of services, select Compute Cloud.
- Select the VM.
- Check that the value of the Backups field in the Cloud Backup section is
No backup policy.
- In the management console
-
Link your VM to a backup policy:
Management console- In the management console
, select the folder with the activated service and VM you need. - In the list of services, select Cloud Backup.
- In the left-hand panel, select
Backup policies. - Select one of the policies created by default. Click Create policy to create a new policy, if required.
- Under Attached resources on the Virtual machines tab, click
Attach a VM. - In the window that opens, select the VM from the list and click Attach.
As a result, the VM will be associated with the backup policy and the system will start taking its backups according to the policy schedule.
- In the management console
How to delete the resources you created
To stop paying for the resources you created: