VMmanager 6: Administrator guide

Backups. General information

ISPSystem

A backup is a virtual machine (VM) disk image that is used to restore it. Unlike custom images, backups contain all VM settings. For example, network settings, passwords, etc.

You can create a backup:

  • on the cluster node where the source VM is located — backups are created in the image storage directory. When migrating the VM, the backups are moved with it to another cluster node.

    Note

    When a VM is deleted, its backups are deleted. To get a copy of the VM, which will be preserved after deleting the original VM, create a disk image. 

  • on an external storage — a backup is first created on the cluster node and then copied to the storage. When copying is complete, the backup is deleted from the cluster node. Read more about storage configuration in Backup storage.

You can create backups automatically according to a schedule. Read more in Creating backups automatically.

Backup creation algorithm


VMmanager actions to create a backup:

  1. Сreate a snapshot of the VM. In a file storage, the snapshot is created in the VM storage directory (by default — /vm), in an LVM storage — in LV where the original VM is stored, in a Ceph storage — on the Ceph cluster node.
  2. Move information from the snapshot to the image storage directory on the cluster node (by default — /images). The platform uses the zstd utility to create the archive.
  3. Delete the original snapshot file.
  4. if a backup needs to be created on an external storage:
    1. optimize the snapshot archive with the virt-sparsify utility.
    2. move the snapshot archive to an external storage.

Note

If you are using a file storage, there must be free space on the cluster node to create the backup, which is twice the size of the VM disk. For example, to create a backup of a VM with a 20 GB disk on the cluster node, you must have at least 40 GB free. 

  1. Create a backup of the VM in the /var/snap/lxd/common/lxd/backups/ directory on the cluster node.
  2. Create a backup archive in the /var/snap/lxd/common/lxd/backups/instances/ directory on the cluster node. The platform uses the zstd utility to create the archive.
  3. Move the backup archive to the image storage directory on the cluster node (by default — /images).
  4. Delete the VM backup.
  5. If a backup needs to be created on an external storage, move the archive to an external storage.

Note

To create a backup, there must be free space on the cluster node, approximately 1.5 times the size of the VM disk. For example, to create a backup of a VM with a 20 GB disk on the cluster node, you must have at least 30 GB free. 

No more than one operation can be performed on a cluster node at a time:

  • backup creation;
  • copying to external storage.

The external storage can only accept one backup at a time. Thus, if the storage is used by several nodes of a cluster, you cannot save VM copies from several nodes simultaneously.

Specific features of creating scheduled backups


When working according to schedule, VMmanager checks the possibility of this operation before copying VM to the external storage. The platform sequentially calculates whether there will be enough space on the external storage for each VM. If there is enough space for the VM in the storage, VMmanager creates a backup task.

For example, you need to create backups for virtual machines VM1 (disk capacity 40 GB), VM2 (disk capacity 20 GB) and VM3 (disk capacity 10 GB). The external storage has 55 GB free. To create the backups, VMmanager:

  1. Checks whether there is enough space in the storage for VM1.
  2. Since there is enough space, the backup task is created for VM1.
  3. Calculates how much space will be left after creating the backup of VM1: 55 GB - 40 GB = 15 GB
  4. Checks whether there is enough space in the storage for VM2.
  5. Since there is not enough space, the backup task is not created.
  6. Checks whether there is enough space in the storage for VM3.
  7. Since there is enough space, the backup task is created for VM3.
  8. VM1 and VM3 backups are created one after another on the external storage.
Thank you for your feedback!
Was the article useful?
Tell us why not:

it does not match the title

it was hard to understand

I didn't find the answer

recommendations from the article did not help

other

Tell us what you didn't like in the article: