1podman-container-restore(1) General Commands Manualpodman-container-restore(1)
2
3
4

NAME

6       podman-container-restore - Restore one or more containers from a check‐
7       point
8
9

SYNOPSIS

11       podman container restore [options] name [...]
12
13

DESCRIPTION

15       podman container restore restores a container from a  container  check‐
16       point  or  checkpoint  image. The container IDs, image IDs or names are
17       used as input.
18
19

OPTIONS

21   --all, -a
22       Restore all checkpointed containers.
23       The default is false.
24       IMPORTANT: This OPTION does not need a container name or  ID  as  input
25       argument.
26
27
28   --file-locks
29       Restore a container with file locks. This option is required to restore
30       file locks from a checkpoint image. If the checkpoint  image  does  not
31       contain  file  locks, this option is ignored. Defaults to not restoring
32       file locks.
33       The default is false.
34
35
36   --ignore-rootfs
37       If a container is restored from a checkpoint tar.gz file it is possible
38       that  it  also  contains  all  root file-system changes. With --ignore-
39       rootfs it is possible to explicitly disable applying these  root  file-
40       system changes to the restored container.
41       The default is false.
42       IMPORTANT:  This OPTION is only available in combination with --import,
43       -i.
44
45
46   --ignore-static-ip
47       If the container was started with  --ip  the  restored  container  also
48       tries  to  use  that IP address and restore fails if that IP address is
49       already in use. This can happen, if a container  is  restored  multiple
50       times from an exported checkpoint with --name, -n.
51
52
53       Using  --ignore-static-ip  tells  Podman to ignore the IP address if it
54       was configured with --ip during container creation.
55
56
57       The default is false.
58
59
60   --ignore-static-mac
61       If the container was started with --mac-address the restored  container
62       also  tries  to  use that MAC address and restore fails if that MAC ad‐
63       dress is already in use. This can happen, if a  container  is  restored
64       multiple times from an exported checkpoint with --name, -n.
65
66
67       Using  --ignore-static-mac tells Podman to ignore the MAC address if it
68       was configured with --mac-address during container creation.
69
70
71       The default is false.
72
73
74   --ignore-volumes
75       This option must be used in combination with the --import,  -i  option.
76       When  restoring  containers from a checkpoint tar.gz file with this op‐
77       tion, the content of associated volumes are not restored.
78       The default is false.
79
80
81   --import, -i=file
82       Import a checkpoint tar.gz file, which was exported by Podman. This can
83       be used to import a checkpointed container from another host.
84       IMPORTANT:  This  OPTION  does not need a container name or ID as input
85       argument.
86
87
88       During the import of a checkpoint file Podman  selects  the  same  con‐
89       tainer  runtime which was used during checkpointing. This is especially
90       important if a specific (non-default) container runtime  was  specified
91       during  container  creation. Podman also aborts the restore if the con‐
92       tainer runtime specified during restore does  not  much  the  container
93       runtime used for container creation.
94
95
96   --import-previous=file
97       Import  a pre-checkpoint tar.gz file which was exported by Podman. This
98       option must be used with -i or --import. It only works on runc  1.0-rc3
99       or  higher.   IMPORTANT:  This  OPTION  is  not supported on the remote
100       client, including Mac and Windows (excluding WSL2) machines.
101
102
103   --keep, -k
104       Keep all temporary log and statistics  files  created  by  CRIU  during
105       checkpointing  as  well  as  restoring.  These files are not deleted if
106       restoring fails for further  debugging.  If  restoring  succeeds  these
107       files  are theoretically not needed, but if these files are needed Pod‐
108       man can keep the files for further analysis. This includes  the  check‐
109       point  directory  with all files created during checkpointing. The size
110       required by the checkpoint directory is roughly the same as the  amount
111       of memory required by the processes in the checkpointed container.
112       Without the --keep, -k option, the checkpoint is consumed and cannot be
113       used again.
114       The default is false.
115
116
117   --latest, -l
118       Instead of providing the container ID or name,  use  the  last  created
119       container.  The default is false.  IMPORTANT: This OPTION is not avail‐
120       able with the remote Podman client, including Mac and Windows  (exclud‐
121       ing WSL2) machines. This OPTION does not need a container name or ID as
122       input argument.
123
124
125   --name, -n=name
126       If a container is restored from a checkpoint tar.gz file it is possible
127       to rename it with --name, -n. This way it is possible to restore a con‐
128       tainer from a checkpoint multiple times with different names.
129
130
131       If the --name, -n option is used, Podman does not attempt to assign the
132       same  IP  address to the container it was using before checkpointing as
133       each IP address can only be used once, and the restored  container  has
134       another  IP  address. This also means that --name, -n cannot be used in
135       combination with --tcp-established.
136       IMPORTANT: This OPTION is only available for a checkpoint image  or  in
137       combination with --import, -i.
138
139
140   --pod=name
141       Restore a container into the pod name. The destination pod for this re‐
142       store has to have the same namespaces shared as the pod this  container
143       was checkpointed from (see **podman pod create --share.
144       IMPORTANT:  This  OPTION is only available for a checkpoint image or in
145       combination with --import, -i.
146
147
148       This option requires at least CRIU 3.16.
149
150
151   --print-stats
152       Print out statistics about restoring the container(s).  The  output  is
153       rendered  in  a JSON array and contains information about how much time
154       different restore operations required. Many of the  restore  statistics
155       are  created  by  CRIU and just passed through to Podman. The following
156       information is provided in the JSON array:
157
158
159podman_restore_duration: Overall time (in microseconds) needed
160                to restore all checkpoints.
161
162runtime_restore_duration: Time (in microseconds) the container
163                runtime needed to restore the checkpoint.
164
165forking_time: Time (in microseconds)  CRIU  needed  to  create
166                (fork)  all  processes  in the restored container (measured by
167                CRIU).
168
169restore_time: Time (in microseconds) CRIU  needed  to  restore
170                all processes in the container (measured by CRIU).
171
172pages_restored:  Number  of memory pages restored (measured by
173                CRIU).
174
175
176
177       The default is false.
178
179
180   --publish, -p=port
181       Replaces the ports that the container publishes, as  configured  during
182       the initial container start, with a new set of port forwarding rules.
183
184
185       For more details, see podman run --publish.
186
187
188   --tcp-established
189       Restore a container with established TCP connections. If the checkpoint
190       image contains established TCP connections,  this  option  is  required
191       during  restore.   If the checkpoint image does not contain established
192       TCP connections this option is ignored. Defaults to not restoring  con‐
193       tainers with established TCP connections.
194       The default is false.
195
196

EXAMPLE

198       Restore the container "mywebserver".
199
200       # podman container restore mywebserver
201
202
203
204       Import a checkpoint file and a pre-checkpoint file.
205
206       # podman container restore --import-previous pre-checkpoint.tar.gz --import checkpoint.tar.gz
207
208
209
210       Start  the  container "mywebserver". Make a checkpoint of the container
211       and export it. Restore the container with other port  ranges  from  the
212       exported file.
213
214       $ podman run --rm -p 2345:80 -d webserver
215       # podman container checkpoint -l --export=dump.tar
216       # podman container restore -p 5432:8080 --import=dump.tar
217
218
219
220       Start  a  container with the name "foobar-1". Create a checkpoint image
221       "foobar-checkpoint". Restore the container from  the  checkpoint  image
222       with a different name.
223
224       # podman run --name foobar-1 -d webserver
225       # podman container checkpoint --create-image foobar-checkpoint foobar-1
226       # podman inspect foobar-checkpoint
227       # podman container restore --name foobar-2 foobar-checkpoint
228       # podman container restore --name foobar-3 foobar-checkpoint
229
230
231

SEE ALSO

233       podman(1),  podman-container-checkpoint(1),  podman-run(1), podman-pod-
234       create(1), criu(8)
235
236

HISTORY

238       September 2018, Originally compiled by Adrian  Reber  areber@redhat.com
239       ⟨mailto:areber@redhat.com⟩
240
241
242
243                                                   podman-container-restore(1)
Impressum