Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Migration from one HN to another

61 bytes added, 12:30, 30 April 2008
simplify "migrate all" script; add list; add sections; add {{wikify}}
{{wikify}} The vzmigrate script is used to migrate a Virutal Environment [[container]] from one [[Hardware Node ]] to another. == Setting up SSH keys ==
You first have to setup SSH to permit the old HN to be able to login to the new HN without a password prompt. Run the following on the old HN.
[root@Char ~]# exit</pre>
== Prerequisites == Make sure :* you have at least one good backup of the following:virtual machine you intend to migrate* rsync is installed on the target host* remove_area=1 is changed to remove_area=0 in vzmigrate script
<pre>- you have at least one good backup of the virtual machine you intend to migrate- rsync is installed on the target host- remove_area=1 is changed to remove_area=0 in vzmigrate script</pre>usage ==
Now that the vzmigrate script will function, a little bit on vzmigrate.
its progress (including some time statistics).</pre>
=== Example ===
Here is an example of migrating container 101 from the current HN to one at 10.1.5.6:
Cleanup</pre>
== Migrate all running containers ==
Here's a simple shell script that will migrate each container one after another. Just pass the destination host node as the single argument to the script. Feel free to add the -v flag to the vzmigrate flags if you'd like to see it execute with the verbose option:
<pre>#!/bin/bash for CT in $(vzlist | tail -n +2 | awk 'BEGIN { } /.*/ { print $1 }' | xargs H -n1 o veid); do vzmigrate --remove-area no --keep-dst $1</pre>$CT; done
[[Category:HOWTO]]