Looking for sync ideas between two proxmox hosts

greavette

Renowned Member
Apr 13, 2012
163
9
83
Hello,

We have two Host Servers both running Proxmox 2.2 (will be upgrading to 2.3 soon). We use local storage only for now to host our VM's. We currently use only KVM on our hosts.

I would like to buy a shared storage device but at the moment we don't have the budget to invest in one so I'm looking for solutions to keeping our VM's synced on both hosts. What are our options?

  • Backup from our primary server and ship the backup to the backup server.
  • Is there a way to load the backup on the backup server (though script or some automated method within Proxmox) so if our primary goes down we can quickly start the VM on the backup.
  • The majority of our VM's could be synced weekly (not much changes on them). We backup or SQL Database Server nightly keep our logs off the mainserver so we could restore the database quickly on the backup server if need be.
  • The only server we would need to sync up nightly would be our mail server.

What options are available to us until we can buy shared storage. I'm assuming there's no point in setting up a cluster between the two hosts since we only use local storage.

Any advice you can provide would be appreciated.

Thank you.
 
Hi,
You should see drbd.
drbd is like raid-1 network between 2 volumes hard disk.

for exemple, each server have :
- one disk or raid 1 volume for proxmox
- one disk or raid 1 volume for drbd, witch contain VMs
- one ethernet card for LAN access (proxmox and VMs).
- one ethernet card for drbd sync

proxmox access to drbd volume with LVM.
and you will have VMs alway mirrored on each drbd volume.

make a google search. proxmox drbd.
there is a lot of tutorial.
 
Hi,
You should see drbd.
drbd is like raid-1 network between 2 volumes hard disk.

for exemple, each server have :
- one disk or raid 1 volume for proxmox
- one disk or raid 1 volume for drbd, witch contain VMs
- one ethernet card for LAN access (proxmox and VMs).
- one ethernet card for drbd sync

proxmox access to drbd volume with LVM.
and you will have VMs alway mirrored on each drbd volume.

make a google search. proxmox drbd.
there is a lot of tutorial.


Hi


+1 for DRBD.

With Proxmox you can use "HA" with DRBD and automatically start the VM on the second node if the first dies.
In other point, you can just use DRBD without "HA" and when the first node goes down, you start the second node manually. It can be do quickly.

DRBD has a huge and very detailled documentation at www.drbd.org
Proxmox has a tutorial on his wiki there : http://pve.proxmox.com/wiki/DRBD
You can ask all questions you need on IRC on freenode.org #DRBD #Proxmox


DRBD solution is more better than shared solution type NFS / SAN cause this solution is the next point of failure. If you'r SAN shared solution goes down, all your nodes cannot start any VM's.

DRBD has no point of failure :)


Best regards
 
the SPOF of DRBD is the network connection between the 2 nodes. if that ever fails / gets disconnected both nodes will try to fence one another.

dont get me wrong - DRBD is what the OP would want to use for his situation, but DRBD is far from being the "end all be all" of storage solutions. if you dont want any SPOF for your storage, you may want to look at ceph.
 
Thank you for the replies and options.

If I was to use DRBD between both host servers, would I need the exact same size drive arrays on each server?

Both host servers have 3 sets of raid arrays, but unfortuneately the second server was not bought by me so it's storage space is different (larger) than our first server.

Would this cause us trouble with setting up DRBD?

Thanks.
 
Just thinking about our options and the comments in this post. I know I still have a single point of failure with DRBD if my nic fails...what if I setup bonding of two nics on each host that are connected. This would help I think.

Thoughts?
 
Just thinking about our options and the comments in this post. I know I still have a single point of failure with DRBD if my nic fails...what if I setup bonding of two nics on each host that are connected. This would help I think.

Thoughts?


If you are using CTs and do not have the proper hardware to do fencing and 100 percent up to the second content consistency is not required you can do the following. Use rsync and vzmigrate function and migrate the CT over to the extra box. Do not forget to use the the option to not destroy the container. Now you have a copy of the container on both machines. On the machine you migrated the ct from you cant see the ct listed any more but that is not a problem. Just rename the vmid.conf.migrated to vmid.conf. The vmid is available now on the old box. now you can rsync the data over on a periodic schedule. Only run the container from one machine. With drbd or any ha configuration you must do fencing and hardware raid. Without fencing you will risk split brain. The wiki has a good discussion about how to migrate cts and so does the openvz site. The ct migration via vzmigrate is via cli. That is one feature I wish was available via the gui. As a reference, a running joomla site took just under two minutes to migrate. i hope at some time that the proxmox team can add in drbd config support to the gui. They already have an awesome product and 2.3 is really cool
 
Outstanding! I will look into doing vzmigrate and then using rsysnce to keep the two synced using rsync.

I'm now curious as to how I best to do this migrate.

Each of my Host Servers have 6 Nics and I have the ability from my Managed Switch to use VLAN's for my NiCS. My VM's and GUI management are handled through the first nic on each box. What would I need to do to setup a different nic on each box to handle the vzmigrae and rsync jobs between the hosts? Is this possible?

Thanks very much for your assistance!
 
Outstanding! I will look into doing vzmigrate and then using rsysnce to keep the two synced using rsync.

I'm now curious as to how I best to do this migrate.

Each of my Host Servers have 6 Nics and I have the ability from my Managed Switch to use VLAN's for my NiCS. My VM's and GUI management are handled through the first nic on each box. What would I need to do to setup a different nic on each box to handle the vzmigrae and rsync jobs between the hosts? Is this possible?

Thanks very much for your assistance!

I have never done that; but i would bet someone in the community has tried that.

You have a lot of nics to play with which is great. There are two approachs.

One is to use a single crossover cable and connect between the two servers and assign static ip address on each one. Then you are at wireline speed and do not have the overhead of the switch or the switch as a fail over point. That's what you would be doing in essence when you go to the basic DRBD configuration. The other is to bond two nics to the switch and do LACP or other supported port trunking protocol and have double the throughput. I dont know the amount of data you have to move. Rsync will move a lot of data very fast since it commonly used to only move changed files. A common example of files would be directores like /home or /var/mail. You will need to rsync the files that make sense to your specific needs. There are a lot of different ways to set up RSYNC and there are some really interesting alternatives to rsync. If any of these servers have public facing interfaces then obviously you will configure the nics to be on private ip addresses. There are always security ramifications with anything and you will need to test and test again. One of the things you will be looking for is to make sure permisisons are carried over and consistent between both machines for the rsynced data. You dont want root owning some of the the data lets say in /var/apache2 within the CT and the webserver hickups. The beauty of CT's is the data for each ct is contained in a directory off the HN. Its not like a KVM /esxi where all the data is in a single separate file. So you can copy files between CT's without ever having to log into a CTs Just may have god aweful long path names. Then vzctl enter vmid to fix permissions if needed or what ever and you are good to go. CTs are amazing.

CTs are for Linux only. So if you are doing windows or kvm then life is different.

You can actually just rsync or copy all of the hn contents of /var/lib/vz/private/vmid directories to a backup drive and have a form of a backup.

I have yet to try backula or mondo rescue on a box but that in theory should work. Wouild even like to try a baremetal recover like from Axcient or Baracuda but doubt that they support what we are using. They are pricy.

This is not HA , NO auto fail over nothing. So its a manual start up and you will be behind by x amount of time between rsyncs.

Test test to make sure you got it the way you want.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!