208 lines
8.5 KiB
Groff
208 lines
8.5 KiB
Groff
.nh
|
|
.TH podman-container-restore 1
|
|
.SH NAME
|
|
podman-container-restore \- Restore one or more containers from a checkpoint
|
|
|
|
.SH SYNOPSIS
|
|
\fBpodman container restore\fP [\fIoptions\fP] \fIname\fP [...]
|
|
|
|
.SH DESCRIPTION
|
|
\fBpodman container restore\fP restores a container from a container checkpoint or
|
|
checkpoint image. The \fIcontainer IDs\fP, \fIimage IDs\fP or \fInames\fP are used as input.
|
|
|
|
.SH OPTIONS
|
|
.SS \fB--all\fP, \fB-a\fP
|
|
Restore all checkpointed \fIcontainers\fP\&.
|
|
.br
|
|
The default is \fBfalse\fP\&.
|
|
.br
|
|
\fIIMPORTANT: This OPTION does not need a container name or ID as input argument.\fP
|
|
|
|
.SS \fB--file-locks\fP
|
|
Restore a \fIcontainer\fP with file locks. This option is required to
|
|
restore file locks from a checkpoint image. If the checkpoint image
|
|
does not contain file locks, this option is ignored. Defaults to not
|
|
restoring file locks.
|
|
.br
|
|
The default is \fBfalse\fP\&.
|
|
|
|
.SS \fB--ignore-rootfs\fP
|
|
If a \fIcontainer\fP is restored from a checkpoint tar.gz file it is possible that it also contains all root file-system changes. With \fB--ignore-rootfs\fP it is possible to explicitly disable applying these root file-system changes to the restored \fIcontainer\fP\&.
|
|
.br
|
|
The default is \fBfalse\fP\&.
|
|
.br
|
|
\fIIMPORTANT: This OPTION is only available in combination with \fB--import, -i\fP\&.\fP
|
|
|
|
.SS \fB--ignore-static-ip\fP
|
|
If the \fIcontainer\fP was started with \fB--ip\fP the restored \fIcontainer\fP also tries to use that
|
|
IP address and restore fails if that IP address is already in use. This can happen, if
|
|
a \fIcontainer\fP is restored multiple times from an exported checkpoint with \fB--name, -n\fP\&.
|
|
|
|
.PP
|
|
Using \fB--ignore-static-ip\fP tells Podman to ignore the IP address if it was configured
|
|
with \fB--ip\fP during \fIcontainer\fP creation.
|
|
|
|
.PP
|
|
The default is \fBfalse\fP\&.
|
|
|
|
.SS \fB--ignore-static-mac\fP
|
|
If the \fIcontainer\fP was started with \fB--mac-address\fP the restored \fIcontainer\fP also
|
|
tries to use that MAC address and restore fails if that MAC address is already
|
|
in use. This can happen, if a \fIcontainer\fP is restored multiple times from an
|
|
exported checkpoint with \fB--name, -n\fP\&.
|
|
|
|
.PP
|
|
Using \fB--ignore-static-mac\fP tells Podman to ignore the MAC address if it was
|
|
configured with \fB--mac-address\fP during \fIcontainer\fP creation.
|
|
|
|
.PP
|
|
The default is \fBfalse\fP\&.
|
|
|
|
.SS \fB--ignore-volumes\fP
|
|
This option must be used in combination with the \fB--import, -i\fP option.
|
|
When restoring \fIcontainers\fP from a checkpoint tar.gz file with this option,
|
|
the content of associated volumes are not restored.
|
|
.br
|
|
The default is \fBfalse\fP\&.
|
|
|
|
.SS \fB--import\fP, \fB-i\fP=\fIfile\fP
|
|
Import a checkpoint tar.gz file, which was exported by Podman. This can be used
|
|
to import a checkpointed \fIcontainer\fP from another host.
|
|
.br
|
|
\fIIMPORTANT: This OPTION does not need a container name or ID as input argument.\fP
|
|
|
|
.PP
|
|
During the import of a checkpoint file Podman selects the same container runtime
|
|
which was used during checkpointing. This is especially important if a specific
|
|
(non-default) container runtime was specified during container creation. Podman
|
|
also aborts the restore if the container runtime specified during restore does
|
|
not much the container runtime used for container creation.
|
|
|
|
.SS \fB--import-previous\fP=\fIfile\fP
|
|
Import a pre-checkpoint tar.gz file which was exported by Podman. This option
|
|
must be used with \fB-i\fP or \fB--import\fP\&. It only works on \fBrunc 1.0-rc3\fR or \fBhigher\fR\&.
|
|
\fIIMPORTANT: This OPTION is not supported on the remote client, including Mac and Windows (excluding WSL2) machines.\fP
|
|
|
|
.SS \fB--keep\fP, \fB-k\fP
|
|
Keep all temporary log and statistics files created by \fBCRIU\fR during
|
|
checkpointing as well as restoring. These files are not deleted if restoring
|
|
fails for further debugging. If restoring succeeds these files are
|
|
theoretically not needed, but if these files are needed Podman can keep the
|
|
files for further analysis. This includes the checkpoint directory with all
|
|
files created during checkpointing. The size required by the checkpoint
|
|
directory is roughly the same as the amount of memory required by the
|
|
processes in the checkpointed \fIcontainer\fP\&.
|
|
.br
|
|
Without the \fB--keep\fP, \fB-k\fP option, the checkpoint is consumed and cannot be used again.
|
|
.br
|
|
The default is \fBfalse\fP\&.
|
|
|
|
.SS \fB--latest\fP, \fB-l\fP
|
|
Instead of providing the \fIcontainer ID\fP or \fIname\fP, use the last created \fIcontainer\fP\&. The default is \fBfalse\fP\&.
|
|
\fIIMPORTANT: 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.\fP
|
|
|
|
.SS \fB--name\fP, \fB-n\fP=\fIname\fP
|
|
If a \fIcontainer\fP is restored from a checkpoint tar.gz file it is possible to rename it with \fB--name, -n\fP\&. This way it is possible to restore a \fIcontainer\fP from a checkpoint multiple times with different
|
|
names.
|
|
|
|
.PP
|
|
If the \fB--name, -n\fP option is used, Podman does not attempt to assign the same IP
|
|
address to the \fIcontainer\fP it was using before checkpointing as each IP address can only
|
|
be used once, and the restored \fIcontainer\fP has another IP address. This also means
|
|
that \fB--name, -n\fP cannot be used in combination with \fB--tcp-established\fP\&.
|
|
.br
|
|
\fIIMPORTANT: This OPTION is only available for a checkpoint image or in combination
|
|
with \fB--import, -i\fP\&.\fP
|
|
|
|
.SS \fB--pod\fP=\fIname\fP
|
|
Restore a container into the pod \fIname\fP\&. The destination pod for this restore
|
|
has to have the same namespaces shared as the pod this container was checkpointed
|
|
from (see **podman pod create --share.
|
|
.br
|
|
\fIIMPORTANT: This OPTION is only available for a checkpoint image or in combination
|
|
with \fB--import, -i\fP\&.\fP
|
|
|
|
.PP
|
|
This option requires at least CRIU 3.16.
|
|
|
|
.SS \fB--print-stats\fP
|
|
Print out statistics about restoring the container(s). The output is
|
|
rendered in a JSON array and contains information about how much time different
|
|
restore operations required. Many of the restore statistics are created
|
|
by CRIU and just passed through to Podman. The following information is provided
|
|
in the JSON array:
|
|
.IP \(bu 2
|
|
\fBpodman_restore_duration\fP: Overall time (in microseconds) needed to restore
|
|
all checkpoints.
|
|
.IP \(bu 2
|
|
\fBruntime_restore_duration\fP: Time (in microseconds) the container runtime
|
|
needed to restore the checkpoint.
|
|
.IP \(bu 2
|
|
\fBforking_time\fP: Time (in microseconds) CRIU needed to create (fork) all
|
|
processes in the restored container (measured by CRIU).
|
|
.IP \(bu 2
|
|
\fBrestore_time\fP: Time (in microseconds) CRIU needed to restore all processes
|
|
in the container (measured by CRIU).
|
|
.IP \(bu 2
|
|
\fBpages_restored\fP: Number of memory pages restored (measured by CRIU).
|
|
|
|
.PP
|
|
The default is \fBfalse\fP\&.
|
|
|
|
.SS \fB--publish\fP, \fB-p\fP=\fIport\fP
|
|
Replaces the ports that the \fIcontainer\fP publishes, as configured during the
|
|
initial \fIcontainer\fP start, with a new set of port forwarding rules.
|
|
|
|
.PP
|
|
For more details, see \fBpodman run --publish\fP\&.
|
|
|
|
.SS \fB--tcp-established\fP
|
|
Restore a \fIcontainer\fP with established TCP connections. If the checkpoint image
|
|
contains established TCP connections, this option is required during restore.
|
|
If the checkpoint image does not contain established TCP connections this
|
|
option is ignored. Defaults to not restoring \fIcontainers\fP with established TCP
|
|
connections.
|
|
.br
|
|
The default is \fBfalse\fP\&.
|
|
|
|
.SH EXAMPLES
|
|
Restore the container "mywebserver".
|
|
|
|
.EX
|
|
# podman container restore mywebserver
|
|
.EE
|
|
|
|
.PP
|
|
Import a checkpoint file and a pre-checkpoint file.
|
|
|
|
.EX
|
|
# podman container restore --import-previous pre-checkpoint.tar.gz --import checkpoint.tar.gz
|
|
.EE
|
|
|
|
.PP
|
|
Start the container "mywebserver". Make a checkpoint of the container and export it. Restore the container with other port ranges from the exported file.
|
|
|
|
.EX
|
|
$ podman run --rm -p 2345:80 -d webserver
|
|
# podman container checkpoint -l --export=dump.tar
|
|
# podman container restore -p 5432:8080 --import=dump.tar
|
|
.EE
|
|
|
|
.PP
|
|
Start a container with the name "foobar-1". Create a checkpoint image "foobar-checkpoint". Restore the container from the checkpoint image with a different name.
|
|
|
|
.EX
|
|
# podman run --name foobar-1 -d webserver
|
|
# podman container checkpoint --create-image foobar-checkpoint foobar-1
|
|
# podman inspect foobar-checkpoint
|
|
# podman container restore --name foobar-2 foobar-checkpoint
|
|
# podman container restore --name foobar-3 foobar-checkpoint
|
|
.EE
|
|
|
|
.SH SEE ALSO
|
|
\fBpodman(1)\fP, \fBpodman-container-checkpoint(1)\fP, \fBpodman-run(1)\fP, \fBpodman-pod-create(1)\fP, \fBcriu(8)\fP
|
|
|
|
.SH HISTORY
|
|
September 2018, Originally compiled by Adrian Reber areber@redhat.com
|
|
\[la]mailto:areber@redhat.com\[ra]
|