root / man / ganeti.rst @ adec726e
History | View | Annotate | Download (15.1 kB)
1 | cc424a1d | Iustin Pop | ganeti(7) Ganeti | Version @GANETI_VERSION@ |
---|---|---|---|
2 | cc424a1d | Iustin Pop | =========================================== |
3 | cc424a1d | Iustin Pop | |
4 | cc424a1d | Iustin Pop | Name |
5 | cc424a1d | Iustin Pop | ---- |
6 | cc424a1d | Iustin Pop | |
7 | cc424a1d | Iustin Pop | ganeti - cluster-based virtualization management |
8 | cc424a1d | Iustin Pop | |
9 | cc424a1d | Iustin Pop | Synopsis |
10 | cc424a1d | Iustin Pop | -------- |
11 | cc424a1d | Iustin Pop | |
12 | cc424a1d | Iustin Pop | :: |
13 | cc424a1d | Iustin Pop | |
14 | cc424a1d | Iustin Pop | # gnt-cluster init cluster1.example.com |
15 | cc424a1d | Iustin Pop | # gnt-node add node2.example.com |
16 | cc424a1d | Iustin Pop | # gnt-instance add -n node2.example.com \ |
17 | cc424a1d | Iustin Pop | > -o debootstrap --disk 0:size=30g \ |
18 | cc424a1d | Iustin Pop | > -t plain instance1.example.com |
19 | cc424a1d | Iustin Pop | |
20 | cc424a1d | Iustin Pop | |
21 | cc424a1d | Iustin Pop | DESCRIPTION |
22 | cc424a1d | Iustin Pop | ----------- |
23 | cc424a1d | Iustin Pop | |
24 | cc424a1d | Iustin Pop | The Ganeti software manages physical nodes and virtual instances of a |
25 | cc424a1d | Iustin Pop | cluster based on a virtualization software. The current version (2.3) |
26 | cc424a1d | Iustin Pop | supports Xen 3.x and KVM (72 or above) as hypervisors, and LXC as an |
27 | cc424a1d | Iustin Pop | experimental hypervisor. |
28 | cc424a1d | Iustin Pop | |
29 | cc424a1d | Iustin Pop | Quick start |
30 | cc424a1d | Iustin Pop | ----------- |
31 | cc424a1d | Iustin Pop | |
32 | cc424a1d | Iustin Pop | First you must install the software on all the cluster nodes, either |
33 | cc424a1d | Iustin Pop | from sources or (if available) from a package. The next step is to |
34 | cc424a1d | Iustin Pop | create the initial cluster configuration, using **gnt-cluster init**. |
35 | cc424a1d | Iustin Pop | |
36 | cc424a1d | Iustin Pop | Then you can add other nodes, or start creating instances. |
37 | cc424a1d | Iustin Pop | |
38 | cc424a1d | Iustin Pop | Cluster architecture |
39 | cc424a1d | Iustin Pop | -------------------- |
40 | cc424a1d | Iustin Pop | |
41 | cc424a1d | Iustin Pop | In Ganeti 2.0, the architecture of the cluster is a little more |
42 | cc424a1d | Iustin Pop | complicated than in 1.2. The cluster is coordinated by a master daemon |
43 | 354c4f62 | Michael Hanselmann | (**ganeti-masterd**\(8)), running on the master node. Each node runs |
44 | cc424a1d | Iustin Pop | (as before) a node daemon, and the master has the RAPI daemon running |
45 | cc424a1d | Iustin Pop | too. |
46 | cc424a1d | Iustin Pop | |
47 | cc424a1d | Iustin Pop | Node roles |
48 | cc424a1d | Iustin Pop | ~~~~~~~~~~ |
49 | cc424a1d | Iustin Pop | |
50 | cc424a1d | Iustin Pop | Each node can be in one of the following states: |
51 | cc424a1d | Iustin Pop | |
52 | cc424a1d | Iustin Pop | master |
53 | cc424a1d | Iustin Pop | Only one node per cluster can be in this role, and this node is the |
54 | cc424a1d | Iustin Pop | one holding the authoritative copy of the cluster configuration and |
55 | cc424a1d | Iustin Pop | the one that can actually execute commands on the cluster and |
56 | cc424a1d | Iustin Pop | modify the cluster state. See more details under |
57 | cc424a1d | Iustin Pop | *Cluster configuration*. |
58 | cc424a1d | Iustin Pop | |
59 | cc424a1d | Iustin Pop | master_candidate |
60 | cc424a1d | Iustin Pop | The node receives the full cluster configuration (configuration |
61 | cc424a1d | Iustin Pop | file and jobs) and can become a master via the |
62 | cc424a1d | Iustin Pop | **gnt-cluster master-failover** command. Nodes that are not in this |
63 | cc424a1d | Iustin Pop | state cannot transition into the master role due to missing state. |
64 | cc424a1d | Iustin Pop | |
65 | cc424a1d | Iustin Pop | regular |
66 | cc424a1d | Iustin Pop | This the normal state of a node. |
67 | cc424a1d | Iustin Pop | |
68 | cc424a1d | Iustin Pop | drained |
69 | cc424a1d | Iustin Pop | Nodes in this state are functioning normally but cannot receive |
70 | cc424a1d | Iustin Pop | new instances, because the intention is to set them to *offline* |
71 | cc424a1d | Iustin Pop | or remove them from the cluster. |
72 | cc424a1d | Iustin Pop | |
73 | cc424a1d | Iustin Pop | offline |
74 | cc424a1d | Iustin Pop | These nodes are still recorded in the Ganeti configuration, but |
75 | cc424a1d | Iustin Pop | except for the master daemon startup voting procedure, they are not |
76 | cc424a1d | Iustin Pop | actually contacted by the master. This state was added in order to |
77 | cc424a1d | Iustin Pop | allow broken machines (that are being repaired) to remain in the |
78 | cc424a1d | Iustin Pop | cluster but without creating problems. |
79 | cc424a1d | Iustin Pop | |
80 | cc424a1d | Iustin Pop | |
81 | cc424a1d | Iustin Pop | Node flags |
82 | cc424a1d | Iustin Pop | ~~~~~~~~~~ |
83 | cc424a1d | Iustin Pop | |
84 | cc424a1d | Iustin Pop | Nodes have two flags which govern which roles they can take: |
85 | cc424a1d | Iustin Pop | |
86 | cc424a1d | Iustin Pop | master_capable |
87 | cc424a1d | Iustin Pop | The node can become a master candidate, and furthermore the master |
88 | cc424a1d | Iustin Pop | node. When this flag is disabled, the node cannot become a |
89 | cc424a1d | Iustin Pop | candidate; this can be useful for special networking cases, or less |
90 | cc424a1d | Iustin Pop | reliable hardware. |
91 | cc424a1d | Iustin Pop | |
92 | cc424a1d | Iustin Pop | vm_capable |
93 | cc424a1d | Iustin Pop | The node can host instances. When enabled (the default state), the |
94 | cc424a1d | Iustin Pop | node will participate in instance allocation, capacity calculation, |
95 | cc424a1d | Iustin Pop | etc. When disabled, the node will be skipped in many cluster checks |
96 | cc424a1d | Iustin Pop | and operations. |
97 | cc424a1d | Iustin Pop | |
98 | cc424a1d | Iustin Pop | |
99 | b74bf80c | René Nussbaumer | Node Parameters |
100 | b74bf80c | René Nussbaumer | ~~~~~~~~~~~~~~~ |
101 | b74bf80c | René Nussbaumer | |
102 | 432e8e2f | Iustin Pop | The ``ndparams`` refer to node parameters. These can be set as defaults |
103 | 432e8e2f | Iustin Pop | on cluster and node group levels, but they take effect for nodes only. |
104 | b74bf80c | René Nussbaumer | |
105 | b74bf80c | René Nussbaumer | Currently we support the following node parameters: |
106 | b74bf80c | René Nussbaumer | |
107 | b74bf80c | René Nussbaumer | oob_program |
108 | b74bf80c | René Nussbaumer | Path to an executable used as the out-of-band helper as described in |
109 | b74bf80c | René Nussbaumer | the `Ganeti Node OOB Management Framework <design-oob.rst>`_ design |
110 | b74bf80c | René Nussbaumer | document. |
111 | b74bf80c | René Nussbaumer | |
112 | 432e8e2f | Iustin Pop | spindle_count |
113 | 432e8e2f | Iustin Pop | This should reflect the I/O performance of local attached storage |
114 | 432e8e2f | Iustin Pop | (e.g. for "file", "plain" and "drbd" disk templates). It doesn't |
115 | 432e8e2f | Iustin Pop | have to match the actual spindle count of (any eventual) mechanical |
116 | 432e8e2f | Iustin Pop | hard-drives, its meaning is site-local and just the relative values |
117 | 432e8e2f | Iustin Pop | matter. |
118 | 432e8e2f | Iustin Pop | |
119 | 0ea11dcb | Bernardo Dal Seno | exclusive_storage |
120 | 0ea11dcb | Bernardo Dal Seno | When this Boolean flag is enabled, physical disks on the node are |
121 | 0ea11dcb | Bernardo Dal Seno | assigned to instance disks in an exclusive manner, so as to lower I/O |
122 | 0ea11dcb | Bernardo Dal Seno | interference between instances. See the `Partitioned Ganeti |
123 | 250a9404 | Bernardo Dal Seno | <design-partitioned.rst>`_ design document for more details. This |
124 | 250a9404 | Bernardo Dal Seno | parameter cannot be set on individual nodes, as its value must be |
125 | 250a9404 | Bernardo Dal Seno | the same within each node group. |
126 | 0ea11dcb | Bernardo Dal Seno | |
127 | 2e5fc2ed | Sebastian Gebhard | ovs |
128 | 2e5fc2ed | Sebastian Gebhard | When this Boolean flag is enabled, OpenvSwitch will be used as the |
129 | 2e5fc2ed | Sebastian Gebhard | network layer. This will cause the initialization of OpenvSwitch on |
130 | 2e5fc2ed | Sebastian Gebhard | the nodes when added to the cluster. Per default this is not enabled. |
131 | 2e5fc2ed | Sebastian Gebhard | |
132 | 2e5fc2ed | Sebastian Gebhard | ovs_name |
133 | 2e5fc2ed | Sebastian Gebhard | When ovs is enabled, this parameter will represent the name of the |
134 | 2e5fc2ed | Sebastian Gebhard | OpenvSwitch to generate and use. This will default to `switch1`. |
135 | 2e5fc2ed | Sebastian Gebhard | |
136 | 2e5fc2ed | Sebastian Gebhard | ovs_link |
137 | 2e5fc2ed | Sebastian Gebhard | When ovs is enabled, a OpenvSwitch will be initialized on new nodes |
138 | 2e5fc2ed | Sebastian Gebhard | and will have this as its connection to the outside. This parameter |
139 | 2e5fc2ed | Sebastian Gebhard | is not set per default, as it depends very much on the specific |
140 | 2e5fc2ed | Sebastian Gebhard | setup. |
141 | 2e5fc2ed | Sebastian Gebhard | |
142 | 836ce0c8 | Petr Pudlak | ssh_port |
143 | 836ce0c8 | Petr Pudlak | The port used for SSH connections to nodes belonging to a group. The user |
144 | 836ce0c8 | Petr Pudlak | is responsible for properly configuring the ports of SSH daemons on |
145 | 836ce0c8 | Petr Pudlak | machines prior to adding them as Ganeti nodes or when modifying the |
146 | 836ce0c8 | Petr Pudlak | parameter value of an existing group. Note that using non-standard SSH |
147 | 836ce0c8 | Petr Pudlak | ports and downgrading to an older Ganeti version that doesn't support |
148 | 836ce0c8 | Petr Pudlak | ``ssh_port`` will break the cluster. |
149 | 836ce0c8 | Petr Pudlak | |
150 | b74bf80c | René Nussbaumer | |
151 | 0ec2ce46 | René Nussbaumer | Hypervisor State Parameters |
152 | 0ec2ce46 | René Nussbaumer | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
153 | 0ec2ce46 | René Nussbaumer | |
154 | 0ec2ce46 | René Nussbaumer | Using ``--hypervisor-state`` you can set hypervisor specific states as |
155 | 0ec2ce46 | René Nussbaumer | pointed out in ``Ganeti Resource Model <design-resource-model.rst>``. |
156 | 0ec2ce46 | René Nussbaumer | |
157 | 0ec2ce46 | René Nussbaumer | The format is: ``hypervisor:option=value``. |
158 | 0ec2ce46 | René Nussbaumer | |
159 | 0ec2ce46 | René Nussbaumer | Currently we support the following hypervisor state values: |
160 | 0ec2ce46 | René Nussbaumer | |
161 | 0ec2ce46 | René Nussbaumer | mem_total |
162 | 0ec2ce46 | René Nussbaumer | Total node memory, as discovered by this hypervisor |
163 | 0ec2ce46 | René Nussbaumer | mem_node |
164 | 0ec2ce46 | René Nussbaumer | Memory used by, or reserved for, the node itself; note that some |
165 | 0ec2ce46 | René Nussbaumer | hypervisors can report this in an authoritative way, other not |
166 | 0ec2ce46 | René Nussbaumer | mem_hv |
167 | 0ec2ce46 | René Nussbaumer | Memory used either by the hypervisor itself or lost due to instance |
168 | 0ec2ce46 | René Nussbaumer | allocation rounding; usually this cannot be precisely computed, but |
169 | 0ec2ce46 | René Nussbaumer | only roughly estimated |
170 | 0ec2ce46 | René Nussbaumer | cpu_total |
171 | 0ec2ce46 | René Nussbaumer | Total node cpu (core) count; usually this can be discovered |
172 | 0ec2ce46 | René Nussbaumer | automatically |
173 | 0ec2ce46 | René Nussbaumer | cpu_node |
174 | 0ec2ce46 | René Nussbaumer | Number of cores reserved for the node itself; this can either be |
175 | 0ec2ce46 | René Nussbaumer | discovered or set manually. Only used for estimating how many VCPUs |
176 | 0ec2ce46 | René Nussbaumer | are left for instances |
177 | 0ec2ce46 | René Nussbaumer | |
178 | a1cef552 | Iustin Pop | Note that currently this option is unused by Ganeti; values will be |
179 | a1cef552 | Iustin Pop | recorded but will not influence the Ganeti operation. |
180 | a1cef552 | Iustin Pop | |
181 | 0ec2ce46 | René Nussbaumer | |
182 | 0ec2ce46 | René Nussbaumer | Disk State Parameters |
183 | 0ec2ce46 | René Nussbaumer | ~~~~~~~~~~~~~~~~~~~~~ |
184 | 0ec2ce46 | René Nussbaumer | |
185 | 0ec2ce46 | René Nussbaumer | Using ``--disk-state`` you can set disk specific states as pointed out |
186 | 0ec2ce46 | René Nussbaumer | in ``Ganeti Resource Model <design-resource-model.rst>``. |
187 | 0ec2ce46 | René Nussbaumer | |
188 | 0ec2ce46 | René Nussbaumer | The format is: ``storage_type/identifier:option=value``. Where we |
189 | 0ec2ce46 | René Nussbaumer | currently just support ``lvm`` as storage type. The identifier in this |
190 | 0ec2ce46 | René Nussbaumer | case is the LVM volume group. By default this is ``xenvg``. |
191 | 0ec2ce46 | René Nussbaumer | |
192 | 0ec2ce46 | René Nussbaumer | Currently we support the following hypervisor state values: |
193 | 0ec2ce46 | René Nussbaumer | |
194 | 0ec2ce46 | René Nussbaumer | disk_total |
195 | 0ec2ce46 | René Nussbaumer | Total disk size (usually discovered automatically) |
196 | 0ec2ce46 | René Nussbaumer | disk_reserved |
197 | 0ec2ce46 | René Nussbaumer | Reserved disk size; this is a lower limit on the free space, if such a |
198 | 0ec2ce46 | René Nussbaumer | limit is desired |
199 | 0ec2ce46 | René Nussbaumer | disk_overhead |
200 | 0ec2ce46 | René Nussbaumer | Disk that is expected to be used by other volumes (set via |
201 | 0ec2ce46 | René Nussbaumer | ``reserved_lvs``); usually should be zero |
202 | 0ec2ce46 | René Nussbaumer | |
203 | a1cef552 | Iustin Pop | Note that currently this option is unused by Ganeti; values will be |
204 | a1cef552 | Iustin Pop | recorded but will not influence the Ganeti operation. |
205 | a1cef552 | Iustin Pop | |
206 | 0ec2ce46 | René Nussbaumer | |
207 | cc424a1d | Iustin Pop | Cluster configuration |
208 | cc424a1d | Iustin Pop | ~~~~~~~~~~~~~~~~~~~~~ |
209 | cc424a1d | Iustin Pop | |
210 | cc424a1d | Iustin Pop | The master node keeps and is responsible for the cluster |
211 | cc424a1d | Iustin Pop | configuration. On the filesystem, this is stored under the |
212 | cc424a1d | Iustin Pop | ``@LOCALSTATEDIR@/ganeti/lib`` directory, and if the master daemon is |
213 | cc424a1d | Iustin Pop | stopped it can be backed up normally. |
214 | cc424a1d | Iustin Pop | |
215 | cc424a1d | Iustin Pop | The master daemon will replicate the configuration database called |
216 | cc424a1d | Iustin Pop | ``config.data`` and the job files to all the nodes in the master |
217 | cc424a1d | Iustin Pop | candidate role. It will also distribute a copy of some configuration |
218 | cc424a1d | Iustin Pop | values via the *ssconf* files, which are stored in the same directory |
219 | cc424a1d | Iustin Pop | and start with a ``ssconf_`` prefix, to all nodes. |
220 | cc424a1d | Iustin Pop | |
221 | cc424a1d | Iustin Pop | Jobs |
222 | cc424a1d | Iustin Pop | ~~~~ |
223 | cc424a1d | Iustin Pop | |
224 | cc424a1d | Iustin Pop | All cluster modification are done via jobs. A job consists of one |
225 | cc424a1d | Iustin Pop | or more opcodes, and the list of opcodes is processed serially. If |
226 | cc424a1d | Iustin Pop | an opcode fails, the entire job is failed and later opcodes are no |
227 | cc424a1d | Iustin Pop | longer processed. A job can be in one of the following states: |
228 | cc424a1d | Iustin Pop | |
229 | cc424a1d | Iustin Pop | queued |
230 | cc424a1d | Iustin Pop | The job has been submitted but not yet processed by the master |
231 | cc424a1d | Iustin Pop | daemon. |
232 | cc424a1d | Iustin Pop | |
233 | cc424a1d | Iustin Pop | waiting |
234 | cc424a1d | Iustin Pop | The job is waiting for for locks before the first of its opcodes. |
235 | cc424a1d | Iustin Pop | |
236 | cc424a1d | Iustin Pop | canceling |
237 | cc424a1d | Iustin Pop | The job is waiting for locks, but is has been marked for |
238 | cc424a1d | Iustin Pop | cancellation. It will not transition to *running*, but to |
239 | cc424a1d | Iustin Pop | *canceled*. |
240 | cc424a1d | Iustin Pop | |
241 | cc424a1d | Iustin Pop | running |
242 | cc424a1d | Iustin Pop | The job is currently being executed. |
243 | cc424a1d | Iustin Pop | |
244 | cc424a1d | Iustin Pop | canceled |
245 | cc424a1d | Iustin Pop | The job has been canceled before starting execution. |
246 | cc424a1d | Iustin Pop | |
247 | cc424a1d | Iustin Pop | success |
248 | cc424a1d | Iustin Pop | The job has finished successfully. |
249 | cc424a1d | Iustin Pop | |
250 | cc424a1d | Iustin Pop | error |
251 | cc424a1d | Iustin Pop | The job has failed during runtime, or the master daemon has been |
252 | cc424a1d | Iustin Pop | stopped during the job execution. |
253 | cc424a1d | Iustin Pop | |
254 | cc424a1d | Iustin Pop | |
255 | 7ba19f39 | Iustin Pop | Common command line features |
256 | 7ba19f39 | Iustin Pop | ---------------------------- |
257 | 7ba19f39 | Iustin Pop | |
258 | 7ba19f39 | Iustin Pop | Options |
259 | 7ba19f39 | Iustin Pop | ~~~~~~~ |
260 | cc424a1d | Iustin Pop | |
261 | cc424a1d | Iustin Pop | Many Ganeti commands provide the following options. The |
262 | cc424a1d | Iustin Pop | availability for a certain command can be checked by calling the |
263 | cc424a1d | Iustin Pop | command using the ``--help`` option. |
264 | cc424a1d | Iustin Pop | |
265 | 13ddcb50 | Michael Hanselmann | | **gnt-...** *command* [\--dry-run] [\--priority {low | normal | high}] |
266 | d6cd74dd | Klaus Aehlig | | [\--submit] [\--print-job-id] |
267 | cc424a1d | Iustin Pop | |
268 | cc424a1d | Iustin Pop | The ``--dry-run`` option can be used to check whether an operation |
269 | cc424a1d | Iustin Pop | would succeed. |
270 | cc424a1d | Iustin Pop | |
271 | cc424a1d | Iustin Pop | The option ``--priority`` sets the priority for opcodes submitted |
272 | cc424a1d | Iustin Pop | by the command. |
273 | 8cabf472 | Michael Hanselmann | |
274 | 13ddcb50 | Michael Hanselmann | The ``--submit`` option is used to send the job to the master daemon but |
275 | 13ddcb50 | Michael Hanselmann | not wait for its completion. The job ID will be shown so that it can be |
276 | 13ddcb50 | Michael Hanselmann | examined using **gnt-job info**. |
277 | 13ddcb50 | Michael Hanselmann | |
278 | d6cd74dd | Klaus Aehlig | The ``--print-job-id`` option makes the command print the job id as first |
279 | d6cd74dd | Klaus Aehlig | line on stdout, so that it is easy to parse by other programs. |
280 | d6cd74dd | Klaus Aehlig | |
281 | d24303b3 | René Nussbaumer | Defaults |
282 | d24303b3 | René Nussbaumer | ~~~~~~~~ |
283 | d24303b3 | René Nussbaumer | |
284 | d24303b3 | René Nussbaumer | For certain commands you can use environment variables to provide |
285 | d24303b3 | René Nussbaumer | default command line arguments. Just assign the arguments as a string to |
286 | d24303b3 | René Nussbaumer | the corresponding environment variable. The format of that variable |
287 | d24303b3 | René Nussbaumer | name is **binary**_*command*. **binary** is the name of the ``gnt-*`` |
288 | d24303b3 | René Nussbaumer | script all upper case and dashes replaced by underscores, and *command* |
289 | d24303b3 | René Nussbaumer | is the command invoked on that script. |
290 | d24303b3 | René Nussbaumer | |
291 | d24303b3 | René Nussbaumer | Currently supported commands are ``gnt-node list``, ``gnt-group list`` |
292 | d24303b3 | René Nussbaumer | and ``gnt-instance list``. So you can configure default command line |
293 | d24303b3 | René Nussbaumer | flags by setting ``GNT_NODE_LIST``, ``GNT_GROUP_LIST`` and |
294 | d24303b3 | René Nussbaumer | ``GNT_INSTANCE_LIST``. |
295 | d24303b3 | René Nussbaumer | |
296 | 055d6ac0 | Iustin Pop | Debug options |
297 | 055d6ac0 | Iustin Pop | ~~~~~~~~~~~~~ |
298 | 055d6ac0 | Iustin Pop | |
299 | 055d6ac0 | Iustin Pop | If the variable ``FORCE_LUXI_SOCKET`` is set, it will override the |
300 | 055d6ac0 | Iustin Pop | socket used for LUXI connections by command-line tools |
301 | 055d6ac0 | Iustin Pop | (``gnt-*``). This is useful mostly for debugging, and some operations |
302 | 055d6ac0 | Iustin Pop | won't work at all if, for example, you point this variable to the |
303 | 055d6ac0 | Iustin Pop | confd-supplied query socket and try to submit a job. |
304 | 055d6ac0 | Iustin Pop | |
305 | 055d6ac0 | Iustin Pop | If the variable is set to the value ``master``, it will connect to the |
306 | 055d6ac0 | Iustin Pop | correct path for the master daemon (even if, for example, split |
307 | 055d6ac0 | Iustin Pop | queries are enabled and this is a query operation). If set to |
308 | 055d6ac0 | Iustin Pop | ``query``, it will always (try to) connect to the query socket, even |
309 | 055d6ac0 | Iustin Pop | if split queries are disabled. Otherwise, the value is taken to |
310 | 055d6ac0 | Iustin Pop | represent a filesystem path to the socket to use. |
311 | 055d6ac0 | Iustin Pop | |
312 | 7ba19f39 | Iustin Pop | Field formatting |
313 | 7ba19f39 | Iustin Pop | ---------------- |
314 | f0b1bafe | Iustin Pop | |
315 | f0b1bafe | Iustin Pop | Multiple ganeti commands use the same framework for tabular listing of |
316 | f0b1bafe | Iustin Pop | resources (e.g. **gnt-instance list**, **gnt-node list**, **gnt-group |
317 | f0b1bafe | Iustin Pop | list**, **gnt-debug locks**, etc.). For these commands, special states |
318 | f0b1bafe | Iustin Pop | are denoted via a special symbol (in terse mode) or a string (in |
319 | f0b1bafe | Iustin Pop | verbose mode): |
320 | f0b1bafe | Iustin Pop | |
321 | 3802f3cf | Michael Hanselmann | \*, (offline) |
322 | f0b1bafe | Iustin Pop | The node in question is marked offline, and thus it cannot be |
323 | f0b1bafe | Iustin Pop | queried for data. This result is persistent until the node is |
324 | f0b1bafe | Iustin Pop | de-offlined. |
325 | f0b1bafe | Iustin Pop | |
326 | f0b1bafe | Iustin Pop | ?, (nodata) |
327 | f0b1bafe | Iustin Pop | Ganeti expected to receive an answer from this entity, but the |
328 | f0b1bafe | Iustin Pop | cluster RPC call failed and/or we didn't receive a valid answer; |
329 | f0b1bafe | Iustin Pop | usually more information is available in the node daemon log (if |
330 | f0b1bafe | Iustin Pop | the node is alive) or the master daemon log. This result is |
331 | f0b1bafe | Iustin Pop | transient, and re-running command might return a different result. |
332 | f0b1bafe | Iustin Pop | |
333 | f0b1bafe | Iustin Pop | -, (unavail) |
334 | f0b1bafe | Iustin Pop | The respective field doesn't make sense for this entity; |
335 | f0b1bafe | Iustin Pop | e.g. querying a down instance for its current memory 'live' usage, |
336 | f0b1bafe | Iustin Pop | or querying a non-vm_capable node for disk/memory data. This |
337 | f0b1bafe | Iustin Pop | result is persistent, and until the entity state is changed via |
338 | f0b1bafe | Iustin Pop | ganeti commands, the result won't change. |
339 | f0b1bafe | Iustin Pop | |
340 | f0b1bafe | Iustin Pop | ??, (unknown) |
341 | f0b1bafe | Iustin Pop | This field is not known (note that this is different from entity |
342 | f0b1bafe | Iustin Pop | being unknown). Either you have mis-typed the field name, or you |
343 | f0b1bafe | Iustin Pop | are using a field that the running Ganeti master daemon doesn't |
344 | f0b1bafe | Iustin Pop | know. This result is persistent, re-running the command won't |
345 | f0b1bafe | Iustin Pop | change it. |
346 | 7ba19f39 | Iustin Pop | |
347 | 7ba19f39 | Iustin Pop | Key-value parameters |
348 | 7ba19f39 | Iustin Pop | ~~~~~~~~~~~~~~~~~~~~ |
349 | 7ba19f39 | Iustin Pop | |
350 | 7ba19f39 | Iustin Pop | Multiple options take parameters that are of the form |
351 | 7ba19f39 | Iustin Pop | ``key=value,key=value,...`` or ``category:key=value,...``. Examples |
352 | 7ba19f39 | Iustin Pop | are the hypervisor parameters, backend parameters, etc. For these, |
353 | 7ba19f39 | Iustin Pop | it's possible to use values that contain commas by escaping with via a |
354 | 7ba19f39 | Iustin Pop | backslash (which needs two if not single-quoted, due to shell |
355 | 7ba19f39 | Iustin Pop | behaviour):: |
356 | 7ba19f39 | Iustin Pop | |
357 | 7ba19f39 | Iustin Pop | # gnt-instance modify -H kernel_path=an\\,example instance1 |
358 | 7ba19f39 | Iustin Pop | # gnt-instance modify -H kernel_path='an\,example' instance1 |
359 | 7ba19f39 | Iustin Pop | |
360 | 3802f3cf | Michael Hanselmann | Query filters |
361 | 3802f3cf | Michael Hanselmann | ~~~~~~~~~~~~~ |
362 | 3802f3cf | Michael Hanselmann | |
363 | 3802f3cf | Michael Hanselmann | Most commands listing resources (e.g. instances or nodes) support filtering. |
364 | 3802f3cf | Michael Hanselmann | The filter language is similar to Python expressions with some elements from |
365 | 3802f3cf | Michael Hanselmann | Perl. The language is not generic. Each condition must consist of a field name |
366 | 3802f3cf | Michael Hanselmann | and a value (except for boolean checks), a field can not be compared to another |
367 | 3802f3cf | Michael Hanselmann | field. Keywords are case-sensitive. |
368 | 3802f3cf | Michael Hanselmann | |
369 | 01eb6409 | Michael Hanselmann | Examples (see below for syntax details): |
370 | 01eb6409 | Michael Hanselmann | |
371 | 01eb6409 | Michael Hanselmann | - List webservers:: |
372 | 01eb6409 | Michael Hanselmann | |
373 | 01eb6409 | Michael Hanselmann | gnt-instance list --filter 'name =* "web*.example.com"' |
374 | 01eb6409 | Michael Hanselmann | |
375 | 01eb6409 | Michael Hanselmann | - List instances with three or six virtual CPUs and whose primary |
376 | 01eb6409 | Michael Hanselmann | nodes reside in groups starting with the string "rack":: |
377 | 01eb6409 | Michael Hanselmann | |
378 | 01eb6409 | Michael Hanselmann | gnt-instance list --filter |
379 | 01eb6409 | Michael Hanselmann | '(be/vcpus == 3 or be/vcpus == 6) and pnode.group =~ m/^rack/' |
380 | 01eb6409 | Michael Hanselmann | |
381 | 01eb6409 | Michael Hanselmann | - Nodes hosting primary instances:: |
382 | 01eb6409 | Michael Hanselmann | |
383 | 01eb6409 | Michael Hanselmann | gnt-node list --filter 'pinst_cnt != 0' |
384 | 01eb6409 | Michael Hanselmann | |
385 | 01eb6409 | Michael Hanselmann | - Nodes which aren't master candidates:: |
386 | 01eb6409 | Michael Hanselmann | |
387 | 01eb6409 | Michael Hanselmann | gnt-node list --filter 'not master_candidate' |
388 | 01eb6409 | Michael Hanselmann | |
389 | 01eb6409 | Michael Hanselmann | - Short version for globbing patterns:: |
390 | 01eb6409 | Michael Hanselmann | |
391 | 01eb6409 | Michael Hanselmann | gnt-instance list '*.site1' '*.site2' |
392 | 01eb6409 | Michael Hanselmann | |
393 | 3802f3cf | Michael Hanselmann | Syntax in pseudo-BNF:: |
394 | 3802f3cf | Michael Hanselmann | |
395 | 3802f3cf | Michael Hanselmann | <quoted-string> ::= /* String quoted with single or double quotes, |
396 | 3802f3cf | Michael Hanselmann | backslash for escaping */ |
397 | 3802f3cf | Michael Hanselmann | |
398 | 3802f3cf | Michael Hanselmann | <integer> ::= /* Number in base-10 positional notation */ |
399 | 3802f3cf | Michael Hanselmann | |
400 | 3802f3cf | Michael Hanselmann | <re> ::= /* Regular expression */ |
401 | 3802f3cf | Michael Hanselmann | |
402 | 3802f3cf | Michael Hanselmann | /* |
403 | 3802f3cf | Michael Hanselmann | Modifier "i": Case-insensitive matching, see |
404 | 3802f3cf | Michael Hanselmann | http://docs.python.org/library/re#re.IGNORECASE |
405 | 3802f3cf | Michael Hanselmann | |
406 | 3802f3cf | Michael Hanselmann | Modifier "s": Make the "." special character match any character, |
407 | 3802f3cf | Michael Hanselmann | including newline, see http://docs.python.org/library/re#re.DOTALL |
408 | 3802f3cf | Michael Hanselmann | */ |
409 | 3802f3cf | Michael Hanselmann | <re-modifiers> ::= /* empty */ | i | s |
410 | 3802f3cf | Michael Hanselmann | |
411 | 3802f3cf | Michael Hanselmann | <value> ::= <quoted-string> | <integer> |
412 | 3802f3cf | Michael Hanselmann | |
413 | 3802f3cf | Michael Hanselmann | <condition> ::= |
414 | 3802f3cf | Michael Hanselmann | { /* Value comparison */ |
415 | ad48eacc | Michael Hanselmann | <field> { == | != | < | <= | >= | > } <value> |
416 | 3802f3cf | Michael Hanselmann | |
417 | 3802f3cf | Michael Hanselmann | /* Collection membership */ |
418 | 3802f3cf | Michael Hanselmann | | <value> [ not ] in <field> |
419 | 3802f3cf | Michael Hanselmann | |
420 | 3802f3cf | Michael Hanselmann | /* Regular expressions (recognized delimiters |
421 | 3802f3cf | Michael Hanselmann | are "/", "#", "^", and "|"; backslash for escaping) |
422 | 3802f3cf | Michael Hanselmann | */ |
423 | 3802f3cf | Michael Hanselmann | | <field> { =~ | !~ } m/<re>/<re-modifiers> |
424 | 3802f3cf | Michael Hanselmann | |
425 | 16629d10 | Michael Hanselmann | /* Globbing */ |
426 | 16629d10 | Michael Hanselmann | | <field> { =* | !* } <quoted-string> |
427 | 16629d10 | Michael Hanselmann | |
428 | 3802f3cf | Michael Hanselmann | /* Boolean */ |
429 | 3802f3cf | Michael Hanselmann | | <field> |
430 | 3802f3cf | Michael Hanselmann | } |
431 | 3802f3cf | Michael Hanselmann | |
432 | 3802f3cf | Michael Hanselmann | <filter> ::= |
433 | 3802f3cf | Michael Hanselmann | { [ not ] <condition> | ( <filter> ) } |
434 | 3802f3cf | Michael Hanselmann | [ { and | or } <filter> ] |
435 | 3802f3cf | Michael Hanselmann | |
436 | 3802f3cf | Michael Hanselmann | Operators: |
437 | 3802f3cf | Michael Hanselmann | |
438 | 3802f3cf | Michael Hanselmann | *==* |
439 | 3802f3cf | Michael Hanselmann | Equality |
440 | 3802f3cf | Michael Hanselmann | *!=* |
441 | 3802f3cf | Michael Hanselmann | Inequality |
442 | ad48eacc | Michael Hanselmann | *<* |
443 | ad48eacc | Michael Hanselmann | Less than |
444 | ad48eacc | Michael Hanselmann | *<=* |
445 | ad48eacc | Michael Hanselmann | Less than or equal |
446 | ad48eacc | Michael Hanselmann | *>* |
447 | ad48eacc | Michael Hanselmann | Greater than |
448 | ad48eacc | Michael Hanselmann | *>=* |
449 | ad48eacc | Michael Hanselmann | Greater than or equal |
450 | 3802f3cf | Michael Hanselmann | *=~* |
451 | 3802f3cf | Michael Hanselmann | Pattern match using regular expression |
452 | 3802f3cf | Michael Hanselmann | *!~* |
453 | 3802f3cf | Michael Hanselmann | Logically negated from *=~* |
454 | 16629d10 | Michael Hanselmann | *=\** |
455 | 354c4f62 | Michael Hanselmann | Globbing, see **glob**\(7), though only * and ? are supported |
456 | 16629d10 | Michael Hanselmann | *!\** |
457 | 16629d10 | Michael Hanselmann | Logically negated from *=\** |
458 | 3802f3cf | Michael Hanselmann | *in*, *not in* |
459 | 3802f3cf | Michael Hanselmann | Collection membership and negation |
460 | 3802f3cf | Michael Hanselmann | |
461 | 3802f3cf | Michael Hanselmann | |
462 | 7ba19f39 | Iustin Pop | Common daemon functionality |
463 | 7ba19f39 | Iustin Pop | --------------------------- |
464 | 7ba19f39 | Iustin Pop | |
465 | 7ba19f39 | Iustin Pop | All Ganeti daemons re-open the log file(s) when sent a SIGHUP signal. |
466 | 354c4f62 | Michael Hanselmann | **logrotate**\(8) can be used to rotate Ganeti's log files. |
467 | 9ff4f2c0 | Michael Hanselmann | |
468 | 9ff4f2c0 | Michael Hanselmann | .. vim: set textwidth=72 : |
469 | 9ff4f2c0 | Michael Hanselmann | .. Local Variables: |
470 | 9ff4f2c0 | Michael Hanselmann | .. mode: rst |
471 | 9ff4f2c0 | Michael Hanselmann | .. fill-column: 72 |
472 | 9ff4f2c0 | Michael Hanselmann | .. End: |