38
edits
Changes
m
command. During online migration all VE private data saved to an image file, which is transferred to the target host.
command.
command.
command.
This looks even better
== Online migration ==
There is a special utility vzmigrate in the OpenVZ distribution intended to support VE migration. With its help one can perform live (a.k.a. online) migration, i.e. during migration the VE “freezes” for some time, and after migration it continues to work as though nothing had happened. Online migration can be performed with the:
<pre>vzmigrate --online <host> VEID</pre>
In order for vzmigrate to work without asking for a password, ssh public keys from the source host should be placed in the destination host's <code>/root/.ssh/authorized_keys</code> file. In other words, command <code>ssh root@host</code> should not ask you for a password. See [[ssh keys]] for more info.
<code>vzmigrate</code> is not strictly required to perform online migration. The <code>vzctl</code> utility, accompanied with some file system backup tools, provides enough power to do all the tasks.
A VE can be checkpointed with command:
<pre>vzctl chkpnt VEID --dumpfile <path></pre>
This command saves all the state of a running VE to the dump file and stops the VE. If the option <code>--dumpfile</code> is not set, <code>vzctl</code> uses a default path <code>/vz/dump/Dump.VEID</code>.
The process of checkpointing can be performed in stages. It consists of three steps.
First step – suspend the VE. At this stage CPT moves all the processes to a special beforehand known state and stops VE network interfaces. This stage can be done with the:
<pre>vzctl chkpnt VEID --suspend</pre>
Second step – dumping VE. At this stage CPT saves the state of processes and global state of VE to an image file. All the process private data needs to be saved: address space, register set, opened files/pipes/sockets, System V IPC structures, current working directory, signal handlers, timers, terminal settings, user identities (uid, gid, etc), process identities (pid, pgrp, sid, etc), rlimit and other data. This stage can be done with the:
<pre>vzctl chkpnt VEID --dump --dumpfile <path></pre>
Third step – killing or resuming processes. If the migration succeeds the VE can be stopped with the command:
The process of restoring consists of two steps.
The first step is to restore processes and to leave them in a special frozen state. After this step processes are ready to continue execution, however, in some cases CPT has to do some operations after a process is woken up, therefore CPT sets process return point to function in our module. This stage can be done with the:
<pre>vzctl restore VEID --undump --dumpfile <path></pre>
Second step – waking up processes or killing them if the restore process failed. After CPT wakes up process, it performs necessary operations in our function and continues execution. This stage can be done with the:<pre>vzctl restore VEID --resume</pre>or<pre>vzctl restore VEID --kill</pre>commands.
[[Category: Technology]]
[[Category: Concepts]]