Creating a VM backup
To create a backup of your VM, connect it to Cloud Backup, and link it to at least one backup policy. Any backup can only be created within policies.
VM backups in Cloud Backup are automatically created on the schedule specified in the respective policy.
To create a non-scheduled VM backup:
- In the management console
, select a folder to create a backup in. - In the list of services, select Compute Cloud.
- Select the VM with the
Running
status that you want to back up. - Go to the Backups tab.
- Click Create backup.
- In the window that opens, select the backup policy to create the VM backup under and click Create.
The VM backup creation will start.
If you do not have the Yandex Cloud 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 to create a backup:
yc backup policy execute --help
-
Get the ID of the backup policy to use for creating the backup:
yc backup policy list
Result:
+----------------------+----------------------+---------+---------+---------------------+---------------------+ | ID | FOLDER ID | NAME | ENABLED | CREATED AT | UPDATED AT | +----------------------+----------------------+---------+---------+---------------------+---------------------+ | abc7n3wln123******** | ghi681qpe789******** | policy1 | true | 2023-07-03 09:12:02 | 2023-07-03 09:12:43 | | deflqbiwc456******** | ghi681qpe789******** | policy2 | true | 2023-07-07 14:58:23 | 2023-07-07 14:58:23 | +----------------------+----------------------+---------+---------+---------------------+---------------------+
-
Get the ID of the VM you want to back up:
yc compute instance list
Result:
+----------------------+---------+---------------+---------+--------------+-------------+ | ID | NAME | ZONE ID | STATUS | EXTERNAL IP | INTERNAL IP | +----------------------+---------+---------------+---------+--------------+-------------+ | jklp0o9i8012******** | my-vm-1 | ru-central1-b | RUNNING | 51.250.**.** | 192.168.*.* | | mnoa5s6d8345******** | my-vm-2 | ru-central1-b | RUNNING | 84.201.**.** | 192.168.*.* | +----------------------+---------+---------------+---------+--------------+-------------+
-
Create a backup:
yc backup policy execute \ --id <policy_ID> \ --instance-id <VM_ID>
Where:
--id
: ID of the backup policy to use for creating the backup.--instance-id
: ID of the VM you want to back up.
Result:
id: abcsdngawmqv******** description: execute policy created_at: "2024-08-19T09:38:06.015732Z" created_by: def9k8luj4qf******** modified_at: "2024-08-19T09:38:06.015732Z" metadata: '@type': type.googleapis.com/yandex.cloud.backup.v1.ExecuteMetadata policy_id: hij86k3tu3pu******** compute_instance_id: klmc87d7q49r********
For more information about the command, see the CLI reference.