2013-05-01 20:21:50 -07:00
|
|
|
CRIU(8)
|
2013-05-01 20:21:47 -07:00
|
|
|
=======
|
2016-03-16 18:26:00 +03:00
|
|
|
include::footer.txt[]
|
2012-01-28 18:45:28 +04:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2013-05-01 20:21:47 -07:00
|
|
|
criu - checkpoint/restore in userspace
|
2012-01-28 18:45:28 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
2012-01-28 18:45:28 +04:00
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2016-09-23 12:08:14 -07:00
|
|
|
*criu* 'command' ['option' ...]
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
2012-01-28 18:45:28 +04:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*criu* is a tool for checkpointing and restoring running applications.
|
2016-09-23 12:08:14 -07:00
|
|
|
It does this by saving their state as a collection of files (see the *dump*
|
|
|
|
command) and creating equivalent processes from those files (see the *restore*
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
command). The restore operation can be performed at a later time,
|
|
|
|
on a different system, or both.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2013-05-01 20:21:52 -07:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
OPTIONS
|
|
|
|
-------
|
2014-02-21 22:14:02 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
Common options
|
|
|
|
~~~~~~~~~~~~~~
|
2016-09-23 12:08:14 -07:00
|
|
|
Common options are applicable to any 'command'.
|
2013-05-01 20:21:52 -07:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*-v*['num'|*v*...]::
|
|
|
|
Set logging level to 'num'. The higher the level, the more output
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
is produced. Either numeric values or multiple *v* can be used.
|
|
|
|
+
|
|
|
|
The following levels are available:
|
|
|
|
* *-v1*, *-v*
|
|
|
|
only messages and errors;
|
|
|
|
* *-v2*, *-vv*
|
|
|
|
also warnings (default level);
|
|
|
|
* *-v3*, *-vvv*
|
|
|
|
also information messages and timestamps;
|
|
|
|
* *-v4*, *-vvvv*
|
|
|
|
lots of debug.
|
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--pidfile* 'file'::
|
|
|
|
Write root task, service or page-server pid into a 'file'.
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*-o*, *--log-file* 'file'::
|
|
|
|
Write logging messages to 'file'.
|
2013-05-01 20:21:52 -07:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*--log-pid*::
|
|
|
|
Write separate logging files per each pid.
|
2013-05-01 20:21:52 -07:00
|
|
|
|
2016-10-13 10:41:00 +03:00
|
|
|
*--display-stats*::
|
|
|
|
During dump as well as during restore *criu* collects information
|
|
|
|
like the time required to dump or restore the process or the
|
|
|
|
number of pages dumped or restored. This information is always
|
|
|
|
written to the files 'stats-dump' and 'stats-restore' and can
|
|
|
|
be easily displayed using *crit*. The option *--display-stats*
|
|
|
|
additionally prints out this information on the console at the end
|
|
|
|
of a dump or a restore.
|
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*-D*, *--images-dir* 'path'::
|
|
|
|
Use 'path' as a base directory where to look for sets of image files.
|
2013-05-01 20:21:52 -07:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--prev-images-dir* 'path'::
|
|
|
|
Use 'path' as a parent directory where to look for sets of image files.
|
|
|
|
This option makes sense in case of incremental dumps.
|
2013-05-01 20:21:52 -07:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*-W*, *--work-dir* 'dir'::
|
|
|
|
Use directory 'dir' for putting logs, pidfiles and statistics. If not
|
|
|
|
specified, 'path' from *-D* option is taken.
|
2013-05-01 20:21:52 -07:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--close* 'fd'::
|
|
|
|
Close file descriptor 'fd' before performing any actions.
|
2013-11-01 14:29:12 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*-L*, *--libdir* 'path'::
|
|
|
|
Path to plugins directory.
|
2014-02-21 22:14:01 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--action-script* 'script'::
|
|
|
|
Add an external action script to be executed at certain stages.
|
|
|
|
The environment variable *CRTOOLS_SCRIPT_ACTION* is available
|
|
|
|
to the script to find out which action is being executed, and
|
|
|
|
its value can be one of the following:
|
|
|
|
*pre-dump*:::
|
|
|
|
run prior to beginning a *dump*
|
2015-10-08 16:21:00 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*post-dump*:::
|
|
|
|
run upon *dump* completion
|
2014-10-01 18:56:41 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*pre-restore*:::
|
|
|
|
run prior to beginning a *restore*
|
2015-10-08 16:21:00 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*post-restore*:::
|
|
|
|
run upon *restore* completion
|
2014-10-01 18:56:41 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*network-lock*:::
|
|
|
|
run to lock network in a target network namespace
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*network-unlock*:::
|
|
|
|
run to unlock network in a target network namespace
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*setup-namespaces*:::
|
|
|
|
run once root task just been created
|
|
|
|
with required namespaces. Note it is an early stage
|
|
|
|
of restore, when nothing is restored yet except for namespaces
|
|
|
|
themselves
|
2015-04-03 18:03:46 +03:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*-V*, *--version*::
|
|
|
|
Print program version and exit.
|
2014-02-21 22:14:03 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*-h*, *--help*::
|
2016-09-23 12:08:14 -07:00
|
|
|
Print some help and exit.
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
|
|
|
*pre-dump*
|
|
|
|
~~~~~~~~~~
|
2016-09-23 12:08:14 -07:00
|
|
|
Performs the pre-dump procedure, during which *criu* creates a snapshot of
|
|
|
|
memory changes since the previous *pre-dump*. Note that during this
|
|
|
|
*criu* also creates the fsnotify cache which speeds up the *restore*
|
|
|
|
procedure. *pre-dump* requires at least *-t* option (see *dump* below).
|
|
|
|
In addition, *page-server* options may be specified.
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
|
|
|
*--track-mem*::
|
|
|
|
Turn on memory changes tracker in the kernel. If the option is
|
|
|
|
not passed the memory tracker get turned on implicitly.
|
|
|
|
|
|
|
|
*dump*
|
|
|
|
~~~~~~
|
2016-09-23 12:08:14 -07:00
|
|
|
Performs a checkpoint procedure.
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*-t*, *--tree* 'pid'::
|
|
|
|
Checkpoint the whole process tree starting from 'pid'.
|
2012-04-16 20:36:00 +04:00
|
|
|
|
2013-11-01 00:50:49 +04:00
|
|
|
*-R*, *--leave-running*::
|
2016-09-23 12:08:14 -07:00
|
|
|
Leave tasks in running state after checkpoint, instead of killing. This
|
|
|
|
option is pretty dangerous and should be used only if you understand
|
2013-11-01 00:50:49 +04:00
|
|
|
what you are doing.
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
+
|
2016-09-23 12:08:14 -07:00
|
|
|
Note if task is about to run after been checkpointed, it can modify
|
|
|
|
TCP connections, delete files and do other dangerous actions. Therefore,
|
|
|
|
*criu* can not guarantee that the next *restore* action will succeed.
|
|
|
|
Most likely if this option is used, at least the file system snapshot
|
|
|
|
must be made with the help of *post-dump* action script.
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
+
|
2016-09-23 12:08:14 -07:00
|
|
|
In other words, do not use it unless really needed.
|
2014-09-30 21:18:46 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*-s*, *--leave-stopped*::
|
2016-09-23 12:08:14 -07:00
|
|
|
Leave tasks in stopped state after checkpoint, instead of killing.
|
2014-09-30 21:18:46 +04:00
|
|
|
|
2016-11-02 10:59:12 -07:00
|
|
|
*--external* 'type'*[*'id'*]:*'value'::
|
|
|
|
Dump an instance of an external resource. The generic syntax is
|
|
|
|
'type' of resource, followed by resource 'id' (enclosed in literal
|
|
|
|
square brackets), and optional 'value' (prepended by a literal semicolon).
|
|
|
|
The following resource types are currently supported: *mnt*, *dev*,
|
|
|
|
*file*, *tty*, *unix*. Syntax depends on type.
|
|
|
|
Note to restore external resources, either *--external* or *--inherit-fd*
|
|
|
|
is used, depending on resource type.
|
|
|
|
|
|
|
|
*--external mnt[*'mountpoint'*]:*'name'::
|
|
|
|
Dump an external bind mount referenced by 'mountpoint', saving it
|
|
|
|
to image under the identifier 'name'.
|
|
|
|
|
|
|
|
*--external mnt[]:*'flags'::
|
|
|
|
Dump all external bind mounts, autodetecting those. Optional 'flags'
|
|
|
|
can contain *m* to also dump external master mounts, *s* to also
|
|
|
|
dump external shared mounts (default behavior is to abort dumping
|
|
|
|
if such mounts are found). If 'flags' are not provided, semicolon
|
|
|
|
is optional.
|
|
|
|
|
|
|
|
*--external dev[*'major'*/*'minor'*]:*'name'::
|
|
|
|
Allow to dump a mount namespace having a real block device mounted.
|
|
|
|
A block device is identified by its 'major' and 'minor' numbers,
|
|
|
|
and *criu* saves its information to image under the identifier 'name'.
|
|
|
|
|
|
|
|
*--external file[*'mnt_id'*:*'inode'*]*::
|
|
|
|
Dump an external file, i.e. an opened file that is can not be resolved
|
|
|
|
from the current mount namespace, which can not be dumped without using
|
|
|
|
this option. The file is identified by 'mnt_id' (a field obtained from
|
|
|
|
*/proc/*'pid'*/fdinfo/*'N') and 'inode' (as returned by *stat*(2)).
|
|
|
|
|
|
|
|
*--external tty[*'rdev'*:*'dev'*]*::
|
|
|
|
Dump an external TTY, identified by *st_rdev* and *st_dev* fields
|
|
|
|
returned by *stat*(2).
|
|
|
|
|
|
|
|
*--external unix[*'id'*]*::
|
|
|
|
Tell *criu* that one end of a pair of UNIX sockets (created by
|
|
|
|
*socketpair*(2)) with 'id' is OK to be disconnected.
|
|
|
|
|
2015-09-07 12:29:00 +03:00
|
|
|
*--freeze-cgroup*::
|
|
|
|
Use cgroup freezer to collect processes.
|
2014-09-30 21:18:46 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*--manage-cgroups*::
|
|
|
|
Collect cgroups into the image thus they gonna be restored then.
|
2016-09-23 12:08:14 -07:00
|
|
|
Without this option, *criu* will not save cgroups configuration
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
associated with a task.
|
2014-01-31 13:05:44 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--cgroup-props* 'spec'::
|
|
|
|
Specify controllers and their properties to be saved into the
|
|
|
|
image file. *criu* predefines specifications for common controllers,
|
2016-05-13 23:03:44 +03:00
|
|
|
but since the kernel can add new controllers and modify their
|
2016-09-23 12:08:14 -07:00
|
|
|
properties, there should be a way to specify ones matched the kernel.
|
2016-05-13 23:03:44 +03:00
|
|
|
+
|
2016-09-23 12:08:14 -07:00
|
|
|
'spec' argument describes the controller and properties specification in
|
|
|
|
a simplified YAML form:
|
2016-05-13 23:03:44 +03:00
|
|
|
+
|
|
|
|
----------
|
|
|
|
"c1":
|
|
|
|
- "strategy": "merge"
|
|
|
|
- "properties": ["a", "b"]
|
|
|
|
"c2":
|
|
|
|
- "strategy": "replace"
|
|
|
|
- "properties": ["c", "d"]
|
|
|
|
----------
|
|
|
|
+
|
2016-09-23 12:08:14 -07:00
|
|
|
where 'c1' and 'c2' are controllers names, and 'a', 'b', 'c', 'd' are
|
2016-05-13 23:03:44 +03:00
|
|
|
their properties.
|
|
|
|
+
|
2016-09-23 12:08:14 -07:00
|
|
|
Note the format: double quotes, spaces and new lines are required.
|
|
|
|
The 'strategy' specifies what to do if a controller specified already
|
|
|
|
exists as a built-in one: *criu* can either *merge* or *replace* such.
|
2016-05-13 23:03:44 +03:00
|
|
|
+
|
2016-09-23 12:08:14 -07:00
|
|
|
For example, the command line for the above example should look like this:
|
2016-05-13 23:03:44 +03:00
|
|
|
+
|
|
|
|
----------
|
|
|
|
--cgroup-props "\"c1\":\n - \"strategy\": \"merge\"\n - \"properties\": [\"a\", \"b\"]\n \"c2\":\n - \"strategy\": \"replace\"\n - \"properties\": [\"c\", \"d\"]"
|
|
|
|
----------
|
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--cgroup-props-file* 'file'::
|
|
|
|
Same as *--cgroup-props*, except the specification is read from
|
|
|
|
the 'file'.
|
2016-05-13 23:03:44 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--cgroup-dump-controller* 'name'::
|
|
|
|
Dump a controller with 'name' only, skipping anything else that was
|
|
|
|
discovered automatically (usually via */proc*). This option is
|
|
|
|
useful when one needs *criu* to skip some controllers.
|
2016-05-13 23:03:00 +03:00
|
|
|
|
2016-05-13 23:03:44 +03:00
|
|
|
*--cgroup-props-ignore-default*::
|
2016-09-23 12:08:14 -07:00
|
|
|
When combined with *--cgroup-props*, makes *criu* substitute
|
|
|
|
a predefined controller property with the new one shipped. If the option
|
|
|
|
is not used, the predefined properties are merged with the provided ones.
|
2016-05-13 23:03:44 +03:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*--tcp-established*::
|
|
|
|
Checkpoint established TCP connections.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2016-06-20 23:15:00 +03:00
|
|
|
*--skip-in-flight*::
|
2016-09-23 12:08:14 -07:00
|
|
|
This option skips in-flight TCP connections. If any TCP connections
|
|
|
|
that are not yet completely established are found, *criu* ignores
|
|
|
|
these connections, rather than errors out.
|
2016-06-20 23:15:00 +03:00
|
|
|
The TCP stack on the client side is expected to handle the
|
|
|
|
re-connect gracefully.
|
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*--evasive-devices*::
|
|
|
|
Use any path to a device file if the original one is inaccessible.
|
|
|
|
|
|
|
|
*--page-server*::
|
2016-09-23 12:08:14 -07:00
|
|
|
Send pages to a page server (see the *page-server* command).
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
|
|
|
*--force-irmap*::
|
|
|
|
Force resolving names for inotify and fsnotify watches.
|
|
|
|
|
|
|
|
*--auto-dedup*::
|
2016-09-23 12:08:14 -07:00
|
|
|
Deduplicate "old" data in pages images of previous *dump*. This option
|
|
|
|
implies incremental *dump* mode (see the *pre-dump* command).
|
2012-07-23 07:08:48 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*-l*, *--file-locks*::
|
|
|
|
Dump file locks. It is necessary to make sure that all file lock users
|
2016-06-20 23:15:00 +03:00
|
|
|
are taken into dump, so it is only safe to use this for enclosed containers
|
2016-09-23 12:08:14 -07:00
|
|
|
where locks are not held by any processes outside of dumped process tree.
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
|
|
|
*--link-remap*::
|
2016-09-23 12:08:14 -07:00
|
|
|
Allows to link unlinked files back, if possible (modifies filesystem
|
|
|
|
during *restore*).
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
2015-08-10 12:44:03 +03:00
|
|
|
*--ghost-limit* 'size'::
|
2016-09-23 12:08:14 -07:00
|
|
|
Set the maximum size of deleted file to be carried inside image.
|
|
|
|
By default, up to 1M file is allowed. Using this
|
|
|
|
option allows to not put big deleted files inside images. Argument
|
|
|
|
'size' may be postfixed with a *K*, *M* or *G*, which stands for kilo-,
|
|
|
|
mega, and gigabytes, accordingly.
|
2015-08-10 12:44:03 +03:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*-j*, *--shell-job*::
|
2016-09-23 12:08:14 -07:00
|
|
|
Allow one to dump shell jobs. This implies the restored task will
|
|
|
|
inherit session and process group ID from the *criu* itself.
|
|
|
|
This option also allows to migrate a single external tty connection,
|
|
|
|
to migrate applications like *top*. If used with *dump* command,
|
|
|
|
it must be specified with *restore* as well.
|
|
|
|
|
|
|
|
*--cpu-cap* ['cap'[,'cap'...]]::
|
|
|
|
Specify CPU capabilities to write to an image file. The argument is a
|
|
|
|
comma-separated list of *none*, *fpu*, *cpu*, *ins*, *all*. If the
|
|
|
|
argument is omitted or set to *none*, capabilities will not be written,
|
|
|
|
which is the default behavior.
|
|
|
|
|
|
|
|
*--cgroup-root* ['controller':]/'newroot'::
|
|
|
|
Change the root for the controller that will be dumped. By default, *criu*
|
2016-09-20 18:08:21 +00:00
|
|
|
simply dumps everything below where any of the tasks live. However, if a
|
|
|
|
container moves all of its tasks into a cgroup directory below the container
|
|
|
|
engine's default directory for tasks, permissions will not be preserved on
|
|
|
|
the upper directories with no tasks in them, which may cause problems.
|
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*restore*
|
|
|
|
~~~~~~~~~
|
|
|
|
Restores previously checkpointed processes.
|
|
|
|
|
2016-11-02 10:59:09 -07:00
|
|
|
*--inherit-fd* *fd[*'N'*]:*'resource'::
|
|
|
|
Inherit a file descriptor. This option lets *criu* use an already opened
|
2016-11-03 08:40:00 +03:00
|
|
|
file descriptor 'N' for restoring a file identified by 'resource'.
|
2016-11-02 10:59:09 -07:00
|
|
|
This option can be used to restore an external resource dumped
|
|
|
|
with the help of *--external* *file*, *tty*, and *unix* options.
|
|
|
|
+
|
|
|
|
The 'resource' argument can be one of the following:
|
|
|
|
+
|
|
|
|
- *tty[*'rdev'*:*'dev'*]*
|
|
|
|
- *pipe[*'inode'*]*
|
|
|
|
- *socket[*'inode'*]*
|
|
|
|
- *file[*'mnt_id'*:*'inode'*]*
|
|
|
|
- 'path/to/file'
|
|
|
|
|
|
|
|
+
|
|
|
|
Note that square brackets used in this option arguments are literals and
|
|
|
|
usually need to be escaped from shell.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2013-05-01 20:21:53 -07:00
|
|
|
*-d*, *--restore-detached*::
|
2013-05-01 20:21:51 -07:00
|
|
|
Detach *criu* itself once restore is complete.
|
2012-01-29 00:39:57 +04:00
|
|
|
|
2016-10-18 18:51:00 +03:00
|
|
|
*-s*, *--leave-stopped*::
|
|
|
|
Leave tasks in stopped state after restore (rather than resuming
|
|
|
|
their execution).
|
|
|
|
|
2015-04-03 18:03:46 +03:00
|
|
|
*-S*, *--restore-sibling*::
|
2016-09-23 12:08:14 -07:00
|
|
|
Restore root task as a sibling (makes sense only with
|
|
|
|
*--restore-detached*).
|
2015-04-03 18:03:46 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*-r*, *--root* 'path'::
|
|
|
|
Change the root filesystem to 'path' (when run in a mount namespace).
|
2012-01-29 00:39:57 +04:00
|
|
|
|
2016-11-02 10:59:12 -07:00
|
|
|
*--external* 'type'*[*'id'*]:*'value'::
|
|
|
|
Restore an instance of an external resource. The generic syntax is
|
|
|
|
'type' of resource, followed by resource 'id' (enclosed in literal
|
|
|
|
square brackets), and optional 'value' (prepended by a literal semicolon).
|
|
|
|
The following resource types are currently supported: *mnt*, *dev*,
|
|
|
|
*veth*, *macvlan*. Syntax depends on type. Note to restore external
|
|
|
|
resources dealing with opened file descriptors (such as dumped with
|
|
|
|
the help of *--external* *file*, *tty*, and *unix* options), option
|
|
|
|
*--inherit-fd* should be used.
|
|
|
|
|
|
|
|
*--external mnt[*'name'*]:*'mountpoint'::
|
|
|
|
Restore an external bind mount referenced in the image by 'name',
|
|
|
|
bind-mounting it from the host 'mountpoint' to a proper mount point.
|
|
|
|
|
|
|
|
*--external mnt[]*::
|
|
|
|
Restore all external bind mounts (dumped with the help of
|
|
|
|
*--external mnt[]* auto-detection).
|
|
|
|
|
|
|
|
*--external dev[*'name'*]:*'/dev/path'::
|
|
|
|
Restore an external mount device, identified in the image by 'name',
|
|
|
|
using the existing block device '/dev/path'.
|
|
|
|
|
|
|
|
*--external veth[*'inner_dev'*]:*'outer_dev'*@*'bridge'::
|
|
|
|
Set the outer VETH device name (corresponding to 'inner_dev' being
|
|
|
|
restored) to 'outer_dev'. If optional *@*'bridge' is specified,
|
|
|
|
'outer_dev' is added to that bridge. If the option is not used,
|
|
|
|
'outer_dev' will be autogenerated by the kernel.
|
|
|
|
|
|
|
|
*--external macvlan[*'inner_dev'*]:*'outer_dev'::
|
|
|
|
When restoring an image that have a MacVLAN device in it, this option
|
|
|
|
must be used to specify to which 'outer_dev' (an existing network device
|
|
|
|
in CRIU namespace) the restored 'inner_dev' should be bound to.
|
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--manage-cgroups* ['mode']::
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
Restore cgroups configuration associated with a task from the image.
|
2016-09-23 12:08:14 -07:00
|
|
|
Controllers are always restored in an optimistic way -- if already present
|
|
|
|
in system, *criu* reuses it, otherwise it will be created.
|
2015-06-11 20:04:03 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
The 'mode' may be one of the following:
|
|
|
|
|
|
|
|
*none*::: Do not restore cgroup properties but require cgroup to
|
2015-06-11 20:04:03 +03:00
|
|
|
pre-exist at the moment of *restore* procedure.
|
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*props*::: Restore cgroup properties and require cgroup to pre-exist.
|
2015-06-11 20:04:03 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*soft*::: Restore cgroup properties if only cgroup has been created
|
2016-06-20 23:15:00 +03:00
|
|
|
by *criu*, otherwise do not restore properties. This is the
|
2016-01-20 10:27:38 -07:00
|
|
|
default if mode is unspecified.
|
2015-06-11 20:04:03 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*full*::: Always restore all cgroups and their properties.
|
2015-06-11 20:04:03 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*strict*::: Restore all cgroups and their properties from the scratch,
|
2015-06-11 20:04:03 +03:00
|
|
|
requiring them to not present in the system.
|
2012-09-19 17:04:27 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--cgroup-root* ['controller'*:*]/'newroot'::
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
Change the root cgroup the controller will be installed into. No controller
|
|
|
|
means that root is the default for all controllers not specified.
|
2012-09-19 17:04:27 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*--tcp-established*::
|
|
|
|
Restore previously dumped established TCP connections. This implies that
|
|
|
|
the network has been locked between *dump* and *restore* phases so other
|
|
|
|
side of a connection simply notice a kind of lag.
|
2015-04-03 18:03:46 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--veth-pair* 'IN'*=*'OUT'::
|
2012-09-19 17:04:27 +04:00
|
|
|
Correspondence between outside and inside names of veth devices.
|
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*-l*, *--file-locks*::
|
|
|
|
Restore file locks from the image.
|
2014-06-09 17:26:17 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*--auto-dedup*::
|
|
|
|
As soon as a page is restored it get punched out from image.
|
2012-09-19 17:04:27 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*-j*, *--shell-job*::
|
|
|
|
Restore shell jobs, in other words inherit session and process group
|
|
|
|
ID from the criu itself.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--cpu-cap* ['cap'[,'cap'...]]::
|
|
|
|
Specify CPU capabilities to be present on the CPU the process is
|
|
|
|
restoring. To inverse a capability, prefix it with *^*. This option implies
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
that *--cpu-cap* has been passed on *dump* as well, except *fpu* option
|
2016-09-23 12:08:14 -07:00
|
|
|
case. The 'cap' argument can be the following (or a set of comma-separated
|
|
|
|
values):
|
2012-02-17 22:51:23 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*all*::: Require all capabilities. This is *default* mode if *--cpu-cap*
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
is passed without arguments. Most safe mode.
|
2012-07-23 07:08:48 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*cpu*::: Require the CPU to have all capabilities in image to match
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
runtime CPU.
|
2012-07-23 07:08:48 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*fpu*::: Require the CPU to have compatible FPU. For example the process
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
might be dumped with xsave capability but attempted to restore
|
|
|
|
without it present on target CPU. In such case we refuse to
|
2016-06-20 23:15:00 +03:00
|
|
|
proceed. This is *default* mode if *--cpu-cap* is not present
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
in command line. Note this argument might be passed even if
|
2016-06-20 23:15:00 +03:00
|
|
|
on the *dump* no *--cpu-cap* have been specified because FPU
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
frames are always encoded into images.
|
2012-07-23 07:08:48 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*ins*::: Require CPU compatibility on instructions level.
|
2012-10-18 19:47:17 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*none*::: Ignore capabilities. Most dangerous mode. The behaviour is
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
implementation dependent. Try to not use it until really
|
|
|
|
required.
|
|
|
|
+
|
2016-09-23 12:08:14 -07:00
|
|
|
For example, this option can be used in case *--cpu-cap=cpu* was used
|
|
|
|
during *dump*, and images are migrated to a less capable CPU and are
|
|
|
|
to be restored. By default, *criu* shows an error that CPU capabilities
|
|
|
|
are not adequate, but this can be suppressed by using *--cpu-cap=none*.
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
2016-12-01 09:43:00 +03:00
|
|
|
*--weak-sysctls*::
|
|
|
|
Silently skip restoring sysctls that are not available. This allows
|
|
|
|
to restore on an older kernel, or a kernel configured without some
|
|
|
|
options.
|
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*check*
|
|
|
|
~~~~~~~
|
2016-09-23 12:08:14 -07:00
|
|
|
Checks whether the kernel supports the features needed by *criu* to
|
|
|
|
dump and restore a process tree.
|
2013-01-17 16:09:35 +08:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
There are three categories of kernel support, as described below. *criu
|
2016-03-17 00:38:00 +03:00
|
|
|
check* always checks Category 1 features unless *--feature* is specified
|
2016-09-23 12:08:14 -07:00
|
|
|
which only checks a specified feature.
|
2016-03-17 00:38:00 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*Category 1*::: Absolutely required. These are features like support for
|
|
|
|
*/proc/PID/map_files*, *NETLINK_SOCK_DIAG* socket
|
|
|
|
monitoring, */proc/sys/kernel/ns_last_pid* etc.
|
2016-03-17 00:38:00 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*Category 2*::: Required only for specific cases. These are features
|
|
|
|
like AIO remap, */dev/net/tun* and others that are only
|
|
|
|
required if a process being dumped or restored
|
|
|
|
is using those.
|
2016-03-17 00:38:00 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*Category 3*::: Experimental. These are features like *task-diag* that
|
2016-03-17 00:38:00 +03:00
|
|
|
are used for experimental purposes (mostly
|
|
|
|
during development).
|
|
|
|
|
|
|
|
If there are no errors or warnings, *criu* prints "Looks good." and its
|
2016-09-23 12:08:14 -07:00
|
|
|
exit code is 0.
|
2016-03-17 00:38:00 +03:00
|
|
|
|
|
|
|
A missing Category 1 feature causes *criu* to print "Does not look good."
|
2016-09-23 12:08:14 -07:00
|
|
|
and its exit code is non-zero.
|
2016-03-17 00:38:00 +03:00
|
|
|
|
|
|
|
Missing Category 2 and 3 features cause *criu* to print "Looks good but
|
2016-09-23 12:08:14 -07:00
|
|
|
..." and its exit code is be non-zero.
|
2016-03-17 00:38:00 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
Without any options, *criu check* checks Category 1 features. This
|
|
|
|
behavior can be changed by using the following options:
|
2016-03-17 00:38:00 +03:00
|
|
|
|
|
|
|
*--extra*::
|
|
|
|
Check kernel support for Category 2 features.
|
|
|
|
|
|
|
|
*--experimental*::
|
|
|
|
Check kernel support for Category 3 features.
|
|
|
|
|
|
|
|
*--all*::
|
|
|
|
Check kernel support for Category 1, 2, and 3 features.
|
2013-04-30 20:08:56 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--feature* 'name'::
|
|
|
|
Check a specific feature. If 'name' is *list*, a list of valid
|
2016-03-17 00:38:00 +03:00
|
|
|
kernel feature names that can be checked will be printed.
|
2015-04-03 18:03:46 +03:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*page-server*
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
Launches *criu* in page server mode.
|
2015-04-03 18:03:46 +03:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*--daemon*::
|
|
|
|
Runs page server as a daemon (background process).
|
2013-04-30 20:08:55 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--address* 'address'::
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
Page server IP address.
|
2013-04-30 20:08:55 +04:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
*--port* 'number'::
|
2013-04-30 20:08:55 +04:00
|
|
|
Page server port number.
|
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*exec*
|
|
|
|
~~~~~~
|
2016-09-23 12:08:14 -07:00
|
|
|
Executes a system call inside a destination task\'s context. This functionality
|
2016-11-03 08:40:00 +03:00
|
|
|
is deprecated; please use *Compel* instead.
|
2015-04-03 18:03:46 +03:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
*service*
|
|
|
|
~~~~~~~~~
|
2016-09-23 12:08:14 -07:00
|
|
|
Launches *criu* in RPC daemon mode, where *criu* is listening for
|
|
|
|
RPC commands over socket to perform. This is convenient for a
|
|
|
|
case where daemon itself is running in a privileged (superuser) mode
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
but clients are not.
|
2015-04-03 18:03:46 +03:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
dedup
|
|
|
|
~~~~~
|
|
|
|
Starts pagemap data deduplication procedure, where *criu* scans over all
|
2016-06-20 23:15:00 +03:00
|
|
|
pagemap files and tries to minimize the number of pagemap entries by
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
obtaining the references from a parent pagemap image.
|
2015-04-03 18:03:46 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
cpuinfo dump
|
|
|
|
~~~~~~~~~~~~
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
Fetches current CPU features and write them into an image file.
|
2015-04-03 18:03:46 +03:00
|
|
|
|
2016-09-23 12:08:14 -07:00
|
|
|
cpuinfo check
|
|
|
|
~~~~~~~~~~~~~
|
|
|
|
Fetches current CPU features (i.e. CPU the *criu* is running on) and test if
|
|
|
|
they are compatible with the ones present in an image file.
|
2012-12-18 00:39:20 +03:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
2012-07-23 07:09:39 +04:00
|
|
|
EXAMPLES
|
|
|
|
--------
|
2013-05-01 20:21:59 -07:00
|
|
|
To checkpoint a program with pid of *1234* and write all image files into
|
|
|
|
directory *checkpoint*:
|
2012-07-23 07:09:39 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
----------
|
2013-05-01 20:21:47 -07:00
|
|
|
criu dump -D checkpoint -t 1234
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
----------
|
2012-07-23 07:09:39 +04:00
|
|
|
|
2013-05-01 20:21:59 -07:00
|
|
|
To restore this program detaching criu itself:
|
2012-07-23 07:09:39 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
----------
|
2015-03-19 13:18:13 +03:00
|
|
|
criu restore -d -D checkpoint
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
----------
|
2012-12-18 00:39:20 +03:00
|
|
|
|
|
|
|
|
2012-01-28 18:45:28 +04:00
|
|
|
AUTHOR
|
|
|
|
------
|
2016-09-23 12:08:14 -07:00
|
|
|
The CRIU team.
|
2012-01-28 18:45:28 +04:00
|
|
|
|
docs: Rework the manual, v2
I think this might be more readable if we group options
by the commands. So here is the result. Please read and
tell me what you think.
I put formatted manual here because read diff itself
is almost impossible.
v2:
- update description
- use </> for commands
- various formatting and text nitpicks
| CRIU(8) CRIU Manual CRIU(8)
|
|
|
| NAME
| criu - checkpoint/restore in userspace
|
| SYNOPSIS
| criu <command> [options]
|
| DESCRIPTION
| criu is a tool for checkpointing and restoring running applications. It
| does this by saving their state as a collection of files (see the dump
| command) and creating equivalent processes from those files (see the
| restore command). The restore operation can be performed at a later
| time, on a different system, or both.
|
| OPTIONS
| The options are depending on the <command> criu run with.
|
| Common options
| Common options are applied to any <command>.
|
| -v[<num>|v...]
| Set logging level to <num>. The higer the level, the more output is
| produced. Either numeric values or multiple v can be used.
|
| The following levels are available:
|
| · -v1, -v only messages and errors;
|
| · -v2, -vv also warnings (default level);
|
| · -v3, -vvv also information messages and timestamps;
|
| · -v4, -vvvv lots of debug.
|
| --pidfile <file>
| Write root task, service or page-server pid into a <file>.
|
| -o, --log-file <file>
| Write logging messages to <file>.
|
| --log-pid
| Write separate logging files per each pid.
|
| -D, --images-dir <path>
| Use path <path> as a base directory where to look for dump files
| set.
|
| --prev-images-dir <path>
| Use path <path> as a parent directory where to look for dump files
| set. This make sence in case of increment dumps.
|
| -W, --work-dir <dir>
| Use directory <dir> for putting logs, pidfiles and statistics. If
| not specified, <path> from -D option is taken.
|
| --close <fd>
| Close file with descriptor <fd> before any actions.
|
| -L, --libdir <path>
| Path to a plugins directory.
|
| --action-script <SCRIPT>
| Add an external action script. The environment variable
| CRTOOLS_SCRIPT_ACTION contains one of the actions:
|
| · post-dump run an action upon dump completion;
|
| · post-restore run an action upon restore completion;
|
| · network-lock lock network in a target network namespace;
|
| · network-unlock unlock network in a target network namespace;
|
| · setup-namespaces run an action once root task just been created
| with required namespaces, note it is early stage on restore
| nothing were restored yet except namespaces themselves.
|
| -V, --version
| Print program version and exit.
|
| -h, --help
| Print a commands list and exit. The commands list is very short one
| just for overview and does not match this manual.
|
| pre-dump
| Launches that named pre-dump procedure, where criu does snapshot of
| memory changes since previous pre-dump. Also criu forms fsnotify cache
| which speedup restore procedure. pre-dump requires at least -t option
| (see dump below). Optionally page-server options may be specified.
|
| --track-mem
| Turn on memory changes tracker in the kernel. If the option is not
| passed the memory tracker get turned on implicitly.
|
| dump
| Starts a checkpoint procedure.
|
| -t, --tree <pid>
| Checkpoint the whole process tree starting from <pid>.
|
| -R, --leave-running
| Leave tasks in running state after checkpoint instead of killing
| them. This option is pretty dangerous and should be used if and
| only if you understand what you are doing.
|
| If task is about to run after been checkpointed it can modify TCP
| connections, delete files and do other dangerous actions. So that
| criu itself can not guarantee that the next restore action will not
| fail. Most likely if a user starts criu with this option passed at
| least the file system snapshot must be done with help of post-dump
| script.
|
| In other words, do not use it until really needed.
|
| -s, --leave-stopped
| Leave tasks in stopped state after checkpoint instead of killing
| them.
|
| -x, --ext-unix-sk
| Dump external unix sockets.
|
| -n, --namespaces <ns>[,<ns>...]
| Checkpoint namespaces. Namespaces must be separated by comma.
| Currently supported namespaces: uts, ipc, mnt, pid, net.
|
| --manage-cgroups
| Collect cgroups into the image thus they gonna be restored then.
| Without this argument criu will not save cgroups configuration
| associated with a task.
|
| --tcp-established
| Checkpoint established TCP connections.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| --evasive-devices
| Use any path to a device file if the original one is inaccessible.
|
| --page-server
| Send pages to a page server (see page-server command).
|
| --force-irmap
| Force resolving names for inotify and fsnotify watches.
|
| --auto-dedup
| Deduplicate "old" data in pages images of previous dump. Which
| implies incremental dump mode (see pre-dump command).
|
| -l, --file-locks
| Dump file locks. It is necessary to make sure that all file lock
| users are taken into dump, so it is only safe to use this for
| enclojured containers where locks are not holed by someone outside
| of it.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is a mountpoint inside
| container and corresponding <VAL> is a string that will be written
| into the image as mountpoint's root value.
|
| --link-remap
| Allow to link unlinked files back when possible (modifies FS till
| restore).
|
| -j, --shell-job
| Allow to dump shell jobs. This implies the restored task will
| inherit session and process group ID from the criu itself. Also
| this option allows one to migrate a single external tty connection,
| in other words this option allows one to migrate such application
| as "top" and friends. If passed on dump it must be specified on
| restore as well.
|
| --cpu-cap [,<cap>]
| Specify cap CPU capability to be written into an image file.
| Basically if <cap> is one of all, cpu or ins, then criu writes CPU
| related information into image file. If the option is omitted or
| set to none then image will not be written. By default criu do not
| write this image.
|
| restore
| Restores previously checkpointed processes.
|
| --inherit-fd fd[<num>]:<existing>
| Inherit file descriptors. This allows to treat file descriptor
| <num> as being already opened via <existing> one and instead of
| trying to open we inherit it.
|
| -d, --restore-detached
| Detach criu itself once restore is complete.
|
| -S, --restore-sibling
| Restore root task as a sibling (make sense with --restore-detached)
| only.
|
| -r, --root <path>
| Change the root filesystem to <path> (when run in mount namespace).
|
| --manage-cgroups
| Restore cgroups configuration associated with a task from the
| image.
|
| --cgroup-root [<controller>:]/<newroot>
| Change the root cgroup the controller will be installed into. No
| controller means that root is the default for all controllers not
| specified.
|
| --tcp-established
| Restore previously dumped established TCP connections. This implies
| that the network has been locked between dump and restore phases so
| other side of a connection simply notice a kind of lag.
|
| --veth-pair <IN>=<OUT>
| Correspondence between outside and inside names of veth devices.
|
| -l, --file-locks
| Restore file locks from the image.
|
| -M, --ext-mount-map <KEY>:<VAL>
| Setup mapping for external mounts. <KEY> is the value from the
| image (<VAL> from dump) and the <VAL> is the path on host that will
| be bind-mounted into container (to the mountpoint path from image).
|
| --ext-mount-map auto
| This is a special case. If this flag is passed, when an external
| mount is missing from the command line --ext-mount-map <KEY>:<VAL>
| syntax, criu attempts to automatically resolve this mount from its
| namespace.
|
| --enable-external-sharing, --enable-external-masters
| These flags enable external shared or slave mounts to be resolved
| automatically when --ext-mount-map auto is passed.
|
| --auto-dedup
| As soon as a page is restored it get punched out from image.
|
| -j, --shell-job
| Restore shell jobs, in other words inherit session and process
| group ID from the criu itself.
|
| --cpu-cap [<cap>,<cap>]
| Specify <cap> CPU capability to be present on the CPU the process
| is restoring. To inverse capability prefix it with ^. This option
| implies that --cpu-cap has been passed on dump as well, except fpu
| option case.
|
| · all. Require all capabilities. This is default mode if
| --cpu-cap is passed without arguments. Most safe mode.
|
| · cpu. Require the CPU to have all capabilities in image to match
| runtime CPU.
|
| · fpu. Requre the CPU to have comaptible FPU. For example the
| process might be dumped with xsave capability but attempted to
| restore without it present on target CPU. In such case we
| refuse to procceed. This is default mode if --cpu-cap is not
| present in command line. Note this argument might be passed
| even if on the dump no --cpu-cap have been specified becase FPU
| frames are always encoded into images.
|
| · ins. Require CPU compatibility on instructions level.
|
| · none. Ignore capabilities. Most dangerous mode. The behaviour
| is implementation dependent. Try to not use it until really
| required.
|
| One possible need of using this option is when --cpu-cap=cpu
| has been passed on dump then images are migrated to a less
| capable processor and one need to restore this application, by
| default criu will refuse to proceed without relaxing capability
| with --cpu-cap=none parameter.
|
| check
| Tests wheter the kernel support is up to date.
|
| --ms
| Do not check not yet merged features.
|
| --feature <name>
| Check a particular feature. Instead of checking everything one may
| specify which exactly feature is to be tested. The <name> may be:
| mnt_id, aio_remap, timerfd, tun, userns.
|
| page-server
| Launches criu in page server mode.
|
| --daemon
| Runs page server as a daemon (background process).
|
| --address <address>
| Page server IP address.
|
| --port <number>
| Page server port number.
|
| exec
| Executes a system call inside a destination task's context.
|
| service
| Launches criu in RPC daemon mode where criu is listeninп for RPC
| commands over socket to perform. This is convenient for the case where
| daemon itself is running in a privilege (superuser) mode but clients
| are not.
|
| dedup
| Starts pagemap data deduplication procedure, where criu scans over all
| pagemap files and tries to minimalize the number of pagemap entries by
| obtaining the references from a parent pagemap image.
|
| cpuinfo dump
| Fetches current CPU features and write them into an image file.
|
| cpuinfo check
| Fetches current CPU features (ie CPU the criu is running on) and test
| if they are compatible with ones present in image file.
|
| SYSCALLS EXECUTION
| To run a system call in another task's context use
|
| criu exec -t pid syscall-string
|
| command. The syscall-string should look like
|
| syscall-name syscall-arguments ...
|
| Each command line argument is transformed into the system call argument
| by the following rules:
|
| · If one starts with &, the rest of it gets copied to the target
| task's address space and the respective syscall argument is the
| pointer to this string;
|
| · Otherwise it is treated as a number (converted with strtol) and is
| directly passed into the system call.
|
| EXAMPLES
| To checkpoint a program with pid of 1234 and write all image files into
| directory checkpoint:
|
| criu dump -D checkpoint -t 1234
|
| To restore this program detaching criu itself:
|
| criu restore -d -D checkpoint
|
| To close a file descriptor number 1 in task with pid 1234:
|
| criu exec -t 1234 close 1
|
| To open a file named /foo/bar for read-write in the task with pid 1234:
|
| criu exec -t 1234 open '&/foo/bar' 2
|
| AUTHOR
| OpenVZ team.
|
| COPYRIGHT
| Copyright (C) 2011-2015, Parallels Inc.
|
|
|
| criu 0.0.3 05/06/2015 CRIU(8)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-24 17:53:30 +03:00
|
|
|
|
2013-05-01 20:21:49 -07:00
|
|
|
COPYRIGHT
|
|
|
|
---------
|
2016-09-23 12:08:14 -07:00
|
|
|
Copyright \(C) 2011-2016, Parallels Holdings, Inc.
|