E
E
Evgeny Vorobyov2021-03-17 16:33:52
Debian
Evgeny Vorobyov, 2021-03-17 16:33:52

How to replicate and backup KVM images to another server?

Good afternoon.
It is required to set up a virtualization system in a small company.
The choice fell on KVM. It is required to set up replication of virtual machines between two nodes and their periodic backup.
Replication seems to be set up via DRBD. Works. The scheme is as follows (for a general understanding): sda + sdb-> MDADM-> LVM-> LV-> DRBD0-> KVM, that is, the link to the disk in the virtual machine settings leads to the DRBD device.
The right decision? How reliable is it if there are virtual machines with critical services?
It is understood that if the first node falls, we go to the second one, raise the drbd replica there to primary and start the virtual machine, which is already imported there and the disk of which is also specified as "/dev/drbd0" (the secondary device to which the replica leads from the first nodes). How many times did this as part of the test - I have not seen any problems yet. And the plus is that without switching the replica to the primary mode, the virtual machine cannot be launched on the second node (the error falls out).
Is it the right choice to store virtual machines on LVM? After all, you can choose the file option. But then the question arises how to hang drbd on them (it only works with block devices). Through loop would be a good idea?

And another question about periodic backup WITHOUT stopping the VM. In the file version, I did this through the intermediate creation of a snapshot by virsh .. how to do this when the virtual disk is / dev / drbd0 on top of lvm? Backups must be stored in a compressed form on Synology via NFS.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2021-03-17
@gbg

MDADM and LVM look strange at the same time, then it will be fun to modify this collective farm. MDADM is clearly superfluous here.
Two nodes are a priori unreliable (read about split brain), reliable is at least three (and ceph on top).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question