1heketi-cli(8) The heketi Authors heketi-cli(8)
2
3
4
6 heketi-cli - Command line program for Heketi
7
9 heketi-cli [commands] [options]
10
12 Command line program for Heketi
13
15 Cluster Commands
16 heketi-cli cluster create [--file[=false]] [--block[=false]]
17 Create a cluster
18
19 Options
20
21 --file[=false]
22 Optional: Allow the user to control the
23 possibility of creating regular file volumes on
24 the cluster to be created. This is enabled by
25 default. Use '--file=false' to disable creation
26 of regular file volumes on this cluster. (default
27 true)
28
29 --block[=false]
30 Optional: Allow the user to control the
31 possibility of creating block volumes on the
32 cluster to be created. This is enabled by
33 default. Use '--block=false' to disable creation
34 of block volumes on this cluster. (default true)
35
36 Example
37 $ heketi-cli cluster create --block=false
38
39 heketi-cli cluster setflags [--file=true|false] [--block=true|false]
40 <Cluster-ID>
41 Set file and block flags on a cluster.
42
43 Options
44
45 --file=true|false
46 Optional: Allow the user to control the
47 possibility of creating regular file volumes on
48 the cluster. Use '--file=true' to enable and
49 '--file=false' to disable creation of regular file
50 volumes on this cluster.
51
52 --block=true|false
53 Optional: Allow the user to control the
54 possibility of creating block volumes on the
55 cluster. Use '--block=true' to enable and
56 '--block=false' to disable creation of block
57 volumes on this cluster.
58
59 Example
60 $ heketi-cli cluster setflags --block=false 886a86a868711bef83001
61
62 heketi-cli cluster delete <CLUSTER-ID>
63 Delete a cluster
64
65 Example
66 $ heketi-cli cluster delete 886a86a868711bef83001
67
68 heketi-cli cluster info <CLUSTER-ID>
69 Retrieves information about cluster
70
71 Example
72 $ heketi-cli cluster info 886a86a868711bef83001
73
74 heketi-cli cluster list
75 Lists the clusters managed by Heketi
76
77 Example
78 $ heketi-cli cluster list
79
80 Device Commands
81 heketi-cli device add --name=<DEVICE-NAME> --node=<NODE-ID>
82 Add new device to node to be managed by Heketi
83
84 Options
85
86 --name=""
87 Name of device to add
88
89 --node=""
90 Id of the node which has this device
91
92 --destroy-existing-data
93 Optional: Destroy existing data on the device
94 (DANGEROUS).
95
96 Example
97 $ heketi-cli device add \
98 --name=/dev/sdb \
99 --node=3e098cb4407d7109806bb196d9e8f095
100
101 heketi-cli device delete <DEVICE-ID>
102 Deletes a device from Heketi node
103
104 Options
105
106 --force-forget
107 Optional: Remove the device from heketi regardless
108 of it's state on the node (DANGEROUS).
109
110 Example
111 $ heketi-cli device delete 886a86a868711bef83001
112
113 heketi-cli device disable <DEVICE-ID>
114 Disallow usage of a device by placing it offline
115
116 Example
117 $ heketi-cli device disable 886a86a868711bef83001
118
119 heketi-cli device enable <DEVICE-ID>
120 Allows device to go online
121
122 Example
123 $ heketi-cli device enable 886a86a868711bef83001
124
125 heketi-cli device info <DEVICE-ID>
126 Retrieves information about device
127
128 Example
129 $ heketi-cli device info 886a86a868711bef83001
130
131 heketi-cli device remove <DEVICE-ID>
132 Moves a device to removed/failed state, replacing all its bricks
133 by bricks on other devices. This requires the device to be
134 brought to disabled/offline state first.
135
136 Example
137 $ heketi-cli device remove 886a86a868711bef83001
138
139 heketi-cli device resync <DEVICE-ID>
140 Resync storage information about the device with operation
141 system
142
143 Example
144 $ heketi-cli device resync 886a86a868711bef83001
145
146 heketi-cli device settags <DEVICE-ID> <TAG>:<VALUE> ...
147 Set metadata tags on a given device. Tags are free-form key
148 value pairs that are stored by Heketi and may be used for extra
149 configuration. One or more <TAG>:<TAG-VALUE> pairs may be
150 provided.
151
152 Options
153
154 --exact
155 Optional: Overwrite the existing tags with the
156 exactly set of tags (and values) specified on this
157 command line. Without this option, the command
158 will add or update tags.
159
160 Example
161 $ heketi-cli device settags 886a86a868711bef83001 arbiter:required flavor:strawberry
162
163 heketi-cli device rmtags <DEVICE-ID> <TAG> ...
164 Remove metadata tags from a given device.
165
166 Options
167
168 --all Optional: Remove all tags from the specified
169 device. May not be combined with specifying tag
170 names.
171
172 Example
173 $ heketi-cli device rmtags 886a86a868711bef83001 arbiter
174
175 Node Commands
176 heketi-cli node add --zone=<ZONE-NUMBER> --cluster=<CLUSTER-ID>
177 --management-host-name=<MANAGEMENT-HOSTNAME> --storage-host-
178 name=<STORAGE-HOSTNAME>
179 Add new node to be managed by Heketi
180
181 Options
182
183 --cluster=""
184 The cluster in which the node should reside
185
186 --management-host-name=""
187 Management host name
188
189 --storage-host-name=""
190 Storage host name
191
192 --zone=-1
193 The zone in which the node should reside
194
195 Example
196 $ heketi-cli node add \
197 --zone=3 \
198 --cluster=3e098cb4407d7109806bb196d9e8f095 \
199 --management-host-name=node1-manage.gluster.lab.com \
200 --storage-host-name=node1-storage.gluster.lab.com
201
202 heketi-cli node delete <NODE-ID>
203 Deletes a node from Heketi management
204
205 Example
206 $ heketi-cli node delete 886a86a868711bef83001
207
208 heketi-cli node disable <NODE-ID>
209 Disallow usage of a node by placing it offline
210
211 Example
212 $ heketi-cli node disable 886a86a868711bef83001
213
214 heketi-cli node enable <NODE-ID>
215 Allows node to go online
216
217 Example
218 $ heketi-cli node enable 886a86a868711bef83001
219
220 heketi-cli node info <NODE-ID>
221 Retrieves information about node
222
223 Example
224 $ heketi-cli node info 886a86a868711bef83001
225
226 heketi-cli node list
227 List all nodes in cluster
228
229 Example
230 $ heketi-cli node list
231
232 heketi-cli node settags <NODE-ID> <TAG>:<VALUE> ...
233 Set metadata tags on a given node. Tags are free-form key value
234 pairs that are stored by Heketi and may be used for extra
235 configuration. One or more <TAG>:<TAG-VALUE> pairs may be
236 provided.
237
238 Options
239
240 --exact
241 Optional: Overwrite the existing tags with the
242 exactly set of tags (and values) specified on this
243 command line. Without this option, the command
244 will add or update tags.
245
246 Example
247 $ heketi-cli node settags 886a86a868711bef83001 arbiter:required flavor:strawberry
248
249 heketi-cli node rmtags <NODE-ID> <TAG> ...
250 Remove metadata tags from a given node.
251
252 Options
253
254 --all Optional: Remove all tags from the specified node.
255 May not be combined with specifying tag names.
256
257 Example
258 $ heketi-cli node rmtags 886a86a868711bef83001 arbiter
259
260 Setup OpenShift/Kubernetes persistent storage for Heketi
261 heketi-cli setup-openshift-heketi-storage
262 Creates a dedicated GlusterFS volume for Heketi. Once the
263 volume is created, a Kubernetes/OpenShift list object is created
264 to configure the volume.
265
266 Options
267
268 --listfile="heketi-storage.json"
269 Filename to contain list of objects
270
271 --listfile="heketi-storage.json"
272 Filename to contain list of objects
273
274 --durability="replicate"
275 Optional: Durability type. Values are:
276
277 none: No durability, for testing with single
278 storage server environments.
279
280 replicate: (Default) Replica volume.
281
282 --replica=3
283 Replica value for durability type 'replicate'.
284 Default is 3
285
286 Example
287 $ heketi-cli setup-openshift-heketi-storage
288
289 Topology Commands
290 heketi-cli topology load --json=<JSON-FILENAME>
291 Add devices to Heketi from a configuration file
292
293 Options
294
295 -j, --json=""
296 Configuration containing devices, nodes, and
297 clusters, in JSON format
298
299 Example
300 $ heketi-cli topology load --json=topo.json
301
302 heketi-cli topology info
303 Retreives information about the current Topology
304
305 Example
306 $ heketi-cli topology info
307
308 Volume Commands
309 heketi-cli volume create --clusters=<CLUSTER-IDS> --disperse-
310 data=<DISPERSION-VALUE> --durability=<TYPE> --name=<VOLUME-NAME>
311 --redundancy=<REDUNDENCY-VALUE> --replica=<REPLICA-VALUE>
312 --size=<VOLUME-SIZE> --snapshot-factor=<SNAPSHOT-FACTOR-VALUE>
313 Create a GlusterFS volume
314
315 Options
316
317 --clusters=""
318 Optional: Comma separated list of cluster ids
319 where this volume must be allocated. If omitted,
320 Heketi will allocate the volume on any of the
321 configured clusters which have the available
322 space. Providing a set of clusters will ensure
323 Heketi allocates storage for this volume only in
324 the clusters specified.
325
326 --disperse-data=4
327 Optional: Dispersion value for durability type
328 'disperse'. Default is 4
329
330 --durability="replicate"
331 Optional: Durability type. Values are:
332
333 none: No durability. Distributed volume only.
334
335 replicate: (Default) Distributed-Replica volume.
336
337 disperse: Distributed-Erasure Coded volume.
338
339 --gid=0
340 Optional: Initialize volume with the specified
341 group id. Default is 0.
342
343 --name=""
344 Optional: Name of volume. Only set if really
345 necessary
346
347 --persistent-volume[=false]
348 Optional: Output to standard out a persistent
349 volume JSON file for OpenShift or Kubernetes with
350 the name provided.
351
352 --persistent-volume-endpoint=""
353 Optional: Endpoint name for the persistent volume
354
355 --persistent-volume-file=""
356 Optional: Create a persistent volume JSON file for
357 OpenShift or Kubernetes with the name provided.
358
359 --redundancy=2
360 Optional: Redundancy value for durability type
361 'disperse'. Default is 2.
362
363 --replica=3
364 Replica value for durability type 'replicate'.
365 Default is 3.
366
367 --size=-1
368 Size of volume in GiB.
369
370 --snapshot-factor=1
371 Optional: Amount of storage to allocate for
372 snapshot support. Must be greater 1.0. For
373 example if a 10TiB volume requires 5TiB of
374 snapshot storage, then snapshot-factor would be
375 set to 1.5. If the value is set to 1, then
376 snapshots will not be enabled for this volume.
377
378 Note: The volume size created depends upon the underlying brick
379 size. For example, for a 2 way/3 way replica volume, the
380 minimum volume size is 1GiB as the underlying minimum brick size
381 is constrained to 1GiB. So, it is not possible create a volume
382 of size less than 1GiB.
383
384 Examples
385
386 Create a 100GiB replica 3 volume:
387 $ heketi-cli volume create --size=100
388
389 Create a 100GiB replica 3 volume specifying two specific
390 clusters:
391 $ heketi-cli volume create --size=100 \
392 --clusters=0995098e1284ddccb46c7752d142c832,60d46d518074b13a04ce1022c8c7193c
393
394 Create a 100GiB replica 2 volume with 50GiB of snapshot
395 storage:
396 $ heketi-cli volume create --size=100 \
397 --snapshot-factor=1.5 --replica=2
398
399 Create a 100GiB distributed volume
400 $ heketi-cli volume create --size=100 --durability=none
401
402 Create a 100GiB erasure coded 4+2 volume with 25GiB
403 snapshot storage:
404 $ heketi-cli volume create --size=100 --durability=disperse \
405 --snapshot-factor=1.25
406
407 Create a 100GiB erasure coded 8+3 volume with 25GiB
408 snapshot storage:
409 $ heketi-cli volume create --size=100 --durability=disperse \
410 --snapshot-factor=1.25 \
411 --disperse-data=8 --redundancy=3
412
413 heketi-cli volume delete <VOLUME-ID>
414 Deletes the volume
415
416 Example
417 $ heketi-cli volume delete 886a86a868711bef83001
418
419 heketi-cli volume expand --expand-size=<SIZE> --volume=<VOLUME-ID>
420 Expand a volume
421
422 Options
423
424 --expand=""
425 Amount in GiB to add to the volume
426
427 --volume=""
428 Id of volume to expand
429
430 Example
431
432 Add 10GiB to a volume:
433 $ heketi-cli volume expand --volume=60d46d518074b13a04ce1022c8c7193c
434 --expand-size=10
435
436 heketi-cli volume info <VOLUME-ID>
437 Retrieves information about volume
438
439 Example
440 $ heketi-cli volume info 886a86a868711bef83001
441
442 heketi-cli volume list
443 Lists the volumes managed by Heketi
444
445 Example
446 $ heketi-cli volume list
447
449 --json[=false]
450 Print response as JSON
451
452 --secret=""
453 Secret key for specified user. Can also be set using the
454 environment variable HEKETI_CLI_KEY.
455
456 -s, --server=""
457 Heketi server. Can also be set using the environment variable
458 HEKETI_CLI_SERVER.
459
460 --user=""
461 Heketi user. Can also be set using the environment variable
462 HEKETI_CLI_USER.
463
464 -v, --version[=false]
465 Print version.
466
468 List Volumes
469 Specify the Heketi server to contact using an environment variable and
470 list the volumes.
471 $ export HEKETI_CLI_SERVER=http://localhost:8080
472 $ heketi-cli volume list
473
474 Create a Volume
475 Create a 4 GiB volume.
476 $ heketi-cli volume create --size 4
477
478 Create an Arbiter Volume
479 Create a 4 GiB volume that uses the arbiter feature.
480 $ heketi-cli volume create --size 4 --gluster-volume-options='user.heketi.arbiter true'
481
483 Copyright (c) 2015-2018 The heketi Authors
484
485
486
487Apr 2016 Heketi command line program heketi-cli(8)