]> git.proxmox.com Git - mirror_lxc.git/blame - doc/lxc-create.sgml.in
lxc-debian: Don't eat the argument after -c
[mirror_lxc.git] / doc / lxc-create.sgml.in
CommitLineData
aa8d013e 1<!--
d823d5b9 2
3lxc: linux Container library
4
5(C) Copyright IBM Corp. 2007, 2008
6
7Authors:
9afe19d6 8Daniel Lezcano <daniel.lezcano at free.fr>
d823d5b9 9
10This library is free software; you can redistribute it and/or
11modify it under the terms of the GNU Lesser General Public
12License as published by the Free Software Foundation; either
13version 2.1 of the License, or (at your option) any later version.
14
15This library is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18Lesser General Public License for more details.
19
20You should have received a copy of the GNU Lesser General Public
21License along with this library; if not, write to the Free Software
250b1eec 22Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
d823d5b9 23
24-->
25
7f951458 26<!DOCTYPE refentry PUBLIC @docdtd@ [
99e4008c 27
10fba81b 28<!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
99e4008c
MN
29<!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
30]>
d823d5b9 31
32<refentry>
33
34 <docinfo><date>@LXC_GENERATE_DATE@</date></docinfo>
35
36 <refmeta>
37 <refentrytitle>lxc-create</refentrytitle>
38 <manvolnum>1</manvolnum>
39 </refmeta>
40
41 <refnamediv>
42 <refname>lxc-create</refname>
43
44 <refpurpose>
45 creates a container
46 </refpurpose>
47 </refnamediv>
48
49 <refsynopsisdiv>
50 <cmdsynopsis>
b4578c5b
DE
51 <command>lxc-create</command>
52 <arg choice="req">-n <replaceable>name</replaceable></arg>
53 <arg choice="opt">-f <replaceable>config_file</replaceable></arg>
54 <arg choice="opt">-t <replaceable>template</replaceable></arg>
55 <arg choice="opt">-B <replaceable>backingstore</replaceable></arg>
56 <arg choice="opt">-- <replaceable>template-options</replaceable></arg>
d823d5b9 57 </cmdsynopsis>
58 </refsynopsisdiv>
59
60 <refsect1>
61 <title>Description</title>
62
63 <para>
64 <command>lxc-create</command> creates a system object where is
36b33520 65 stored the configuration information and where can be stored
6a22713f
DL
66 user information. The identifier <replaceable>name</replaceable>
67 is used to specify the container to be used with the different
68 lxc commands.
d823d5b9 69 </para>
becc0400 70 <para>
4d67c130
FW
71 The object is a directory created in <filename>@LXCPATH@</filename>
72 and identified by its name.
becc0400 73 </para>
d823d5b9 74
75 <para>
becc0400 76 The object is the definition of the different resources an
d823d5b9 77 application can use or can see. The more the configuration file
36b33520 78 contains information, the more the container is isolated and
d823d5b9 79 the more the application is jailed.
80 </para>
81
82 <para>
83 If the configuration file <replaceable>config_file</replaceable>
84 is not specified, the container will be created with the default
85 isolation: processes, sysv ipc and mount points.
86 </para>
87 </refsect1>
88
89 <refsect1>
90 <title>Options</title>
91 <variablelist>
92
d823d5b9 93 <varlistentry>
94 <term>
95 <option>-f <replaceable>config_file</replaceable></option>
96 </term>
97 <listitem>
98 <para>
99 Specify the configuration file to configure the virtualization
100 and isolation functionalities for the container.
101 </para>
102 </listitem>
103 </varlistentry>
0bb4f8cf
MN
104
105 <varlistentry>
106 <term>
107 <option>-t <replaceable>template</replaceable></option>
108 </term>
109 <listitem>
110 <para>
111 'template' is the short name of an existing 'lxc-template'
4d67c130 112 script that is called by lxc-create,
e2b4064f 113 eg. busybox, debian, fedora, ubuntu or sshd.
4d67c130
FW
114 Refer to the examples in <filename>@LXCTEMPLATEDIR@</filename>
115 for details of the expected script structure.
24b292c9
SG
116 Alternatively, the full path to an executable template script
117 can also be passed as a parameter.
d3de16bb 118 "none" can be used to force lxc-create to skip rootfs creation.
0bb4f8cf
MN
119 </para>
120 </listitem>
121 </varlistentry>
1305dd24
SH
122
123 <varlistentry>
124 <term>
125 <option>-B <replaceable>backingstore</replaceable></option>
126 </term>
127 <listitem>
128 <para>
eddaaafd 129 'backingstore' is one of 'none', 'dir', 'lvm', 'loop', or 'btrfs'. The
1305dd24
SH
130 default is 'none', meaning that the container root filesystem
131 will be a directory under <filename>@LXCPATH@/container/rootfs</filename>.
1881820a
SH
132 'dir' has the same meaning as 'none', but also allows the optional
133 <replaceable>--dir ROOTFS</replaceable> to be specified, meaning
134 that the container rootfs should be placed under the specified path,
fbbf5192
SH
135 rather than the default. If 'btrfs' is specified, then the
136 target filesystem must be btrfs, and the container rootfs will be
137 created as a new subvolume. This allows snapshotted clones to be
138 created, but also causes rsync --one-filesystem to treat it as a
139 separate filesystem.
140 If backingstore is 'lvm', then an lvm block device will be
1305dd24
SH
141 used and the following further options are available:
142 <replaceable>--lvname lvname1</replaceable> will create an LV
143 named <filename>lvname1</filename> rather than the default, which
144 is the container name. <replaceable>--vgname vgname1</replaceable>
145 will create the LV in volume group <filename>vgname1</filename>
146 rather than the default, <filename>lxc</filename>.
62c70ee2
SS
147 <replaceable>--thinpool thinpool1</replaceable> will create the
148 LV as a thin-provisioned volume in the pool named
055af165
SS
149 <filename>thinpool1</filename> rather than the
150 default, <filename>lxc</filename>.
1305dd24
SH
151 <replaceable>--fstype FSTYPE</replaceable> will create an FSTYPE
152 filesystem on the LV, rather than the default, which is ext4.
153 <replaceable>--fssize SIZE</replaceable> will create a LV (and
154 filesystem) of size SIZE rather than the default, which is 1G.
155 </para>
156 </listitem>
aa8d013e 157 </varlistentry>
1305dd24
SH
158
159 <varlistentry>
160 <term>
161 <option>-- <replaceable>template-options</replaceable></option>
162 </term>
163 <listitem>
164 <para>
165 This will pass <replaceable>template-options</replaceable> to the
166 template as arguments. To see the list of options supported by
167 the template, you can run
168 <command>lxc-create -t TEMPLATE -h</command>.
169 </para>
170 </listitem>
171 </varlistentry>
d823d5b9 172
173 </variablelist>
174
175 </refsect1>
176
eb7829c1
KY
177 &commonoptions;
178
d823d5b9 179 <refsect1>
180 <title>Diagnostic</title>
181
182 <variablelist>
183
184 <varlistentry>
185 <term>The container already exists</term>
186 <listitem>
187 <para>
188 As the message mention it, you try to create a container
189 but there is a container with the same name. You can use
a600d021 190 the <command>lxc-ls</command> command to list the
d823d5b9 191 available containers on the system.
192 </para>
193 </listitem>
aa8d013e 194 </varlistentry>
d823d5b9 195
196 </variablelist>
197
198 </refsect1>
199
99e4008c 200 &seealso;
d823d5b9 201
202 <refsect1>
203 <title>Author</title>
204 <para>Daniel Lezcano <email>daniel.lezcano@free.fr</email></para>
205 </refsect1>
206
207</refentry>
208
209<!-- Keep this comment at the end of the file
210Local variables:
211mode: sgml
212sgml-omittag:t
213sgml-shorttag:t
214sgml-minimize-attributes:nil
215sgml-always-quote-attributes:t
216sgml-indent-step:2
217sgml-indent-data:t
218sgml-parent-document:nil
219sgml-default-dtd-file:nil
220sgml-exposed-tags:nil
221sgml-local-catalogs:nil
222sgml-local-ecat-files:nil
223End:
224-->