lxc-clone.sgml.in revision f7f1ba77b76e4d4dc18638cfdc859c3dc1750a9e
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenlxc: linux Container library
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen(C) Copyright IBM Corp. 2007, 2008
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenDaniel Lezcano <daniel.lezcano at free.fr>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenSerge Hallyn <serge.hallyn at ubuntu.com>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenThis library is free software; you can redistribute it and/or
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenmodify it under the terms of the GNU Lesser General Public
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenLicense as published by the Free Software Foundation; either
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenversion 2.1 of the License, or (at your option) any later version.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenThis library is distributed in the hope that it will be useful,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenbut WITHOUT ANY WARRANTY; without even the implied warranty of
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenLesser General Public License for more details.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenYou should have received a copy of the GNU Lesser General Public
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenLicense along with this library; if not, write to the Free Software
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenTranslated into Japanese
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenby KATOH Yasufumi <karma at jazz.email.ne.jp>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen clone a new container from an existing one.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen 既存のコンテナからの新しいコンテナのクローン
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen </refpurpose>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen </refnamediv>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <refsynopsisdiv>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <cmdsynopsis>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="opt">-B <replaceable>backingstore</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="opt">-L <replaceable>fssize</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="opt">-p <replaceable>lxcpath</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="opt">-P <replaceable>newlxcpath</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="req">-o <replaceable>orig</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="req">-n <replaceable>new</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen </cmdsynopsis>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <cmdsynopsis>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="opt">-B <replaceable>backingstore</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="opt">-L <replaceable>fssize</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="opt">-p <replaceable>lxcpath</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <arg choice="opt">-P <replaceable>newlxcpath</replaceable></arg>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen </cmdsynopsis>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen </refsynopsisdiv>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <command>lxc-clone</command> Creates a new container as a clone of an existing
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen container. Two types of clones are supported: copy and snapshot. A copy
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen clone copies the root filessytem from the original container to the new. A
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen snapshot filesystem uses the backing store's snapshot functionality to create
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen a very small copy-on-write snapshot of the original container. Snapshot
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen clones require the new container backing store to support snapshotting. Currently
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen this includes only btrfs, lvm, overlayfs and zfs. LVM devices do not support
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen snapshots of snapshots.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <command>lxc-clone</command> は,新しいコンテナを既に存在するコンテナのクローンとして作製します.クローンは 2 つのタイプをサポートします: コピーとスナップショットです.コピータイプのクローンは元のコンテナから新しいコンテナへ root ファイルシステムをコピーします.スナップショットファイルシステムは,バッキングストアのスナップショット機能を使い,元のコンテナの非常に小さな copy-on-write でのスナップショットを作製します.スナップショットでのクローンは,新しいコンテナのバッキングストアとしてスナップショット機能のサポートが必要になります.現時点では,このようなバッキングストアとしては btrfs, lvm, overlayfs, zfs のみをサポートします.LVM デバイスはスナップショットのスナップショットはサポートしていません.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen The backing store of the new container will be the same type as the
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen original container,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen with one exception: overlayfs snapshots can be created of directory backed
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen containers. This can be requested by using the <replaceable>-B overlayfs</replaceable>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen 新しいコンテナのバッキングストアは,一つの例外を除いては,元のコンテナのタイプと同じになります: overlayfs では,ディレクトリバックエンドのコンテナのスナップショットを作製することが可能です.これは,<replaceable>-B overlayfs</replaceable> という引数を使って指定することが可能です.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen The names of the original and new container can be given (in that order)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen after all options, or can be specified with the
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <replaceable>-o</replaceable> and <replaceable>-n</replaceable> options,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen respectively.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen 元のコンテナと新しいコンテナの名前は,全てのオプションの後に順番に与えることも,<replaceable>-o</replaceable> と <replaceable>-n</replaceable> オプションを使ってそれぞれ指定することも可能です.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <variablelist>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <varlistentry>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen The new container's rootfs should be a LVM or btrfs snapshot of the original.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen 新しいコンテナの rootfs は,オリジナルの LVM か btrfs のスナップショットになります.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen </varlistentry>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <varlistentry>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen Do not change the hostname of the container (in the root
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen コンテナのホスト名を変更しません (root ファイルシステム内では).
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen </varlistentry>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <varlistentry>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen Use the same MAC address as the original container, rather than
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen generating a new random one.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen 新しい MAC アドレスをランダムに生成せずに,元のコンテナと同じ MAC アドレスを使用します.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen </varlistentry>
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen <varlistentry>
新しいコンテナの lxcpath.デフォルトでは,オリジナルの lxcpath と同じものが使われます.btrfs のスナップショットの場合は注意が必要で,lxcpath の変更はできない可能性があります.これは subvolume のスナップショットが,同じ btrfs ファイルシステム上に存在しなければならないからです.
新しいコンテナで元のコンテナと違うバッキングストアを使う場合のバッキングストアを選択します.デフォルトでは元のコンテナと同じものが使われます.現時点では,バッキングストアの変更は,ディレクトリバックエンドのコンテナに対する overlayfs スナップショットに対してのみサポートされます.有効なバッキングストアは dir(directory), btrfs, lvm, zfs, loop, overlayfs を含みます.
If the container being cloned has one or more <filename>lxc.hook.clone</filename>
クローンされたコンテナに 1 つ以上の <filename>lxc.hook.clone</filename> の指定が存在する場合,指定されたフックは新しいコンテナに対して呼ばれます.クローンフックに渡される最初の 3 つの引数は,コンテナ名,セクション ('lxc'),フックタイプ ('clone') となります.<command>lxc-clone</command> に渡される追加の引数は,フックプログラムに渡される引数の 4 番目以降となります.<filename>LXC_ROOTFS_MOUNT</filename> 環境変数には,コンテナの root ファイルシステムがマウントされるパスが与えられます.設定ファイルのパス名は <filename>LXC_CONFIG_FILE</filename> に,新しいコンテナ名は <filename>LXC_NAME</filename>,古いコンテナ名は <filename>LXC_SRC_NAME</filename> に,rootfs のあるパスまたはデバイスは <filename>LXC_ROOTFS_PATH</filename> に保存されます.