1 ganeti(7) Ganeti | Version @GANETI_VERSION@
2 ===========================================
7 ganeti - cluster-based virtualization management
14 # gnt-cluster init cluster1.example.com
15 # gnt-node add node2.example.com
16 # gnt-instance add -n node2.example.com \
17 > -o debootstrap --disk 0:size=30g \
18 > -t plain instance1.example.com
24 The Ganeti software manages physical nodes and virtual instances of a
25 cluster based on a virtualization software. The current version (2.3)
26 supports Xen 3.x and KVM (72 or above) as hypervisors, and LXC as an
27 experimental hypervisor.
32 First you must install the software on all the cluster nodes, either
33 from sources or (if available) from a package. The next step is to
34 create the initial cluster configuration, using **gnt-cluster init**.
36 Then you can add other nodes, or start creating instances.
41 In Ganeti 2.0, the architecture of the cluster is a little more
42 complicated than in 1.2. The cluster is coordinated by a master daemon
43 (**ganeti-masterd**(8)), running on the master node. Each node runs
44 (as before) a node daemon, and the master has the RAPI daemon running
50 Each node can be in one of the following states:
53 Only one node per cluster can be in this role, and this node is the
54 one holding the authoritative copy of the cluster configuration and
55 the one that can actually execute commands on the cluster and
56 modify the cluster state. See more details under
57 *Cluster configuration*.
60 The node receives the full cluster configuration (configuration
61 file and jobs) and can become a master via the
62 **gnt-cluster master-failover** command. Nodes that are not in this
63 state cannot transition into the master role due to missing state.
66 This the normal state of a node.
69 Nodes in this state are functioning normally but cannot receive
70 new instances, because the intention is to set them to *offline*
71 or remove them from the cluster.
74 These nodes are still recorded in the Ganeti configuration, but
75 except for the master daemon startup voting procedure, they are not
76 actually contacted by the master. This state was added in order to
77 allow broken machines (that are being repaired) to remain in the
78 cluster but without creating problems.
84 Nodes have two flags which govern which roles they can take:
87 The node can become a master candidate, and furthermore the master
88 node. When this flag is disabled, the node cannot become a
89 candidate; this can be useful for special networking cases, or less
93 The node can host instances. When enabled (the default state), the
94 node will participate in instance allocation, capacity calculation,
95 etc. When disabled, the node will be skipped in many cluster checks
102 These parameters are node specific and can be preseeded on node-group
105 Currently we support the following node parameters:
108 Path to an executable used as the out-of-band helper as described in
109 the `Ganeti Node OOB Management Framework <design-oob.rst>`_ design
113 Hypervisor State Parameters
114 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
116 Using ``--hypervisor-state`` you can set hypervisor specific states as
117 pointed out in ``Ganeti Resource Model <design-resource-model.rst>``.
119 The format is: ``hypervisor:option=value``.
121 Currently we support the following hypervisor state values:
124 Total node memory, as discovered by this hypervisor
126 Memory used by, or reserved for, the node itself; note that some
127 hypervisors can report this in an authoritative way, other not
129 Memory used either by the hypervisor itself or lost due to instance
130 allocation rounding; usually this cannot be precisely computed, but
131 only roughly estimated
133 Total node cpu (core) count; usually this can be discovered
136 Number of cores reserved for the node itself; this can either be
137 discovered or set manually. Only used for estimating how many VCPUs
138 are left for instances
141 Disk State Parameters
142 ~~~~~~~~~~~~~~~~~~~~~
144 Using ``--disk-state`` you can set disk specific states as pointed out
145 in ``Ganeti Resource Model <design-resource-model.rst>``.
147 The format is: ``storage_type/identifier:option=value``. Where we
148 currently just support ``lvm`` as storage type. The identifier in this
149 case is the LVM volume group. By default this is ``xenvg``.
151 Currently we support the following hypervisor state values:
154 Total disk size (usually discovered automatically)
156 Reserved disk size; this is a lower limit on the free space, if such a
159 Disk that is expected to be used by other volumes (set via
160 ``reserved_lvs``); usually should be zero
163 Cluster configuration
164 ~~~~~~~~~~~~~~~~~~~~~
166 The master node keeps and is responsible for the cluster
167 configuration. On the filesystem, this is stored under the
168 ``@LOCALSTATEDIR@/ganeti/lib`` directory, and if the master daemon is
169 stopped it can be backed up normally.
171 The master daemon will replicate the configuration database called
172 ``config.data`` and the job files to all the nodes in the master
173 candidate role. It will also distribute a copy of some configuration
174 values via the *ssconf* files, which are stored in the same directory
175 and start with a ``ssconf_`` prefix, to all nodes.
180 All cluster modification are done via jobs. A job consists of one
181 or more opcodes, and the list of opcodes is processed serially. If
182 an opcode fails, the entire job is failed and later opcodes are no
183 longer processed. A job can be in one of the following states:
186 The job has been submitted but not yet processed by the master
190 The job is waiting for for locks before the first of its opcodes.
193 The job is waiting for locks, but is has been marked for
194 cancellation. It will not transition to *running*, but to
198 The job is currently being executed.
201 The job has been canceled before starting execution.
204 The job has finished successfully.
207 The job has failed during runtime, or the master daemon has been
208 stopped during the job execution.
211 Common command line features
212 ----------------------------
217 Many Ganeti commands provide the following options. The
218 availability for a certain command can be checked by calling the
219 command using the ``--help`` option.
221 **gnt-...** *command* [--dry-run] [--priority {low | normal | high}]
223 The ``--dry-run`` option can be used to check whether an operation
226 The option ``--priority`` sets the priority for opcodes submitted
232 For certain commands you can use environment variables to provide
233 default command line arguments. Just assign the arguments as a string to
234 the corresponding environment variable. The format of that variable
235 name is **binary**_*command*. **binary** is the name of the ``gnt-*``
236 script all upper case and dashes replaced by underscores, and *command*
237 is the command invoked on that script.
239 Currently supported commands are ``gnt-node list``, ``gnt-group list``
240 and ``gnt-instance list``. So you can configure default command line
241 flags by setting ``GNT_NODE_LIST``, ``GNT_GROUP_LIST`` and
242 ``GNT_INSTANCE_LIST``.
247 Multiple ganeti commands use the same framework for tabular listing of
248 resources (e.g. **gnt-instance list**, **gnt-node list**, **gnt-group
249 list**, **gnt-debug locks**, etc.). For these commands, special states
250 are denoted via a special symbol (in terse mode) or a string (in
254 The node in question is marked offline, and thus it cannot be
255 queried for data. This result is persistent until the node is
259 Ganeti expected to receive an answer from this entity, but the
260 cluster RPC call failed and/or we didn't receive a valid answer;
261 usually more information is available in the node daemon log (if
262 the node is alive) or the master daemon log. This result is
263 transient, and re-running command might return a different result.
266 The respective field doesn't make sense for this entity;
267 e.g. querying a down instance for its current memory 'live' usage,
268 or querying a non-vm_capable node for disk/memory data. This
269 result is persistent, and until the entity state is changed via
270 ganeti commands, the result won't change.
273 This field is not known (note that this is different from entity
274 being unknown). Either you have mis-typed the field name, or you
275 are using a field that the running Ganeti master daemon doesn't
276 know. This result is persistent, re-running the command won't
282 Multiple options take parameters that are of the form
283 ``key=value,key=value,...`` or ``category:key=value,...``. Examples
284 are the hypervisor parameters, backend parameters, etc. For these,
285 it's possible to use values that contain commas by escaping with via a
286 backslash (which needs two if not single-quoted, due to shell
289 # gnt-instance modify -H kernel_path=an\\,example instance1
290 # gnt-instance modify -H kernel_path='an\,example' instance1
295 Most commands listing resources (e.g. instances or nodes) support filtering.
296 The filter language is similar to Python expressions with some elements from
297 Perl. The language is not generic. Each condition must consist of a field name
298 and a value (except for boolean checks), a field can not be compared to another
299 field. Keywords are case-sensitive.
301 Syntax in pseudo-BNF::
303 <quoted-string> ::= /* String quoted with single or double quotes,
304 backslash for escaping */
306 <integer> ::= /* Number in base-10 positional notation */
308 <re> ::= /* Regular expression */
311 Modifier "i": Case-insensitive matching, see
312 http://docs.python.org/library/re#re.IGNORECASE
314 Modifier "s": Make the "." special character match any character,
315 including newline, see http://docs.python.org/library/re#re.DOTALL
317 <re-modifiers> ::= /* empty */ | i | s
319 <value> ::= <quoted-string> | <integer>
322 { /* Value comparison */
323 <field> { == | != } <value>
325 /* Collection membership */
326 | <value> [ not ] in <field>
328 /* Regular expressions (recognized delimiters
329 are "/", "#", "^", and "|"; backslash for escaping)
331 | <field> { =~ | !~ } m/<re>/<re-modifiers>
334 | <field> { =* | !* } <quoted-string>
341 { [ not ] <condition> | ( <filter> ) }
342 [ { and | or } <filter> ]
351 Pattern match using regular expression
353 Logically negated from *=~*
355 Globbing, see **glob**(7), though only * and ? are supported
357 Logically negated from *=\**
359 Collection membership and negation
361 As a shortcut globbing patterns can be specified as names, e.g.
362 ``gnt-instance list '*.site1' '*.site2'``.
365 Common daemon functionality
366 ---------------------------
368 All Ganeti daemons re-open the log file(s) when sent a SIGHUP signal.
369 **logrotate**(8) can be used to rotate Ganeti's log files.
371 .. vim: set textwidth=72 :