Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i have two KVM servers with some virtual machines.

Server (A) KVM with qcow2 images

Server (B) KVM mount NFS for partiton (with qcow2 images present on server A).

My question is simple, what is the best solution for creating virtual disk copies on server B (with virtual machines running obviously). DRBD is one solution??

share|improve this question

3 Answers 3

up vote 0 down vote accepted

If you just want to replicate the server A qcow2 images on the server B, but they don't have to be accessed at the same time on both A and B, then you may use DRBD with any file system on it (like ext4), running as Primary on A and Secondary on B. When A fails you will be able to switch DRBD on B to Primary and use the images there.

In case you want those images available and used on A and B at the same time – then this will be more tricky. A clustered file system may help, but I don't think performance will be right.

If you just want to make a one time copy of the images, then just stop the VMs on A, copy the images with scp/rsync/over-NFS/whatever. If the VMs must be running on A, then, for a consistent image, you will need to make some kind of snapshot. I don't know KVM and QCOW2, but maybe they provide some snapshot functionality. If not, then LVM snapshots may have if you store the images on an LVM volume.

share|improve this answer
    
Thank Jacek, one last question, in first case: If you just want to replicate the server A qcow2 images on the server B, but they don't have to be accessed at the same time on both A and B, then you may use DRBD with any file system on it (like ext4), running as Primary on A and Secondary on B. When A fails you will be able to switch DRBD on B to Primary and use the images there. DRDB replicate the qcow images with VM running, is true? –  Giovanni Bennelli Nov 15 '12 at 18:50
    
Yes. Each change made by the VM will be written to disk on both servers (unless DRBD is disconnected or not fully synced – both cases are no problem, as recovery by re-synchronisation is possible). –  Jacek Konieczny Nov 15 '12 at 18:53
    
ok, is all clear, many thanks :) –  Giovanni Bennelli Nov 15 '12 at 19:23
    
If you like my answer, would you up-vote and accept it, please? –  Jacek Konieczny Nov 15 '12 at 19:56

Take a look at https://alteeve.ca/w/2-Node_Red_Hat_KVM_Cluster_Tutorial it will take you through the steps.

share|improve this answer

For high availability with virtual machines you can either Try Ganeti and DRBD as your resource but there will be little extra work in setting up the ganeti, but the pain would worth as it will make your VM management real smooth.

Another option that I could think of is using gluster volumes. It will be super easy to setup and install and if you have good hardware then performance should be good.

As of now I use simple DRBD style the way Jacek has explained, I am also exploring other ways as well.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.