NAME 名称

podman-container-checkpoint - Checkpoint one or more running containers
podman-container-checkpoint - 检查一个或多个正在运行的容器

SYNOPSIS 概要

podman container checkpoint [options] container [container …]
podman 容器检查点 [选项] 容器 [容器 …]

DESCRIPTION 描述

podman container checkpoint checkpoints all the processes in one or more containers. A container can be restored from a checkpoint with podman-container-restore. The container IDs or names are used as input.
podman 容器检查点检查一个或多个容器中的所有进程。可以使用 podman-container-restore 从检查点还原容器。容器的 ID 或名称被用作输入。

IMPORTANT: If the container is using systemd as entrypoint checkpointing the container might not be possible.
重要提示:如果容器使用 systemd 作为入口点检查点,则可能无法对容器进行检查点。

OPTIONS 选项

--all, -a

Checkpoint all running containers.
检查点所有正在运行的容器。

The default is false.
默认值为 false。

IMPORTANT: This OPTION does not need a container name or ID as input argument.
重要提示:此选项不需要容器名称或 ID 作为输入参数。

--compress, -c=zstd | none | gzip

Specify the compression algorithm used for the checkpoint archive created with the --export, -e OPTION. Possible algorithms are zstd, none and gzip.
指定用于使用 --export, -e 选项创建的检查点存档的压缩算法。可能的算法有 zstd、none 和 gzip。

One possible reason to use none is to enable faster creation of checkpoint archives. Not compressing the checkpoint archive can result in faster checkpoint archive creation.
使用 none 的一个可能原因是为了加快检查点存档的创建速度。不压缩检查点存档可以导致更快的检查点存档创建。

The default is zstd.
默认值为 zstd。

--create-image=image

Create a checkpoint image from a running container. This is a standard OCI image created in the local image store. It consists of a single layer that contains all of the checkpoint files. The content of this image layer is in the same format as a checkpoint created with --export. A checkpoint image can be pushed to a standard container registry and pulled on a different system to enable container migration. In addition, the image can be exported with podman image save and inspected with podman inspect. Inspecting a checkpoint image displays additional information, stored as annotations, about the host environment used to do the checkpoint:
从运行中的容器创建一个检查点镜像。这是在本地镜像存储中创建的标准 OCI 镜像。它由一个包含所有检查点文件的单个层组成。此镜像层的内容与使用 --export 创建的检查点的格式相同。检查点镜像可以推送到标准容器注册表,并在不同系统上拉取,以实现容器迁移。此外,可以使用 podman image save 导出镜像,并使用 podman inspect 进行检查。检查检查点镜像会显示有关用于执行检查点的主机环境的附加信息,存储为注释:

  • io.podman.annotations.checkpoint.name: Human-readable name of the original container.
    io.podman.annotations.checkpoint.name: 原始容器的可读名称。

  • io.podman.annotations.checkpoint.rawImageName: Unprocessed name of the image used to create the original container (as specified by the user).
    io.podman.annotations.checkpoint.rawImageName: 用于创建原始容器的镜像的未处理名称(由用户指定)。

  • io.podman.annotations.checkpoint.rootfsImageID: ID of the image used to create the original container.
    io.podman.annotations.checkpoint.rootfsImageID: 用于创建原始容器的镜像的 ID。

  • io.podman.annotations.checkpoint.rootfsImageName: Image name used to create the original container.
    io.podman.annotations.checkpoint.rootfsImageName: 用于创建原始容器的镜像名称。

  • io.podman.annotations.checkpoint.podman.version: Version of Podman used to create the checkpoint.
    io.podman.annotations.checkpoint.podman.version: 用于创建检查点的 Podman 版本。

  • io.podman.annotations.checkpoint.criu.version: Version of CRIU used to create the checkpoint.
    io.podman.annotations.checkpoint.criu.version: 用于创建检查点的 CRIU 版本。

  • io.podman.annotations.checkpoint.runtime.name: Container runtime (e.g., runc, crun) used to create the checkpoint.
    io.podman.annotations.checkpoint.runtime.name: 用于创建检查点的容器运行时(例如 runc、crun)。

  • io.podman.annotations.checkpoint.runtime.version: Version of the container runtime used to create the checkpoint.
    io.podman.annotations.checkpoint.runtime.version: 用于创建检查点的容器运行时版本。

  • io.podman.annotations.checkpoint.conmon.version: Version of conmon used with the original container.
    io.podman.annotations.checkpoint.conmon.version: 用于原始容器的 conmon 版本。

  • io.podman.annotations.checkpoint.host.arch: CPU architecture of the host on which the checkpoint was created.
    io.podman.annotations.checkpoint.host.arch: 创建检查点的主机的 CPU 架构。

  • io.podman.annotations.checkpoint.host.kernel: Version of Linux kernel of the host where the checkpoint was created.
    io.podman.annotations.checkpoint.host.kernel: 创建检查点的主机的 Linux 内核版本。

  • io.podman.annotations.checkpoint.cgroups.version: cgroup version used by the host where the checkpoint was created.
    io.podman.annotations.checkpoint.cgroups.version: 在创建检查点的主机上使用的 cgroup 版本。

  • io.podman.annotations.checkpoint.distribution.version: Version of host distribution on which the checkpoint was created.
    io.podman.annotations.checkpoint.distribution.version: 创建检查点的主机发行版的版本。

  • io.podman.annotations.checkpoint.distribution.name: Name of host distribution on which the checkpoint was created.
    io.podman.annotations.checkpoint.distribution.name: 创建检查点的主机发行版的名称。

--export, -e=archive

Export the checkpoint to a tar.gz file. The exported checkpoint can be used to import the container on another system and thus enabling container live migration. This checkpoint archive also includes all changes to the container’s root file-system, if not explicitly disabled using --ignore-rootfs.
将检查点导出为 tar.gz 文件。导出的检查点可用于在另一个系统上导入容器,从而实现容器的实时迁移。如果未使用 --ignore-rootfs 明确禁用,此检查点存档还包括对容器根文件系统的所有更改。

--file-locks

Checkpoint a container with file locks. If an application running in the container is using file locks, this OPTION is required during checkpoint and restore. Otherwise checkpointing containers with file locks is expected to fail. If file locks are not used, this option is ignored.
使用文件锁检查容器。如果在容器中运行的应用程序正在使用文件锁,则在检查点和恢复期间需要此选项。否则,预计使用文件锁检查点容器将失败。如果未使用文件锁,则忽略此选项。

The default is false.
默认值为 false。

--ignore-rootfs

If a checkpoint is exported to a tar.gz file it is possible with the help of --ignore-rootfs to explicitly disable including changes to the root file-system into the checkpoint archive file.
如果将检查点导出到 tar.gz 文件,则可以通过 --ignore-rootfs 明确禁用将根文件系统的更改包含在检查点存档文件中。

The default is false.
默认值为 false。

IMPORTANT: This OPTION only works in combination with --export, -e.
重要提示:此选项仅在与 --export, -e 结合使用时有效。

--ignore-volumes

This OPTION must be used in combination with the --export, -e OPTION. When this OPTION is specified, the content of volumes associated with the container is not included into the checkpoint tar.gz file.
此选项必须与 --export, -e 选项结合使用。当指定此选项时,与容器关联的卷内容不会包含在检查点 tar.gz 文件中。

The default is false.
默认值为 false。

--keep, -k

Keep all temporary log and statistics files created by CRIU during checkpointing. These files are not deleted if checkpointing fails for further debugging. If checkpointing succeeds these files are theoretically not needed, but if these files are needed Podman can keep the files for further analysis.
保留由 CRIU 在检查点期间创建的所有临时日志和统计文件。如果检查点失败,这些文件不会被删除,以便进行进一步的调试。如果检查点成功,理论上这些文件是不需要的,但如果这些文件是需要的,Podman 可以保留这些文件以供进一步分析。

The default is false.
默认值为 false。

--latest, -l

Instead of providing the container ID or name, use the last created container. The default is false. IMPORTANT: This OPTION is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines. This OPTION does not need a container name or ID as input argument.
使用最后创建的容器,而不是提供容器的 ID 或名称。默认值为 false。重要提示:此选项在远程 Podman 客户端中不可用,包括 Mac 和 Windows(不包括 WSL2)机器。此选项不需要容器名称或 ID 作为输入参数。

--leave-running, -R

Leave the container running after checkpointing instead of stopping it.
在检查点后保持容器运行,而不是停止它。

The default is false.
默认值为 false。

--pre-checkpoint, -P

Dump the container’s memory information only, leaving the container running. Later operations supersedes prior dumps. It only works on runc 1.0-rc3 or higher.
仅转储容器的内存信息,使容器保持运行状态。后续操作将取代先前的转储。它仅适用于 runc 1.0-rc3higher

The default is false.
默认值为 false。

The functionality to only checkpoint the memory of the container and in a second checkpoint only write out the memory pages which have changed since the first checkpoint relies on the Linux kernel’s soft-dirty bit, which is not available on all systems as it depends on the system architecture and the configuration of the Linux kernel. Podman verifies if the current system supports this functionality and return an error if the current system does not support it.
仅检查点容器的内存功能,并在第二个检查点中仅写出自第一个检查点以来发生更改的内存页面,依赖于 Linux 内核的软脏位,该位并非所有系统都可用,因为它取决于系统架构和 Linux 内核的配置。Podman 验证当前系统是否支持此功能,并在当前系统不支持时返回错误。

--tcp-established

Checkpoint a container with established TCP connections. If the checkpoint image contains established TCP connections, this OPTION is required during restore. Defaults to not checkpointing containers with established TCP connections.
使用已建立的 TCP 连接检查点容器。如果检查点镜像包含已建立的 TCP 连接,则在恢复期间需要此选项。默认情况下,不对具有已建立的 TCP 连接的容器进行检查点。

The default is false.
默认值为 false。

--with-previous

Check out the container with previous criu image files in pre-dump. It only works on runc 1.0-rc3 or higher.
检查包含先前 criu 镜像文件的容器在预转储中。仅适用于 runc 1.0-rc3higher

The default is false.
默认值为 false。

IMPORTANT: This OPTION is not available with --pre-checkpoint.
重要提示:此选项在 --pre-checkpoint 模式下不可用。

This option requires that the option --pre-checkpoint has been used before on the same container. Without an existing pre-checkpoint, this option fails.
此选项要求在同一容器上先使用选项 --pre-checkpoint。如果没有现有的预检查点,此选项将失败。

Also see --pre-checkpoint for additional information about --pre-checkpoint availability on different systems.
另请参阅关于不同系统上 --pre-checkpoint 可用性的更多信息。

EXAMPLES 示例

Make a checkpoint for the container “mywebserver”.
为容器“mywebserver”创建一个检查点。

# podman container checkpoint mywebserver

Create a checkpoint image for the container “mywebserver”.
为容器“mywebserver”创建一个检查点图像。

# podman container checkpoint --create-image mywebserver-checkpoint-1 mywebserver

Dumps the container’s memory information of the latest container into an archive.
将最新容器的内存信息转储到一个存档中。

# podman container checkpoint -P -e pre-checkpoint.tar.gz -l

Keep the container’s memory information from an older dump and add the new container’s memory information.
保留来自旧转储的容器内存信息,并添加新容器的内存信息。

# podman container checkpoint --with-previous -e checkpoint.tar.gz -l

Dump the container’s memory information of the latest container into an archive with the specified compress method.
将最新容器的内存信息转储到具有指定压缩方法的存档中。

# podman container checkpoint -l --compress=none --export=dump.tar
# podman container checkpoint -l --compress=gzip --export=dump.tar.gz

SEE ALSO 参见 ¶

podman(1), podman-container-restore(1), criu(8)

HISTORY 历史 ¶

September 2018, Originally compiled by Adrian Reber areber@redhat.com
2018 年 9 月,最初由 Adrian Reber areber@redhat.com 编译。