lxc-create.sgml.in revision fbbf51926e113e5e70d6ea507ed7d1019d0e0aa8
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<!--
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholeslxc: linux Container library
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes(C) Copyright IBM Corp. 2007, 2008
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesAuthors:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesDaniel Lezcano <daniel.lezcano at free.fr>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesThis library is free software; you can redistribute it and/or
0662ed52e814f8f08ef0e09956413a792584eddffuankgmodify it under the terms of the GNU Lesser General Public
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLicense as published by the Free Software Foundation; either
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesversion 2.1 of the License, or (at your option) any later version.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesThis library is distributed in the hope that it will be useful,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesbut WITHOUT ANY WARRANTY; without even the implied warranty of
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLesser General Public License for more details.
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholes
70953fb44a7140fe206c3a5f011e24209c8c5c6abnicholesYou should have received a copy of the GNU Lesser General Public
16b55a35cff91315d261d1baa776138af465c4e4fuankgLicense along with this library; if not, write to the Free Software
16b55a35cff91315d261d1baa776138af465c4e4fuankgFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes-->
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<!DOCTYPE refentry PUBLIC @docdtd@ [
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes]>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<refentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refmeta>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refentrytitle>lxc-create</refentrytitle>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <manvolnum>1</manvolnum>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </refmeta>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refnamediv>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refname>lxc-create</refname>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refpurpose>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes creates a container
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </refpurpose>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </refnamediv>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refsynopsisdiv>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <cmdsynopsis>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <command>lxc-create</command>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <arg choice="req">-n <replaceable>name</replaceable></arg>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <arg choice="opt">-f <replaceable>config_file</replaceable></arg>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <arg choice="opt">-t <replaceable>template</replaceable></arg>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <arg choice="opt">-B <replaceable>backingstore</replaceable></arg>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <arg choice="opt">-- <replaceable>template-options</replaceable></arg>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </cmdsynopsis>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg </refsynopsisdiv>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <title>Description</title>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <command>lxc-create</command> creates a system object where is
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes stored the configuration informations and where can be stored
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes user information. The identifier <replaceable>name</replaceable>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes is used to specify the container to be used with the different
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes lxc commands.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes The object is a directory created in <filename>@LXCPATH@</filename>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg and identified by its name.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes The object is the definition of the different resources an
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes application can use or can see. The more the configuration file
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes contains informations, the more the container is isolated and
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes the more the application is jailed.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes If the configuration file <replaceable>config_file</replaceable>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes is not specified, the container will be created with the default
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes isolation: processes, sysv ipc and mount points.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <title>Options</title>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <variablelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <varlistentry>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg <term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <option>-f <replaceable>config_file</replaceable></option>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </term>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg <listitem>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Specify the configuration file to configure the virtualization
0a39e7683f6611d66c55712f50bb240428d832a1bnicholes and isolation functionalities for the container.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </listitem>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <option>-t <replaceable>template</replaceable></option>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </term>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg <listitem>
0662ed52e814f8f08ef0e09956413a792584eddffuankg <para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes 'template' is the short name of an existing 'lxc-template'
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg script that is called by lxc-create,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes eg. busybox, debian, fedora, ubuntu or sshd.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Refer to the examples in <filename>@LXCTEMPLATEDIR@</filename>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes for details of the expected script structure.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes Alternatively, the full path to an executable template script
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes can also be passed as a parameter.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </listitem>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <varlistentry>
0662ed52e814f8f08ef0e09956413a792584eddffuankg <term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <option>-B <replaceable>backingstore</replaceable></option>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <listitem>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <para>
0662ed52e814f8f08ef0e09956413a792584eddffuankg 'backingstore' is one of 'none', 'dir', 'lvm', 'loop', or 'btrfs'. The
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes default is 'none', meaning that the container root filesystem
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes will be a directory under <filename>@LXCPATH@/container/rootfs</filename>.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes 'dir' has the same meaning as 'none', but also allows the optional
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <replaceable>--dir ROOTFS</replaceable> to be specified, meaning
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes that the container rootfs should be placed under the specified path,
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes rather than the default. If 'btrfs' is specified, then the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes target filesystem must be btrfs, and the container rootfs will be
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes created as a new subvolume. This allows snapshotted clones to be
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes created, but also causes rsync --one-filesystem to treat it as a
0662ed52e814f8f08ef0e09956413a792584eddffuankg separate filesystem.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes If backingstore is 'lvm', then an lvm block device will be
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes used and the following further options are available:
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg <replaceable>--lvname lvname1</replaceable> will create an LV
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes named <filename>lvname1</filename> rather than the default, which
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes is the container name. <replaceable>--vgname vgname1</replaceable>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes will create the LV in volume group <filename>vgname1</filename>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg rather than the default, <filename>lxc</filename>.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <replaceable>--fstype FSTYPE</replaceable> will create an FSTYPE
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes filesystem on the LV, rather than the default, which is ext4.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <replaceable>--fssize SIZE</replaceable> will create a LV (and
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes filesystem) of size SIZE rather than the default, which is 1G.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </listitem>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <option>-- <replaceable>template-options</replaceable></option>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <listitem>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes This will pass <replaceable>template-options</replaceable> to the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes template as arguments. To see the list of options supported by
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes the template, you can run
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <command>lxc-create -t TEMPLATE -h</command>.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </listitem>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </variablelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refsect1>
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg <title>Diagnostic</title>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <variablelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <term>The container already exists</term>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <listitem>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes As the message mention it, you try to create a container
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes but there is a container with the same name. You can use
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes the <command>lxc-ls -l</command> command to list the
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes available containers on the system.
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </listitem>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </varlistentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
ac7985784d08a3655291f24f711812b4d8b1cbcffuankg </variablelist>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes &seealso;
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <title>Author</title>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes </refsect1>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes</refentry>
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes<!-- Keep this comment at the end of the file
bb2b38cd44b032118359afbc743efbea12f48e61bnicholesLocal variables:
8ffac2c334103c0336602aaede650cb578611151fuankgmode: sgml
8ffac2c334103c0336602aaede650cb578611151fuankgsgml-omittag:t
bb2b38cd44b032118359afbc743efbea12f48e61bnicholessgml-shorttag:t
bb2b38cd44b032118359afbc743efbea12f48e61bnicholessgml-minimize-attributes:nil
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgsgml-always-quote-attributes:t
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgsgml-indent-step:2
bb2b38cd44b032118359afbc743efbea12f48e61bnicholessgml-indent-data:t
bb2b38cd44b032118359afbc743efbea12f48e61bnicholessgml-parent-document:nil
bb2b38cd44b032118359afbc743efbea12f48e61bnicholessgml-default-dtd-file:nil
bb2b38cd44b032118359afbc743efbea12f48e61bnicholessgml-exposed-tags:nil
bb2b38cd44b032118359afbc743efbea12f48e61bnicholessgml-local-catalogs:nil
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgsgml-local-ecat-files:nil
ac7985784d08a3655291f24f711812b4d8b1cbcffuankgEnd:
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes-->
bb2b38cd44b032118359afbc743efbea12f48e61bnicholes