?

Log in

No account? Create an account

Previous Entry | Next Entry

OpenVZ upgrade and migration script

Author: Andre Moruga

Every now and then our team is asked question "How do I move a container created on OpenVZ to Virtuozzo"? This is one of the issues which will be finally resolved in version 7 that we are now working on (first technical preview is just out). In this version the compatibility will be on binary and transfer protocol levels. So the regular mechanisms (like container migration) will work out of the box.
In prior version this task, although not technically difficult, is not very straightforward, the data images cannot be simply moved - depending on configuration used in OpenVZ, they may be incompatible.Besides, an OpenVZ based container will have configuration that needs to be updated to fit the new platform.
To facilitate such migrations, we created a script which automates all these operations: data transfer, migrating container configuration, and tuning configuration to ensure container will work on the new platform.
The script is available at https://src.openvz.org/projects/OVZL/repos/ovztransfer/browse/ovztransfer.sh. Its usage is simple: run it in the source (old) node, and specify destination host IP and list of containers to be migrated:

 $ ./ovztransfer.sh TARGET_HOST SOURCE_VEID0:[TARGET_VEID0] ...


For example:

 ./ovztransfer.sh 10.1.1.3 101 102 103


The script has been designed to migrate containers from older OpenVZ versions to v.7; however it should also work migrating data to existing Virtuozzo versions (like 6.0).
There is one restriction: containers based on obsolete templates that do not exist on the destination servers will be transferred as "not template based" - which means tools for template management (like adding an application via vzpkg) won't work for them.
This is a first version of this script; we will have an opportunity to improve it before the final release. That's why your feedback (or even code contributions) is important here.
If you tried it and want to share your thoughts, email to OpenVZ user group at users@openvz.org.

Tags:

Comments

( 2 comments — Leave a comment )
dowdle
Aug. 7th, 2015 10:42 pm (UTC)
Trying out ovztransfer.sh
I tried it and was able to migrate a CentOS 7 container... but the Fedora 22 one seems to be stuck in the "started" phase. It creates a /vz/private/{ctid} dir on the destination host (with the same ctid from the OpenVZ Legacy host rather than a hash-looking UUID) but nothing seems to get transferred there as a du -sh of the dir shows 4K. It starts up the container on the source system... but since there are 12 processes still running inside of it, I'm guessing it stalled as killing as much as possible... which seems to be a step. Anyway.
estetus
Aug. 8th, 2015 04:21 am (UTC)
Re: Trying out ovztransfer.sh
Scott, please submit a bug for Fedora 22 template.
( 2 comments — Leave a comment )

Latest Month

July 2016
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      
Powered by LiveJournal.com
Designed by Tiffany Chow