Debian Codegraph @

doc/ja/lxc-copy.sgml.in

raw
1 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
2
3 <!DOCTYPE refentry PUBLIC @docdtd@ [
4
5 <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
6 <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
7 ]>
8
9 <refentry>
10
11 <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
12
13 <refmeta>
14 <refentrytitle>lxc-copy</refentrytitle>
15 <manvolnum>1</manvolnum>
16 </refmeta>
17
18 <refnamediv>
19 <refname>lxc-copy</refname>
20
21 <refpurpose>
22 <!--
23 copy an existing container.
24 -->
25 既存のコンテナのコピー
26 </refpurpose>
27 </refnamediv>
28
29 <refsynopsisdiv>
30 <cmdsynopsis>
31 <command>lxc-copy</command>
32 <arg choice="req">-n, --name <replaceable>name</replaceable></arg>
33 <arg choice="opt">-P, --lxcpath <replaceable>path</replaceable></arg>
34 <arg choice="req">-N, --newname <replaceable>newname</replaceable></arg>
35 <arg choice="opt">-p, --newpath <replaceable>newpath</replaceable></arg>
36 <arg choice="opt">-B, --backingstorage <replaceable>backingstorage</replaceable></arg>
37 <arg choice="opt">-s, --snapshot</arg>
38 <arg choice="opt">-a, --allowrunning</arg>
39 <arg choice="opt">-K, --keepname</arg>
40 <arg choice="opt">-D, --keepdata</arg>
41 <arg choice="opt">-M, --keepmac</arg>
42 <arg choice="opt">-L, --fssize <replaceable>size [unit]</replaceable></arg>
43 <arg choice="opt">-- hook arguments</arg>
44 </cmdsynopsis>
45 <cmdsynopsis>
46 <command>lxc-copy</command>
47 <arg choice="req">-n, --name <replaceable>name</replaceable></arg>
48 <arg choice="opt">-P, --lxcpath <replaceable>path</replaceable></arg>
49 <arg choice="opt">-N, --newname <replaceable>newname</replaceable></arg>
50 <arg choice="opt">-p, --newpath <replaceable>newpath</replaceable></arg>
51 <arg choice="req">-e, --ephemeral</arg>
52 <arg choice="opt">-B, --backingstorage <replaceable>backingstorage</replaceable></arg>
53 <arg choice="opt">-s, --snapshot</arg>
54 <arg choice="opt">-K, --keepname</arg>
55 <arg choice="opt">-D, --keepdata</arg>
56 <arg choice="opt">-M, --keepmac</arg>
57 <arg choice="opt">-L, --fssize <replaceable>size [unit]</replaceable></arg>
58 <arg choice="opt">-- hook arguments</arg>
59 </cmdsynopsis>
60 <cmdsynopsis>
61 <command>lxc-copy</command>
62 <arg choice="req">-n, --name <replaceable>name</replaceable></arg>
63 <arg choice="opt">-P, --lxcpath <replaceable>path</replaceable></arg>
64 <arg choice="opt">-N, --newname <replaceable>newname</replaceable></arg>
65 <arg choice="opt">-p, --newpath <replaceable>newpath</replaceable></arg>
66 <arg choice="req">-e, --ephemeral</arg>
67 <arg choice="opt">-B, --backingstorage <replaceable>backingstorage</replaceable></arg>
68 <arg choice="opt">-s, --snapshot</arg>
69 <arg choice="opt">-a, --allowrunning</arg>
70 <arg choice="opt">-t, --tmpfs</arg>
71 <arg choice="opt">-K, --keepname</arg>
72 <arg choice="opt">-M, --keepmac</arg>
73 <arg choice="opt">-- hook arguments</arg>
74 </cmdsynopsis>
75 <cmdsynopsis>
76 <command>lxc-copy</command>
77 <arg choice="req">-n, --name <replaceable>name</replaceable></arg>
78 <arg choice="opt">-P, --lxcpath <replaceable>path</replaceable></arg>
79 <arg choice="req">-N, --newname <replaceable>newname</replaceable></arg>
80 <arg choice="opt">-p, --newpath <replaceable>newpath</replaceable></arg>
81 <arg choice="req">-R, --rename</arg>
82 </cmdsynopsis>
83 </refsynopsisdiv>
84
85 <refsect1>
86 <title><!-- Description -->説明</title>
87
88 <para>
89 <!--
90 <command>lxc-copy</command> creates and optionally starts (ephemeral or
91 non-ephemeral) copies of existing containers. It replaces
92 <command>lxc-clone</command> and <command>lxc-start-ephemeral</command>.
93 -->
94 <command>lxc-copy</command> は、すでに存在するコンテナのコピーを作成します。オプションを指定することで、作成後にそのコピーを起動できます (コピーは一時的なコピーまたは永続的なコピーのどちらも可能です)。
95 このコマンドは <command>lxc-clone</command> と <command>lxc-start-ephemeral</command> の置き換えのコマンドです。
96 </para>
97 <para>
98 <!--
99 <command>lxc-copy</command> creates copies of existing containers. Copies
100 can be complete clones of the original container. In this case the whole
101 root filesystem of the container is simply copied to the new container. Or
102 they can be snapshots, i.e. small copy-on-write copies of the original
103 container. In this case the specified backing storage for the copy must
104 support snapshots. This currently includes btrfs, lvm (lvm devices
105 do not support snapshots of snapshots.), overlay, and zfs.
106 -->
107 <command>lxc-copy</command> は、既存のコンテナのコピーを作成します。
108 コピーは元のコンテナの完全なクローンにできます。この場合、単にコンテナのルートファイルシステムのすべてが、新しいコンテナにコピーされます。
109 また、スナップショットを取得することも可能です。すなわち、元のコンテナの小さなコピーオンライトのコピーにするということです。この場合、コピーで指定するバッキングストレージがスナップショットをサポートしている必要があります。
110 スナップショットをサポートしているバッキングストレージは、現時点では btrfs、lvm (lvm デバイスはスナップショットのスナップショットはサポートしていません)、overlay、zfs です。
111 </para>
112
113 <para>
114 <!--
115 The copy's backing storage will be of the same type as the original
116 container. overlay snapshots of directory backed containers are
117 exempted from this rule.
118 -->
119 コピー先のバッキングストレージは、元のコンテナと同じタイプになるでしょう。ただし、ディレクトリバックエンドのコンテナのスナップショットは overlay で取得できますので例外です。
120 </para>
121
122 <para>
123 <!--
124 When the <replaceable>-e</replaceable> flag is specified an ephemeral
125 snapshot of the original container is created and started. Ephemeral
126 containers will have <command>lxc.ephemeral = 1</command> set in their
127 config file and will be destroyed on shutdown. When
128 <replaceable>-e</replaceable> is used in combination with
129 <replaceable>-D</replaceable> a non-ephemeral snapshot of the original
130 container is created and started.
131 Ephemeral containers can also be placed on a tmpfs with <replaceable>-t</replaceable>
132 flag. NOTE: If an ephemeral container that is placed on a tmpfs is rebooted
133 all changes made to it will currently be lost!
134 -->
135 <replaceable>-e</replaceable> オプションを指定した場合は、元のコンテナの一時的なスナップショットを作成し、起動します。一時的なコンテナの場合、設定ファイルに <command>lxc.ephemeral = 1</command> がセットされ、シャットダウン後に削除されます。
136 <replaceable>-e</replaceable> と <replaceable>-D</replaceable> を同時に指定すると、元のコンテナの一時的ではないスナップショットを作成し、起動します。
137 <replaceable>-t</replaceable> オプションを指定して、一時的なコンテナを tmpfs 上に置くことができます。
138 注意: tmpfs 上に置いた一時的なコンテナをリブートすると、コンテナに対して行ったすべての変更は失われます!
139 </para>
140
141 <para>
142 <!--
143 When <replaceable>-e</replaceable> is specified and no newname is given via
144 <replaceable>-N</replaceable> a random name for the snapshot will be chosen.
145 -->
146 <replaceable>-e</replaceable> を指定した場合で、<replaceable>-N</replaceable> でコンテナの名前を指定しない場合は、スナップショットの名前はランダムで命名されます。
147 </para>
148
149 <para>
150 <!--
151 Containers created and started with <replaceable>-e</replaceable> can have
152 custom mounts. These are specified with the <replaceable>-m</replaceable>
153 flag. Currently three types of mounts are supported:
154 <replaceable>bind</replaceable>, and
155 <replaceable>overlay</replaceable>. Mount types are specified as suboptions
156 to the <replaceable>-m</replaceable> flag and can be specified multiple
157 times separated by commas. <replaceable>overlay</replaceable> mounts are
158 currently specified in the format <replaceable>-m
159 overlay=/src:/dest</replaceable>. When no destination
160 <replaceable>dest</replaceable> is specified
161 <replaceable>dest</replaceable> will be identical to
162 <replaceable>src</replaceable>. Read-only <replaceable>bind</replaceable>
163 mounts are specified <replaceable>-m bind=/src:/dest:ro</replaceable> and
164 read-write <replaceable>bind</replaceable> mounts <replaceable>-m
165 bind=/src:/dest:rw</replaceable>. Read-write <replaceable>bind</replaceable>
166 mounts are the default and <replaceable>rw</replaceable> can be missing when
167 a read-write mount is wanted. When <replaceable>dest</replaceable> is
168 missing <replaceable>dest</replaceable> will be identical to
169 <replaceable>src</replaceable>. An example for multiple mounts would be
170 <replaceable>-m
171 bind=/src1:/dest1:ro,bind=/src2:ro,overlay=/src3:/dest3</replaceable>.
172 -->
173 <replaceable>-e</replaceable> で作成し、起動したコンテナは、コンテナ独自のマウントを行えます。現時点では <replaceable>bind</replaceable>、<replaceable>overlay</replaceable> という 2 つのタイプのマウントがサポートされています。
174 マウントタイプは <replaceable>-m</replaceable> オプションのサブオプションとして指定します。この指定はカンマ区切りで複数回指定できます。
175 <replaceable>overlay</replaceable> マウントの場合は、現時点では <replaceable>-m overlay=/src:/dest</replaceable> のように指定します。マウント先の <replaceable>dest</replaceable> を指定しない場合は、<replaceable>dest</replaceable> は <replaceable>src</replaceable> と同じになります。
176 読み込み専用の <replaceable>bind</replaceable> マウントは <replaceable>-m bind=/src:/dest:ro</replaceable> のように指定します。読み書き可能な <replaceable>bind</replaceable> マウントは <replaceable>-m bind=/src:/dest:rw</replaceable> のように指定します。<replaceable>bind</replaceable> マウントのデフォルトは読み書き可能ですので、読み書き可能なマウントを行う場合は省略できます。マウント先の <replaceable>dest</replaceable> を指定しない場合は、<replaceable>dest</replaceable> は <replaceable>src</replaceable> と同じになります。
177 複数のマウントを行う場合の例を示すと、<replaceable>-m bind=/src1:/dest1:ro,bind=/src2:ro,overlay=/src3:/dest3</replaceable> のようになります。
178 </para>
179
180 <para>
181 <!--
182 The mounts, their options, and formats supported via the
183 <replaceable>-m</replaceable> flag are subject to change.
184 -->
185 <replaceable>-m</replaceable> オプションで指定するマウント、オプション、指定フォーマットは変更される可能性があります。
186 </para>
187 </refsect1>
188
189 <refsect1>
190
191 <title><!-- Options -->オプション</title>
192
193 <variablelist>
194
195 <varlistentry>
196 <term> <option>-N,--newname <replaceable>newname</replaceable></option> </term>
197 <listitem>
198 <para><!-- The name for the copy. -->コピー先のコンテナの名前。</para>
199 </listitem>
200 </varlistentry>
201
202 <varlistentry>
203 <term> <option>-p,--newpath <replaceable>newpath</replaceable></option> </term>
204 <listitem>
205 <para><!-- The path for the copy. -->コピー先のパス。</para>
206 </listitem>
207 </varlistentry>
208
209 <varlistentry>
210 <term> <option>-R,--rename </option> </term>
211 <listitem>
212 <para><!-- Rename the original container. -->元のコンテナをリネームします。</para>
213 </listitem>
214 </varlistentry>
215
216 <varlistentry>
217 <term> <option>-s,--snapshot </option> </term>
218 <listitem>
219 <para><!-- Create a snapshot of the original container. The backing
220 storage for the copy must support snapshots. This currently includes
221 btrfs, lvm, overlay, and zfs. -->
222 元のコンテナのスナップショットを作成します。コピー先のバッキングストレージがスナップショットをサポートしている必要があります。現時点では btrfs、lvm、overlay、zfs が対象となります。
223 </para>
224 </listitem>
225 </varlistentry>
226
227 <varlistentry>
228 <term> <option>-a,--allowrunning </option> </term>
229 <listitem>
230 <para><!-- Allow the creation of a Snapshot of an already running container.
231 This may cause data corruption or data loss depending on the used
232 filesystem and applications. Use with care. -->
233 実行中のコンテナのスナップショットを作成します。
234 これは、使用しているファイルシステムやアプリケーションによっては、データの破損や欠損を引き起こす可能性があります。
235 注意して使用してください。
236 </para>
237 </listitem>
238 </varlistentry>
239
240 <varlistentry>
241 <term> <option>-F,--foreground</option> </term>
242 <listitem>
243 <para><!-- Run the snapshot in the foreground. The snapshots console will
244 be attached to the current tty. (This option can only be specified
245 in conjunction with <replaceable>-e</replaceable>.) -->
246 スナップショットしたコンテナをフォアグラウンドで起動します。スナップショットしたコンテナのコンソールは現在の tty にアタッチされます。(このオプションは <replaceable>-e</replaceable> と同時の場合のみ指定できます。)
247 </para>
248 </listitem>
249 </varlistentry>
250
251 <varlistentry>
252 <term> <option>-d, --daemon</option> </term>
253 <listitem>
254 <para><!-- Run the snapshot as a daemon (This is the default mode for
255 ephemeral containers.). As the container has no more tty, if an
256 error occurs nothing will be displayed, the log file can
257 be used to check the error. (This option can only be specified in
258 conjunction with <replaceable>-e</replaceable>.) -->
259 スナップショットしたコンテナをデーモンで起動します (一時的なコンテナではこのモードがデフォルトです)。
260 コンテナは tty を持ちませんので、エラーが発生しても何も表示されません。エラーをチェックするにはログファイルを使います。(このオプションは <replaceable>-e</replaceable> と同時の場合のみ指定できます。)
261 </para>
262 </listitem>
263 </varlistentry>
264
265 <varlistentry>
266 <term> <option>-m, --mount <replaceable>mounttype</replaceable></option> </term>
267 <listitem>
268 <para><!-- Specify a mount for a snapshot The
269 <replaceable>opts</replaceable> argument for the mount type can by
270 of type {bind, overlay}. For example <option>-m
271 bind=/src:/dest:ro,overlay=/src:/dest</option> (This option can
272 currently only be specified in conjunction with
273 <replaceable>-e</replaceable>.). --></para>
274 スナップショットするコンテナで行うマウントを指定します。マウントタイプは {bind, overlay} のどれかで指定します。例えば <option>-m bind=/src:/dest:ro,overlay=/src:/dest</option> のようになります。(このオプションは <replaceable>-e</replaceable> と同時の場合のみ指定できます。)
275 </listitem>
276 </varlistentry>
277
278 <varlistentry>
279 <term> <option>-t, --tmpfs </option></term>
280 <listitem>
281 <para><!-- When this option is specified the ephemeral container will be
282 placed on a tmpfs. NOTE: Rebooting an ephemeral container that is
283 located on a tmpfs will currently cause all changes made to it to be
284 lost. This flag will only work for ephemeral containers created with
285 the <replaceable>-e</replaceable> flag. The original container, from
286 which the ephemeral snapshot is created, must be stored as a simple
287 directory. -->
288 このオプションを指定すると、一時的なコンテナを tmpfs 上に置きます。
289 注意: tmpfs 上に置かれた一時的なコンテナをリブートすると、コンテナに対して行ったすべての変更が失われます。
290 このフラグは <replaceable>-e</replaceable> オプションを指定して作成した一時的なコンテナに対してのみ有効です。一時的なスナップショットを作成する元のコンテナは、ディレクトリバックエンド上に存在しなければなりません。
291 </para> </listitem>
292 </varlistentry>
293
294 <varlistentry>
295 <term> <option>-B, --backingstorage <replaceable>backingstorage</replaceable></option></term>
296 <listitem>
297 <para><!-- Specify the backing storage type to be used for the copy
298 where 'backingstorage' is of type 'btrfs', 'dir', 'lvm', 'loop',
299 'overlay', or 'zfs'. -->
300 コピー先コンテナのバッキングストレージのタイプを指定します。ここで 'backingstorage' は 'btrfs'、'dir'、'lvm'、'loop'、'overlay'、'zfs' のどれかです。
301 </para>
302 </listitem>
303 </varlistentry>
304
305 <varlistentry>
306 <term> <option>-L, --fssize <replaceable>size [unit]</replaceable></option></term>
307 <listitem>
308 <para><!-- Specify the size for an 'lvm' filesystem. -->'lvm' ファイルシステムのサイズを指定します。</para>
309 </listitem>
310 </varlistentry>
311
312 <varlistentry>
313 <term> <option>-K, --keepname </option></term>
314 <listitem>
315 <para><!-- When this option is specified the hostname of the original
316 container will be kept for the copy. -->
317 このオプションを指定すると、元のコンテナのホスト名をコピー先でもそのまま使います。
318 </para>
319 </listitem>
320 </varlistentry>
321
322 <varlistentry>
323 <term> <option>-D, --keepdata </option></term>
324 <listitem>
325 <para><!-- When this option is specified with
326 <replaceable>-e</replaceable> a non-ephemeral container is created
327 and started. -->
328 <replaceable>-e</replaceable> オプションと同時にこのオプションを使うと、一時的でないコンテナを作成し、起動します。
329 </para>
330 </listitem>
331 </varlistentry>
332
333 <varlistentry>
334 <term> <option>-M, --keepmac </option></term>
335 <listitem>
336 <para><!-- When this option is specified the MAC address of the original
337 container will be kept for the copy. -->
338 このオプションを指定すると、元のコンテナの MAC アドレスをコピー先でもそのまま使います。
339 </para>
340 </listitem>
341 </varlistentry>
342
343 </variablelist>
344
345 </refsect1>
346
347 <refsect1>
348 <title><!-- Copy hook -->コピー時のフック</title>
349 <para>
350 <!--
351 If the container being copied has one or more
352 <filename>lxc.hook.clone</filename> specified, then the specified hooks
353 will be called for the new container. The first 3 arguments passed to the
354 clone hook will be the container name, a section ('lxc'), and the hook
355 type ('clone'). Extra arguments passed to <command>lxc-copy</command> will
356 be passed to the hook program starting at argument 4. The
357 <filename>LXC_ROOTFS_MOUNT</filename> environment variable gives
358 the path under which the container's root filesystem is mounted. The
359 configuration file pathname is stored in
360 <filename>LXC_CONFIG_FILE</filename>, the new container name in
361 <filename>LXC_NAME</filename>, the old container name in
362 <filename>LXC_SRC_NAME</filename>, and the path or device on which the
363 rootfs is located is in <filename>LXC_ROOTFS_PATH</filename>.
364 -->
365 コピーされるコンテナに 1 つ以上の <filename>lxc.hook.clone</filename> の指定が存在する場合、指定されたフックは新しいコンテナに対して呼ばれます。
366 クローンフックに渡される最初の 3 つの引数は、コンテナ名、セクション ('lxc')、フックタイプ ('clone') となります。
367 <command>lxc-copy</command> に渡される追加の引数は、フックプログラムに渡される引数の 4 番目以降となります。
368 <filename>LXC_ROOTFS_MOUNT</filename> 環境変数には、コンテナの root ファイルシステムがマウントされるパスが与えられます。
369 設定ファイルのパス名は <filename>LXC_CONFIG_FILE</filename> に、新しいコンテナ名は <filename>LXC_NAME</filename>、古いコンテナ名は <filename>LXC_SRC_NAME</filename> に、rootfs のあるパスまたはデバイスは <filename>LXC_ROOTFS_PATH</filename> に保存されます。
370 </para>
371 </refsect1>
372
373 &commonoptions;
374
375 &seealso;
376
377 </refentry>
378
379 <!-- Keep this comment at the end of the file
380 Local variables:
381 mode: sgml
382 sgml-omittag:t
383 sgml-shorttag:t
384 sgml-minimize-attributes:nil
385 sgml-always-quote-attributes:t
386 sgml-indent-step:2
387 sgml-indent-data:t
388 sgml-parent-document:nil
389 sgml-default-dtd-file:nil
390 sgml-exposed-tags:nil
391 sgml-local-catalogs:nil
392 sgml-local-ecat-files:nil
393 End:
394 -->