lxc-create.sgml.in revision eb7829c1c6ae93e695e55a43eedf655750ba7b60
aa8d013ec5b09cd1cd904173d6234ef126eb2126Peter Simons<!--
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanolxc: linux Container library
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano(C) Copyright IBM Corp. 2007, 2008
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoAuthors:
9afe19d634946d50eab30e3b90cb5cebcde39eeaDaniel LezcanoDaniel Lezcano <daniel.lezcano at free.fr>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoThis library is free software; you can redistribute it and/or
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanomodify it under the terms of the GNU Lesser General Public
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoLicense as published by the Free Software Foundation; either
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoversion 2.1 of the License, or (at your option) any later version.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoThis library is distributed in the hope that it will be useful,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanobut WITHOUT ANY WARRANTY; without even the implied warranty of
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoLesser General Public License for more details.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoYou should have received a copy of the GNU Lesser General Public
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoLicense along with this library; if not, write to the Free Software
250b1eec71b074acdff1c5f6b5a1f0d7d2c20b77Stéphane GraberFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano-->
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
7f95145833bb24f54e037f73ecc37444d6635697Dwight Engen<!DOCTYPE refentry PUBLIC @docdtd@ [
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normand
10fba81b9d0221b8e47aa1e0b43236413b7d28dfMichel Normand<!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normand<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normand]>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano<refentry>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refmeta>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refentrytitle>lxc-create</refentrytitle>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <manvolnum>1</manvolnum>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </refmeta>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refnamediv>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refname>lxc-create</refname>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refpurpose>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano creates a container
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </refpurpose>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </refnamediv>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refsynopsisdiv>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <cmdsynopsis>
b4578c5b380130a41a69b5b49c970157acaf1dbbDwight Engen <command>lxc-create</command>
b4578c5b380130a41a69b5b49c970157acaf1dbbDwight Engen <arg choice="req">-n <replaceable>name</replaceable></arg>
b4578c5b380130a41a69b5b49c970157acaf1dbbDwight Engen <arg choice="opt">-f <replaceable>config_file</replaceable></arg>
b4578c5b380130a41a69b5b49c970157acaf1dbbDwight Engen <arg choice="opt">-t <replaceable>template</replaceable></arg>
b4578c5b380130a41a69b5b49c970157acaf1dbbDwight Engen <arg choice="opt">-B <replaceable>backingstore</replaceable></arg>
b4578c5b380130a41a69b5b49c970157acaf1dbbDwight Engen <arg choice="opt">-- <replaceable>template-options</replaceable></arg>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </cmdsynopsis>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </refsynopsisdiv>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refsect1>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <title>Description</title>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <command>lxc-create</command> creates a system object where is
36b33520f67cd1a83be8031fccc3c2d7d7255e06Stéphane Graber stored the configuration information and where can be stored
6a22713f648be8bd21297f57d9b631eb4c537ffeDaniel Lezcano user information. The identifier <replaceable>name</replaceable>
6a22713f648be8bd21297f57d9b631eb4c537ffeDaniel Lezcano is used to specify the container to be used with the different
6a22713f648be8bd21297f57d9b631eb4c537ffeDaniel Lezcano lxc commands.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </para>
becc0400fc83516b05a8e76f2cdfbf452cc46c94Michel Normand <para>
4d67c1301b9cf6587b0cc2e42f4e61ed6c29097cFerenc Wagner The object is a directory created in <filename>@LXCPATH@</filename>
4d67c1301b9cf6587b0cc2e42f4e61ed6c29097cFerenc Wagner and identified by its name.
becc0400fc83516b05a8e76f2cdfbf452cc46c94Michel Normand </para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <para>
becc0400fc83516b05a8e76f2cdfbf452cc46c94Michel Normand The object is the definition of the different resources an
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano application can use or can see. The more the configuration file
36b33520f67cd1a83be8031fccc3c2d7d7255e06Stéphane Graber contains information, the more the container is isolated and
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano the more the application is jailed.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano If the configuration file <replaceable>config_file</replaceable>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano is not specified, the container will be created with the default
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano isolation: processes, sysv ipc and mount points.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </refsect1>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refsect1>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <title>Options</title>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <variablelist>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <varlistentry>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <term>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <option>-f <replaceable>config_file</replaceable></option>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </term>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <listitem>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano Specify the configuration file to configure the virtualization
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano and isolation functionalities for the container.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </listitem>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </varlistentry>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand <varlistentry>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand <term>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand <option>-t <replaceable>template</replaceable></option>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand </term>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand <listitem>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand <para>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand 'template' is the short name of an existing 'lxc-template'
4d67c1301b9cf6587b0cc2e42f4e61ed6c29097cFerenc Wagner script that is called by lxc-create,
e2b4064f94f47246e5e2e6359b91b57cab0a0652Serge Hallyn eg. busybox, debian, fedora, ubuntu or sshd.
4d67c1301b9cf6587b0cc2e42f4e61ed6c29097cFerenc Wagner Refer to the examples in <filename>@LXCTEMPLATEDIR@</filename>
4d67c1301b9cf6587b0cc2e42f4e61ed6c29097cFerenc Wagner for details of the expected script structure.
24b292c917fe325e51e2ccd7dc3e4e05fee2d1e5Stéphane Graber Alternatively, the full path to an executable template script
24b292c917fe325e51e2ccd7dc3e4e05fee2d1e5Stéphane Graber can also be passed as a parameter.
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand </para>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand </listitem>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand </varlistentry>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <varlistentry>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <term>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <option>-B <replaceable>backingstore</replaceable></option>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn </term>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <listitem>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <para>
eddaaafd1a9b02ba39e5b6b13d40b4a5d37a04e1Serge Hallyn 'backingstore' is one of 'none', 'dir', 'lvm', 'loop', or 'btrfs'. The
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn default is 'none', meaning that the container root filesystem
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn will be a directory under <filename>@LXCPATH@/container/rootfs</filename>.
1881820ae4ff9004beef1bf7f04553580840441dSerge Hallyn 'dir' has the same meaning as 'none', but also allows the optional
1881820ae4ff9004beef1bf7f04553580840441dSerge Hallyn <replaceable>--dir ROOTFS</replaceable> to be specified, meaning
1881820ae4ff9004beef1bf7f04553580840441dSerge Hallyn that the container rootfs should be placed under the specified path,
fbbf51926e113e5e70d6ea507ed7d1019d0e0aa8Serge Hallyn rather than the default. If 'btrfs' is specified, then the
fbbf51926e113e5e70d6ea507ed7d1019d0e0aa8Serge Hallyn target filesystem must be btrfs, and the container rootfs will be
fbbf51926e113e5e70d6ea507ed7d1019d0e0aa8Serge Hallyn created as a new subvolume. This allows snapshotted clones to be
fbbf51926e113e5e70d6ea507ed7d1019d0e0aa8Serge Hallyn created, but also causes rsync --one-filesystem to treat it as a
fbbf51926e113e5e70d6ea507ed7d1019d0e0aa8Serge Hallyn separate filesystem.
fbbf51926e113e5e70d6ea507ed7d1019d0e0aa8Serge Hallyn If backingstore is 'lvm', then an lvm block device will be
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn used and the following further options are available:
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <replaceable>--lvname lvname1</replaceable> will create an LV
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn named <filename>lvname1</filename> rather than the default, which
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn is the container name. <replaceable>--vgname vgname1</replaceable>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn will create the LV in volume group <filename>vgname1</filename>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn rather than the default, <filename>lxc</filename>.
62c70ee2c1b49e7ecd2bfe156a66cbcfc5ecb502Sidnei da Silva <replaceable>--thinpool thinpool1</replaceable> will create the
62c70ee2c1b49e7ecd2bfe156a66cbcfc5ecb502Sidnei da Silva LV as a thin-provisioned volume in the pool named
055af165efb08f4dd54608896893bb6928fd472fSidnei da Silva <filename>thinpool1</filename> rather than the
055af165efb08f4dd54608896893bb6928fd472fSidnei da Silva default, <filename>lxc</filename>.
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <replaceable>--fstype FSTYPE</replaceable> will create an FSTYPE
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn filesystem on the LV, rather than the default, which is ext4.
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <replaceable>--fssize SIZE</replaceable> will create a LV (and
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn filesystem) of size SIZE rather than the default, which is 1G.
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn </para>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn </listitem>
aa8d013ec5b09cd1cd904173d6234ef126eb2126Peter Simons </varlistentry>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <varlistentry>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <term>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <option>-- <replaceable>template-options</replaceable></option>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn </term>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <listitem>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <para>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn This will pass <replaceable>template-options</replaceable> to the
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn template as arguments. To see the list of options supported by
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn the template, you can run
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn <command>lxc-create -t TEMPLATE -h</command>.
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn </para>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn </listitem>
1305dd24af039cefc54bc2f21b04b33b62bb26c8Serge Hallyn </varlistentry>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </variablelist>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </refsect1>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
eb7829c1c6ae93e695e55a43eedf655750ba7b60KATOH Yasufumi &commonoptions;
eb7829c1c6ae93e695e55a43eedf655750ba7b60KATOH Yasufumi
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refsect1>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <title>Diagnostic</title>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <variablelist>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <varlistentry>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <term>The container already exists</term>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <listitem>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano As the message mention it, you try to create a container
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano but there is a container with the same name. You can use
a600d021adf34e58b3991269a9ceca3737c63aa8KATOH Yasufumi the <command>lxc-ls</command> command to list the
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano available containers on the system.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </listitem>
aa8d013ec5b09cd1cd904173d6234ef126eb2126Peter Simons </varlistentry>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </variablelist>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </refsect1>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normand &seealso;
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <refsect1>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <title>Author</title>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </refsect1>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano</refentry>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano<!-- Keep this comment at the end of the file
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoLocal variables:
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanomode: sgml
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-omittag:t
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-shorttag:t
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-minimize-attributes:nil
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-always-quote-attributes:t
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-indent-step:2
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-indent-data:t
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-parent-document:nil
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-default-dtd-file:nil
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-exposed-tags:nil
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-local-catalogs:nil
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanosgml-local-ecat-files:nil
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoEnd:
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano-->