Duplicating VZ container on a spare server

andrea

Member
Sep 18, 2009
36
0
6
Roma, Italy
www.mediatouch.it
We are trying to understand best way to duplicate VZ container over a spare server. The idea behind this need is the capability to quickly re-boot VZ containers on the spare server in case of a complete loss of the main server. The condition where the VZ containers on the spare server are some hours older than those in the main server is acceptable (as in many backup scenarios).

The reason why we didn't use a proxmox master-slave configuration is the need of a total independence of the two servers. We tried also vzdump, however vzdump take very long time for large VZ containers and it creates a tar of the whole container that must be transferred on the spare server, while rsync only transfer changed files. On our setup the vzdump approach takes about 6-7 hours over 1,5TB data, while the rsync from 45 minutes to 1 hour.

What we did is basically:

  1. take a LVM snapshot of /var/lib/vz/private
  2. scp of quota files from /var/lib/vzquota
  3. scp of tarred configuration files from /var/lib/vz/conf files
  4. loop trough "vzlist -Ha -o ctid" and rsync (with -a option) over spare server
First tests seem interesting, as stopping a VZ container on the main server and starting it on the spare server yields a running VZ container, however some things appear to be polished:


  • although quota files are copied, quota is always recalculated. While this is acceptable for small containers, for large containers it takes very long. On a 500GB container it requires about 20-30 minutes. That probably mean that running containers always has the "dirty" flag on on quota files?
  • rsync options. We noticed "vzmigrate" uses many options, such as -H, --numeric-ids, etc. Wondering if those rsync options should be always used.
  • using vzmigrate (with "-r no") to transfer VZ containers to the spare and back to main server works, however we noticed after using vzmigrate the next rsync from main to spare causes an almost complete re-sync of /var/lib/vz/private. Probably something related to the rsync options?
  • vzquota long recalculation is very long also when using vzmigrate.
Would be glad to sahre experience and suggestions about this.
Cheers,
Andrea
 

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!