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:
Cheers,
Andrea
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:
- take a LVM snapshot of /var/lib/vz/private
- scp of quota files from /var/lib/vzquota
- scp of tarred configuration files from /var/lib/vz/conf files
- loop trough "vzlist -Ha -o ctid" and rsync (with -a option) over spare server
- 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.
Cheers,
Andrea