forked from TritonDataCenter/chyves
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chyves.8.html
1674 lines (1099 loc) · 101 KB
/
chyves.8.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<title>chyves(8) - bhyve(8) front end manager -- version 0.2.0</title>
<style type='text/css' media='all'>
/* style: man */
body#manpage {margin:0}
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
.mp h2 {margin:10px 0 0 0}
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
.mp h3 {margin:0 0 0 4ex}
.mp dt {margin:0;clear:left}
.mp dt.flush {float:left;width:8ex}
.mp dd {margin:0 0 0 9ex}
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
.mp pre {margin-bottom:20px}
.mp pre+h2,.mp pre+h3 {margin-top:22px}
.mp h2+pre,.mp h3+pre {margin-top:5px}
.mp img {display:block;margin:auto}
.mp h1.man-title {display:none}
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
.mp h2 {font-size:16px;line-height:1.25}
.mp h1 {font-size:20px;line-height:2}
.mp {text-align:justify;background:#fff}
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
.mp u {text-decoration:underline}
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
.mp b.man-ref {font-weight:normal;color:#434241}
.mp pre {padding:0 4ex}
.mp pre code {font-weight:normal;color:#434241}
.mp h2+pre,h3+pre {padding-left:0}
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
ol.man-decor {width:100%}
ol.man-decor li.tl {text-align:left}
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
ol.man-decor li.tr {text-align:right;float:right}
</style>
<style type='text/css' media='all'>
/* style: toc */
.man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
.man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
.man-navigation a:hover {color:#111;text-decoration:underline}
</style>
</head>
<!--
The following styles are deprecated and will be removed at some point:
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
.man-navigation should be used instead.
-->
<body id='manpage'>
<div class='mp' id='man'>
<div class='man-navigation' style='display:none'>
<a href="#NAME">NAME</a>
<a href="#SYNOPSIS">SYNOPSIS</a>
<a href="#SYNTAX-NOMENCLATURE-">SYNTAX NOMENCLATURE:</a>
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#DEPENDENCIES">DEPENDENCIES</a>
<a href="#ZFS">ZFS</a>
<a href="#LOGS">LOGS</a>
<a href="#NETWORK">NETWORK</a>
<a href="#PROPERTIES">PROPERTIES</a>
<a href="#TMUX-SUPPORT">TMUX SUPPORT</a>
<a href="#UEFI-SUPPORT">UEFI SUPPORT</a>
<a href="#COMMANDS">COMMANDS</a>
<a href="#EXAMPLES">EXAMPLES</a>
<a href="#AUTHOR">AUTHOR</a>
<a href="#SEE-ALSO">SEE ALSO</a>
</div>
<ol class='man-decor man-head man head'>
<li class='tl'>chyves(8)</li>
<li class='tc'>FreeBSD System Manager's Manual</li>
<li class='tr'>chyves(8)</li>
</ol>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>chyves</code> - <span class="man-whatis"><a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?bhyve(8)">bhyve<span class="s">(8)</span></a> front end manager -- version 0.2.0</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<ul>
<li><code>chyves dataset <pool> {install|upgrade}</code></li>
<li><code>chyves dev</code></li>
<li><code>chyves {firmware|iso} list</code></li>
<li><code>chyves {firmware|iso} import {http-URL|ftp-URL|local-path}</code></li>
<li><code>chyves {firmware|iso} rename <resource> <new-resource-name></code></li>
<li><code>chyves {firmware|iso} delete <resource></code></li>
<li><code>chyves <guest> clone <clonenames>|MG [-ce|-cu|-ie|-iu] [<pool>]</code></li>
<li><code>chyves <guest> console</code></li>
<li><code>chyves <guest>|MG|all console {reset|tmux|vnc}</code></li>
<li><code>chyves <guest>|MG create [<size>] [<pool>]</code></li>
<li><code>chyves <guest>|MG|all delete [force|keepnet]</code></li>
<li><code>chyves <guest> disk add [<size>]</code></li>
<li><code>chyves <guest> disk disk{n} {description|notes} <annotation></code></li>
<li><code>chyves <guest> disk delete disk{n}</code></li>
<li><code>chyves <guest> disk resize disk{n} <new-size></code></li>
<li><code>chyves <guest> disk list</code></li>
<li><code>chyves <guest> get {<property>|all}</code></li>
<li><code>chyves <guest>|MG|all reclaim</code></li>
<li><code>chyves <guest> rename <new-guest-name></code></li>
<li><code>chyves <guest>|MG|global|defaults|all set <prop1>=<value>...</code></li>
<li><code>chyves <guest> snapshot [<@snapshotname>]</code></li>
<li><code>chyves <guest> snapshot list</code></li>
<li><code>chyves <guest> snapshot delete <@snapshotname></code></li>
<li><code>chyves <guest> snapshot rollback [<@snapshotname>]</code></li>
<li><code>chyves <guest>|MG|all start [<iso>]</code></li>
<li><code>chyves <guest>|MG|all stop [force]</code></li>
<li><code>chyves <guest>|MG|all upgrade</code></li>
<li><code>chyves <guest>|MG|all unset <property></code></li>
<li><code>chyves help</code></li>
<li><code>chyves info [-zbprvstcudnakwl|-h]</code></li>
<li><code>chyves list [bridges|clones|defaults|disks|firmware|iso|pools|\ properties|<property>]</code></li>
<li><code>chyves list global [<pool>|primary]</code></li>
<li><code>chyves list {processes|snapshots} [<guest>]</code></li>
<li><code>chyves list tap active</code></li>
<li><code>chyves network <guest> add {tap|tap{n}|vale{n}}</code></li>
<li><code>chyves network <guest> add {tap|tap{n}} [bridge{n}]</code></li>
<li><code>chyves network <guest> remove {tap{n}|vale{n}}</code></li>
<li><code>chyves network bridge{n} attach {vlan-iface{n}|physical-iface{n}}</code></li>
<li><code>chyves network bridge{n} {default|private}</code></li>
<li><code>chyves network bridge{n} {join|unjoin} tap{n}</code></li>
<li><code>chyves network bridge{n} migrate bridge{n}</code></li>
<li><code>chyves upgrade [master|dev|check]</code></li>
<li><code>chyves version</code></li>
</ul>
<h2 id="SYNTAX-NOMENCLATURE-">SYNTAX NOMENCLATURE:</h2>
<p>The following syntax nomenclature is used throughout this page:</p>
<ul>
<li><code>subcommand</code> - Required text, exactly as shown.</li>
<li><code>[subcommand]</code> - Optional text, exactly as shown.</li>
<li><code><user-input></code> - User supplied input field. Required when not contain in [ ].</li>
<li><code>{n}</code> - A whole number. Context determines valid range.</li>
<li><code>...</code> - Repeating as many iterations as desired, follows the same preceding syntax pattern.</li>
<li><code>|</code> - Separates options in a list.</li>
<li><code>[optional|list]</code> - An optional field, list of valid options. "" meaning literally no input is also an option with these lists.</li>
<li><code>{require|list}</code> - A required field, list of valid options.</li>
<li><code>$null</code> - '', meaning literally no input.</li>
<li><code>[-abcdefg]</code> - An optional flag field but must start with a '-' and followed by any combination, in any order. Eg. '-gca'</li>
<li><code><guest></code> - chyves guest name</li>
<li><code><pool></code> - ZFS pool. The word "primary" can be used to specify the primary pool.</li>
<li><code><size></code> - Whole number with a size suffix in kilobytes (K), megabytes (M), gigabytes (G), or terabytes (T).</li>
<li><code><resource></code> - ISO or UEFI firmware resource name</li>
<li><code>MG</code> - Multiple guests can be given using commas. The word "all" can be used to indicate all guests for these commands.</li>
</ul>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p><a class="man-ref" href="chyves.8.html">chyves<span class="s">(8)</span></a> relies on the FreeBSD hypervisor <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?bhyve(8)">bhyve<span class="s">(8)</span></a>, <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?zfs(8)">zfs<span class="s">(8)</span></a>, <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?nmdm(4)">nmdm<span class="s">(4)</span></a>, Bourne shell <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?sh(1)">sh<span class="s">(1)</span></a>, and <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?cu(1)">cu<span class="s">(1)</span></a> to start and manage type 2 virtualized guests. Optionally grub2-bhyve and <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?tmux(1)">tmux<span class="s">(1)</span></a> can be used to expand the capabilities of chyves. chyves uses configuration files, ZFS filesystem datasets and volumes to store guest, chyves settings, and chyves resources in an organized hierarchy. bhyve uses virtio drivers built into the GENERIC kernel for network virtualization. The virtio drivers are used to paravirtualize I/O for disk and network access.</p>
<p>For networking, a guest is presented a PCI Ethernet device through the use of <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?virtio(4)">virtio<span class="s">(4)</span></a>. On FreeBSD guests this means the <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?vtnet(4)">vtnet<span class="s">(4)</span></a> driver is used. After a certain commit, Intel e1000 emulation was added as an alternative to virtio-net. See guest property 'bhyve_net_type' for details. In either case, host network communication is through a <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?tap(3)">tap<span class="s">(3)</span></a> or <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?vale(4)">vale<span class="s">(4)</span></a> interface to the guest.</p>
<p>For storage, guests are provided block storage device(s) via ZFS volumes from the host by default. ZFS datasets are used to organize these block devices and other resources in a hierarchical structure. See <a href="#ZFS" title="ZFS" data-bare-link="true">ZFS</a> section for more information.</p>
<p>Multi-guest [MG] support is the ability to specify multiple guest names that are comma separate for a sub-command. Not all sub-commands have this functionality but the ones that do, allow for rapid execution of the same command over many guests, this can be incredibly helpful for a fleet of VMs. Commands in the synopsis above with the "<var>guest</var>|MG" syntax indicate compatibility with multi-guest. Using the word 'all' instead of <var>guest</var> will specify all active guests on the system for supported commands.</p>
<h2 id="DEPENDENCIES">DEPENDENCIES</h2>
<p><a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?bhyve(8)">bhyve<span class="s">(8)</span></a> and <a class="man-ref" href="chyves.8.html">chyves<span class="s">(8)</span></a> will run on a base FreeBSD installation. However the required kernel modules are not loaded by default on FreeBSD. By default <code>chyves</code> will attempt to load the required kernel modules when needed. There are also certain non-FreeBSD-base binaries that enhance <code>chyves</code> capabilities. These binaries are checked for and in certain cases, exits if the required component is not detected.</p>
<p>At least one ZFS pool is required. All data is stored on one or many ZFS pools and depends on ZFS volumes for guest's disks backing. <code>chyves</code> capitalizes on multi-pool configurations. Multiple pool configurations are common in FreeNAS deployments, separated storage types (eg: SSD, HD, NVMe), and OS plus storage configurations.</p>
<h3 id="Kernel-modules-">Kernel modules:</h3>
<ul>
<li><code>vmm</code> - Required to run the guests as this allocates the resources.</li>
<li><code>nmdm(4)</code> - Required for serial console access to the guests.</li>
<li><code>if_tap(4)</code> - Required for network access to the guests.</li>
<li><code>if_bridge(4)</code> - Required for network access to the guests.</li>
<li><code>bridgestp</code> - Required by <code>if_bridge</code>.</li>
<li><code>netmap(4)</code> - Required for VALE support. Not compiled into GENERIC on 10.3.</li>
</ul>
<h3 id="Enhancing-Binaries-">Enhancing Binaries:</h3>
<ul>
<li><code>bhyve</code> Custom variants required for VALE or UEFI SUPPORT for pre-11.0-ALPHA* builds. Manually compile from <code>/usr/src</code>.</li>
<li><code>BHYVE_UEFI_20151002.fd</code> UEFI firmware required to boot UEFI guests. In Peter Grehan's public FreeBSD file directory.</li>
<li><code>BHYVE_UEFI_20160526.fd</code> UEFI firmware required to boot UEFI guests with VNC support. In Peter Grehan's public FreeBSD file directory.</li>
<li><code>grub2-bhyve</code> Required for booting non-FreeBSD or non-UEFI guests. In ports and pkg.</li>
<li><code>tmux</code> Required when using the command <code>chyves <guest> console tmux</code>. In ports and pkg.</li>
<li><code>vale-ctl</code> Required for VALE networking support. In '/usr/src'.</li>
</ul>
<h3 id="Hardware-dependencies-">Hardware dependencies:</h3>
<p><a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?bhyve(8)">bhyve<span class="s">(8)</span></a> is dependent on hardware virtualization CPU features. One feature is called Second Level Address Translation (SLAT), also known as nested paging. Intel's implementation is called Extended Page Tables (EPT) and AMD's implementation is called Rapid Virtualization Indexing (RVI). This CPU feature is referenced as 'POPCNT' in <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?dmesg(8)">dmesg<span class="s">(8)</span></a> under 'Features2:' line.</p>
<p>There is an early series of CPUs from Intel (Xeon 5500) that has most of the necessary virtualization capabilities but lack a feature Intel later implemented called unrestricted guest ('<code>UG</code>' in <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?dmesg(8)">dmesg<span class="s">(8)</span></a> under "VT-x:"). Without this feature bhyve is limited to FreeBSD guests with only one CPU core. AMD has the '<code>UG</code>' functionality in all of it's RVI implementations.</p>
<p>PCI Pass-through support is also provided through another sub-set of hardware virtualization CPU features called I/O MMU virtualization. Intel calls their implementation '<code>VT-d</code>' and AMD calls their implementation '<code>AMD-Vi</code>'. See the <code>pcidev_{n}</code> property under <a href="#Guest-Properties" title="Guest Properties" data-bare-link="true">Guest Properties</a> section for instructions on attaching PCI pass-through devices. A check is ran before starting a guest that has PCI pass-through devices configured and will not start the guest if the host does not have the necessary CPU feature.</p>
<h2 id="ZFS">ZFS</h2>
<p>As mentioned in the <a href="#DEPENDENCIES" title="DEPENDENCIES" data-bare-link="true">DEPENDENCIES</a> section above, there is a hard dependency on ZFS and as such requires at least one ZFS pool. There are many features that rely on ZFS, such as cloning. The ISO, UEFI firmware, and guest resources and properties are stored within ZFS datasets.</p>
<p>Single and multiple ZFS pools are supported, there is no loss in functionality for either. <code>chyves</code> datasets get mounted to '/chyves/<var>pool</var>'. The '/chyves' directory itself is stored on '/' and does not belong to any of the chyves datasets. The first pool is assigned the primary pool role but this can be changed afterwards. The primary pool is the only pool containing the UEFI Firmware resources, ISO resources, the global properties, and the comprehensive logs. The primary pool can be changed with <code>chyves dataset <new-prim-pool> promote</code> which moves the resources and global configuration to <code><new-prim-pool></code> from the current primary pool.</p>
<p>See <a href="#DATASET-SUB-COMMANDS" title="DATASET SUB-COMMANDS" data-bare-link="true">DATASET SUB-COMMANDS</a> section below for managing the <code>chyves</code> datasets.</p>
<p>Example of a multi-pool folder structure:</p>
<pre><code>/chyves/prim_pool/guests/
/guests/<guest1>/.config/.cfg # File
/guests/<guest1>/disk{n} # Volumes
/guests/<guest1>/img # Dataset(s)
/guests/<guest1>/log # Dataset
/guests/<guest1>/log/YYYYMM.log # Files
/guests/<guest2>/.config/.cfg # File
/guests/<guest2>/disk{n} # Datasets
/guests/<guest2>/img # Dataset(s)
/guests/<guest2>/log # Dataset
/guests/<guest2>/log/YYYYMM.log # Files
/guests/.defaults # File
/.config # Dataset
/.config/global.cfg # File
/.config/pool.cfg # File
pool_role=primary # Pool property
/logs # Dataset
/logs/YYYYMM.log # Files
/ISO # Datasets
/Firmware # Datasets
/chyves/secd_pool/guests
/guests/<guest3>/.config/.cfg # File
/guests/<guest3>/disk{n} # Volumes
/guests/<guest3>/img # Dataset(s)
/guests/<guest3>/log # Dataset
/guests/<guest3>/log/YYYYMM.log # Files
/.config # Dataset
/.config/pool.cfg # File
pool_role=secondary # Pool property
/chyves/anther_pl/guests
/guests/<guest4>/.config/.cfg # File
/guests/<guest4>/disk{n} # Volumes
/guests/<guest4>/img # Dataset(s)
/guests/<guest4>/log # Dataset
/guests/<guest4>/log/YYYYMM.log # Files
/.config # Dataset
/.config/pool.cfg # File
pool_role=secondary # Pool property
</code></pre>
<p> Offline dataset:</p>
<pre><code>offlinePL/chyves_offline # Datasets
offlinePL/chyves_offline/.config/pool.cfg # File
pool_role=offline # Pool property
</code></pre>
<p>Example of a single pool dataset hierarchy:</p>
<pre><code> /chyves/zroot/guests
/guests/<guest1>/.config/.cfg # File
/guests/<guest1>/disk{n} # Volumes
/guests/<guest1>/img # Dataset(s)
/guests/<guest1>/log # Dataset
/guests/.defaults # File
/.config # Dataset
/.config/global.cfg # File
/.config/pool.cfg # File
pool_role=primary # Pool property
/logs # Dataset
/ISO # Datasets
/Firmware # Datasets
</code></pre>
<h3 id="GUEST-STORAGE">GUEST STORAGE</h3>
<p>By default, chyves uses ZFS volumes as guest storage backing. Each volume is named disk{n} and is attached to the guest via an emulated AHCI controller. On all hosts, 8 ahci-hd devices are supported per PCI slot. On certain hosts, up to 32 ahci devices can be attached per PCI slot. See global property 'consolidate_bhyve_pci_devices' for details.</p>
<p>There is limited support for raw file backed guest storage. This is a manual process and there are not any chyves commands that create, modify, or delete these raw image files. <strong>All files</strong> in the 'img/' folder and child folders are attached to the guest on start. To have independent snapshots for each raw image, create a child datasets under <code><pool>/chyves/guests/<guest>/img</code>, this has an advantage over ZFS volumes as there is no refreservation cost associated with the snapshots. The command <code>chyves info</code> reports the raw image files and size. To create a sparse raw image run:</p>
<p><code>truncate -s 16G /chyves/<pool>/guests/<guest>/img/<image-name></code>.</p>
<h2 id="LOGS">LOGS</h2>
<p>All logs entries are stored on the primary pool under <code>/chyves/<primary-pool>/chyves/logs</code> with the dataset's compression turned on. The file are separated on a monthly basis using a <code>YYYYMM.log</code> file name. The log entries use the ISO 8601 date format for monitoring tools. There is a separate log file on a per guest basis, however at this time not all guest events are recorded to this file, however these events <em>are</em> recorded in the global logs regardless.</p>
<pre><code>2016-07-09T21:27:00+0000 - [2] - Mimicking tap50 interface for g10.
</code></pre>
<p>The logs are dash delimited with leading and trailing single spaces. The first field indicates the time in ISO 8601 format, '2016-07-09T21:27:00+0000' in the example above. The second field is the 'stdout_level', '2' in the example above. The third field is the log event, 'Mimicking tap50 interface for g10.' in the example above. See the <a href="#Global-Configuration-Properties" title="Global Configuration Properties" data-bare-link="true">Global Configuration Properties</a> section below for more information on what 'stdout_level' does.</p>
<h2 id="NETWORK">NETWORK</h2>
<p>The network mode is set by the global setting '<code>network_design_mode</code>' and determines how chyves handles network devices for the guests. The two modes are '<code>auto</code>' and '<code>system</code>', both modes are discussed below.</p>
<p>VALE support is experimentally provided as a proof of concept. VALE support is not widely implemented and is feature limited at it's current development stage. To use VALE requires that 'device netmap' be compiled into the kernel and that 'vale-ctl' be compiled from '/usr/src/tools/tools/netmap' and moved to $PATH directory. VALE natively support <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?em(4)">em<span class="s">(4)</span></a>, <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?igb(4)">igb<span class="s">(4)</span></a>, <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?ixgbe(4)">ixgbe<span class="s">(4)</span></a>, and <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?re(4)">re<span class="s">(4)</span></a>. Other NICs must use emulation which may reduce performance. See <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?netmap(4)">netmap<span class="s">(4)</span></a> for more information. VALE interfaces are added to a guest the same way a tap interface is added using: '<code>chyves network add vale{n}[:{p}]</code>' where {n} is the vale switch you want to use and optionally :{p} specifies the port on that switch. Specifying a port is not recommended. VALE interfaces are clever in that the interface is commonly shared between other guests connecting to that 'virtual' VALE switch. Two guests using 'vale0' will be connected to the same virtual switch.</p>
<p>Hosts after a certain commit support Intel e1000 emulation as an alternative to using virtio-net. This can be utilized by setting 'bhyve_net_type' to 'e1000', see guest property for details.</p>
<h3 id="AUTO-DESIGN-NETWORK-MODE">AUTO DESIGN NETWORK MODE</h3>
<p>By default, chyves is configured to manage the complete network design layout. chyves keeps track of which physical, tap, and vlan interfaces are associated with which bridges, and which tap and VALE interfaces are associated with which guests. Upon starting a guest these designs are checked, verified, and then created if not existing. To manage the network design using this method, use the 'chyves network' commands to create the associations and 'chyves list bridges' for an overview.</p>
<p>On a fresh simple installation, the only command needed is 'chyves network bridge0 attach em0'. This tells chyves to associate the interface 'em0' with the default bridge. To change the default bridge, the command would be 'chyves network bridge64 default' to set 'bridge64' as the default. All tap interfaces created for guests are then associated with the bridge set in defaults.</p>
<p>As indicated above, tap interfaces are attached to a bridge, which optionally can be attached to a physical or vlan interface. If the bridge is not associated with a physical or vlan interface, the bridge must be put into 'private' mode. This is done by running 'chyves network bridge64 private'. A private bridge allows sensitive traffic to transverse the bridge without the possibility of traffic being monitored from an outside network. A private bridge can also use <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?pf(4)">pf<span class="s">(4)</span></a> for NAT capabilities but this is not built into chyves.</p>
<h3 id="SYSTEM-DESIGN-NETWORK-MODE">SYSTEM DESIGN NETWORK MODE</h3>
<p>The 'system' mode assumes the user will correctly create and configure all devices on the host system, including the tap devices. No checks are ran to test connectivity and chyves simply attaches tap or VALE interfaces to the guest as configured in the 'net_ifaces' property.</p>
<p>Converting from 'system' to 'auto' will not automatically start to work. Each device will need to be manually associated with each other.</p>
<h2 id="PROPERTIES">PROPERTIES</h2>
<p>There are four types of chyves properties: global configuration properties, pool properties, per-guest properties, and default guest properties. Each is stored in a file in the chyves dataset hierarchy. <strong>It is not recommended to directly edit the '*.cfg' files, this is because there are no filters to stop typos, warn for incorrect property names, or invalid values.</strong> The filter is only applied when running the 'chyves <var>guest</var> set' command and not rechecked when pulling the values from the files.</p>
<p>Also certain actions are triggered when setting certain properties. For example, setting the '<code>template</code>' guest property will set or unset the <em>readonly</em> flag on the ZFS dataset.</p>
<p>The pool configuration is stored in a file at '/chyves/<var>pool</var>/.config/pool.cfg'. On the primary pool there is also a file in the same directory called 'global.cfg', this contains the global settings for chyves.</p>
<p>The 'dataset_role' setting is used to store the role of that pool containing the chyves datasets. Valid values are primary, secondary, and offline. Only one 'primary' dataset can be configured per system. The primary dataset is the only dataset that contains the ISO and firmware resources. Only the primary pool has guest defaults configuration file. These defaults are referenced when setting properties for new guests. The primary pool is also where new guests are created when the [<var>pool</var>] argument is not declared with 'chyves create' command. All other active pools are set to the "secondary" role. Pools set to the 'offline' role are left untouched and is a good role to put a local replicated backup. The primary pool is critical to the operation of chyves, without a primary pool set, only the 'dataset' sub-command are permitted to run. The first pool setup on the system is the primary pool. This can be changed later with 'chyves dataset <var>pool</var> promote'.</p>
<h3 id="Pool-Properties">Pool Properties</h3>
<p>These properties keeps track of the version of the dataset and the role. With multiple pools, defined per-pool roles are necessary. This is defined through the use of a dataset called '<var>pool</var>/chyves/.config' where the pool specific properties (<code>pool.cfg</code>) are stored.</p>
<ul>
<li><p><code>dataset_role={primary|secondary|offline}</code></p>
<p><strong>Managed through 'chyves dataset' commands.</strong></p>
<p>Vital in multi-pool configurations, each role type has different characteristics as explained below:</p>
<p><code>primary</code> - Pools in this role are utilized exclusively for the following purposes: Store ISO and Firmware resources. Reference point for global properties. New guest are defaulted to be created on this pool unless otherwise specified as a property for 'chyves create'. Only one ZFS pool can be in the primary role per system and is the only role for single zpool configurations.</p>
<p><code>secondary</code> - Pools in this role are utilized for storing other active guests not stored on the primary ZFS pool.</p>
<p><code>offline</code> - Pools in this role are not utilized, this role is intended for backup. Guests on these pools are omitted from all subcommands. To further prevent action on 'offline' pools, the dataset is renamed to 'chyves_offline' which chyves will completely ignore.</p></li>
<li><p><code>pool_version={dataset-version}</code></p>
<p><strong>Managed through 'chyves dataset' commands.</strong></p>
<p>This property indicates the current version of the chyves pool. This an upgrade mechanism to ensure the dataset and it's child datasets contain the correct architecture. The command 'chyves dataset <var>pool</var> upgrade' brings a dataset incrementally to the latest version when there is a discrepancy between the dataset version and the chyves version. A check is ran before execution to ensure the version of the pool is compatible with the version of chyves.</p></li>
</ul>
<h3 id="Global-Configuration-Properties">Global Configuration Properties</h3>
<p>These properties control the behavior of chyves.</p>
<p>Many of these properties are not recommended to be changed directly unless the scope of their impact is understood or when managed through subcommands such as '<code>chyves network</code>'. The preferred management method is given on the first line after each property in bold text.</p>
<p>Usage:</p>
<p> <code>chyves global set <property>=<value></code></p>
<p> <code>chyves list global [<pool>]</code></p>
<p>Properties:</p>
<ul>
<li><p><code>auto_load_kernel_mods</code>={yes|no}</p>
<p><strong>User managed and settable.</strong></p>
<p>When set to "yes", chyves will load the kernel modules necessary for guests. When set to 'no', chyves will simply check if the modules are loaded and exit with a message if not loaded.</p></li>
<li><p><code>bridge{n}_phy_attach</code>={<var>interface</var>|private}</p>
<p><strong>Managed through 'chyves network' commands.</strong></p>
<p>This property contains a physical or vlan interface name for a bridge to belong. When set to 'private' the bridge is not joined with a outside network.</p>
<p>Example values:</p>
<p><code>bridge0_attach=em0</code></p>
<p><code>bridge10_phy_attach=vlan52</code></p>
<p><code>bridge512_phy_attach=private</code></p>
<p>Usage:</p>
<p><code>chyves network bridge{n} attach {<interface>|private}</code></p></li>
<li><p><code>bridge{n}_tap_members</code>={tap{n}[,tap{n},tap{n}]}</p>
<p><strong>Managed through 'chyves network' commands.</strong></p>
<p>This property is a comma separated list of the tap members for bridge{n}, where {n} is the interface number. Valid values for {n} are 0 to 32768. Guests are automatically added to this property using the bridge{n} that is set in 'defaults' under the 'bridge' property.</p>
<p>Examples values:</p>
<p><code>bridge0_tap_members=t0</code></p>
<p><code>bridge70_tap_members=t20,t30</code></p>
<p>A tap can be moved to another bridge by first removing the tap from the original bridge and adding to the desired bridge. Use the following command syntax to do this:</p>
<p><code>chyves network bridge{n} unjoin tap{n}</code></p>
<p><code>chyves network bridge{n} join tap{n}</code></p></li>
<li><p><code>check_for_updates</code>={daily|weekly|monthly|always}</p>
<p><strong>User managed and settable.</strong></p>
<p>This determines how often to check for updates for chyves on the GitHub repository. The keyword 'always' means to check every time chyves is ran.</p></li>
<li><p><code>check_for_updates_last_check</code>=YYYYMMDD</p>
<p><strong>Managed internally.</strong></p>
<p>This contain the date of last check.</p></li>
<li><p><code>check_for_updates_last_check_status</code>={1|0}</p>
<p><strong>Managed internally.</strong></p>
<p>When set to '1' an update is available.</p></li>
<li><p><code>check_for_updates_timeout_seconds</code>={n}</p>
<p><strong>User managed and settable.</strong></p>
<p>This number is used to set the network timeout for <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?fetch(1)">fetch<span class="s">(1)</span></a> before giving up.</p></li>
<li><p><code>check_for_updates_unique_id</code>=UUID</p>
<p><strong>Managed internally.</strong></p>
<p>This contains a UUID used for identification. It is set when the primary pool was created.</p></li>
<li><p><code>console_start_offset</code>={integer}</p>
<p><strong>User managed and settable.</strong></p>
<p>This is a compatibility mechanism used to offset the first chyves null console modem number so that a collision are less likely with another application or bhyve front end manager. The initial default is set to '50'. After the first guests are created, then the next highest console number is used to create the next guest.</p></li>
<li><p><code>consolidate_bhyve_pci_devices</code>={no|yes}</p>
<p><strong>User managed and settable.</strong></p>
<p>The default is set to 'no' as it may have performance implications, however this may be necessary if more than 26 PCI devices are connect to a guest. This property signals the bhyve string generators to use all PCI functions for similar devices.</p>
<p>On all hosts, 8 PCI functions can be used per PCI slot. However, up to 32 ahci-hd devices can be attached to a single PCI slot for hosts running 12-CURRENT after commit r302459, 11-STABLE after commit r304422, or hosts running 10-STABLE after commit r304420. Meaning in ideal conditions up to 208 PCI devices can be attached on any host or up to 832 devices on supported hosts.</p></li>
<li><p><code>default_clone_flag</code></p>
<p><strong>User managed and settable.</strong></p>
<p>Flag to use when cloning a guest and the clone type flag is omitted. See clone command under <a href="#GUEST-CLONE-SUB-SUB-COMMAND" title="GUEST CLONE SUB-SUB-COMMAND" data-bare-link="true">GUEST CLONE SUB-SUB-COMMAND</a> section.</p></li>
<li><p><code>default_info_flags</code></p>
<p><strong>User managed and settable.</strong></p>
<p>Flags set here are passed to 'chyves info' when no flags are used. See command 'chyves info' for valid flags.</p></li>
<li><p><code>default_list_flags</code></p>
<p><strong>User managed and settable.</strong></p>
<p>Flags set here are passed to 'chyves info' WHEN the command 'chyves list' is used. Both commands use the same backend function and 'chyves list' is kept around for legacy reasons. See command 'chyves info' for valid flags.</p></li>
<li><p><code>dev_mode</code>={off|on|-xvn}</p>
<p><strong>User managed and settable, advanced feature.</strong></p>
<p>Setting to 'on' allows for functions to be called direct from the command line using <code>chyves dev</code>. Using the <code>-xvn</code> flags instead of the word <code>on</code> will use Bourne's <code>set</code> command to turn on special option flags during <code>chyves dev</code> execution. These flags can be used individually (-x|-v|-n) or combined (-xv). See <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?sh(1)">sh<span class="s">(1)</span></a>.</p></li>
<li><p><code>eject_iso_on_n_reboot</code>={n}</p>
<p><strong>User managed and settable.</strong></p>
<p>See same property name under the <a href="#Guest-Properties" title="Guest Properties" data-bare-link="true">Guest Properties</a> section below for description of functionality.</p></li>
<li><p><code>log_mode</code>={host|guest|dual}</p>
<p><strong>User managed and settable.</strong></p>
<p>Determines the source of information to save in the log files when 'log_to_file' is set to 'yes'. When set to 'guest' only guest actions are recorded. When set to 'host' only actions not involving guests are recorded. When set to dual, both are recorded.</p></li>
<li><p><code>log_to_file</code>={yes|no}</p>
<p><strong>User managed and settable.</strong></p>
<p>Turns on logging to a file. For general logging the file is saved at '/chyves/logs/YYYYMM.log' and for guests the file is saved at '/chyves/guests/<var>guest</var>/log/YYYYMM.log' or at '/chyves/<var>pool</var>guests/<var>guest</var>/ log/YYYYMM.log'.</p></li>
<li><p><code>network_design_mode</code>={auto|system}</p>
<p><strong>User managed and settable.</strong></p>
<p>The default is 'auto', which means chyves manages everything above the physical or vlan Ethernet interface, all the way to the guest. This is managed through 'chyves network' commands. When set to 'system', chyves only attaches the tap or VALE interfaces to the guest and leaves it to the user to have configured everything else (correctly). See <a href="#NETWORK" title="NETWORK" data-bare-link="true">NETWORK</a> section above.</p></li>
<li><p><code>restrict_new_property_names</code>=[off|on]</p>
<p><strong>User managed and settable, advanced feature.</strong></p>
<p>Setting to "on" allows for new properties to be created with 'chyves set'. The default is set to "off" to prevent creating new properties due to typos. Even when set to 'on' this will not allow a creation of new global or defaults properties.</p></li>
<li><p><code>stdout_level</code>={0-3}</p>
<p><strong>User managed and settable.</strong></p>
<p>Determines the amount of output to send to the terminal. The four numeric settings do the following. This does not impact the log files.</p>
<p><code>0 - off</code> - No output</p>
<p><code>1 - minimal</code> Sub command action shown</p>
<p><code>2 - regular</code> + Each step in the sub command shown</p>
<p><code>3 - verbose</code> ++ Outputs bhyve and loader command used.</p>
<p><code>4</code> -- Never print to screen. Used in <code>__return*</code> functions that would break even with the value set to '0'.</p></li>
<li><p><code>tap_start_offset</code>={integer}</p>
<p><strong>User managed and settable.</strong></p>
<p>This is a compatibility mechanism used to offset the first chyves tap interface so that a collision is less likely with another application or bhyve front end manager. The initial default is set to "50", valid values are from 0 to 32767.</p></li>
<li><p><code>tap_up_by_default</code>={off|on}</p>
<p><strong>User managed and settable.</strong></p>
<p>When set to "yes", the sysctl: net.link.tap.up_on_open is set to "1" when running script. Default is "on" but it is recommended to set to "off" and update your /boot/loader.conf to set this sysctl.</p></li>
<li><p><code>vlan_iface_base_name</code>=<var>vlan_base_name</var></p>
<p><strong>User managed and settable.</strong></p>
<p>When using a non-standard vlan naming nomenclature this needs to reflect the change. The default is "vlan" when using the standard "vlan{n}" naming nomenclature.</p></li>
<li><p><code>uefi_vnc_port_start_offset</code>={integer}</p>
<p><strong>User managed and settable.</strong></p>
<p>This is a compatibility mechanism used to offset the first VNC port used by UEFI guests. The initial default is set to "5900", valid values are from 1 to 65536.</p></li>
</ul>
<h3 id="Guest-Properties">Guest Properties</h3>
<p>These are properties used by chyves to specify the properties to pass to bhyve, grub-bhyve, and chyves itself when starting a guest. Changing these values on a running guest will not yield any change until the guest is completely stop and then started again.</p>
<p>Usage:</p>
<p><code>chyves <guest> get <property></code></p>
<p><code>chyves <guest> get all</code></p>
<p><code>chyves list properties</code></p>
<p><code>chyves list <property></code></p>
<p><code>chyves <guest>|MG|all set <property1>=<value> [<property2>=<value>] [<property3>=<value>]</code></p>
<p><code>chyves <guest>|MG|all set <property1>=<value> [<property2>=<value>] [<property3>=<value>] [<guest2> [<property1>=<value>] [<property2>=<value>]]</code></p>
<ul>
<li><p><code>bargs</code></p>
<p>For advanced users to pass additional flags directly to <code>bhyve</code>. See <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?bhyve(8)">bhyve<span class="s">(8)</span></a> for complete list of flag options. To find out which flags are used when starting a specific guest, turn on global configuration 'stdout_level' to '3' or check the global log file.</p></li>
<li><p><code>bhyveload_flags</code></p>
<p>For advanced users to pass additional flags directly to <code>bhyveload</code>. This is primarily intended to pass '-e' flags for environment variables. See <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?bhyveload(8)">bhyveload<span class="s">(8)</span></a> for a complete list of flag options. To find out which flags are used when starting a specific guest, turn on global configuration 'stdout_level' to '3' or check the global log file.</p></li>
<li><p><code>bhyve_disk_type</code>={virtio-blk|ahci-hd}</p>
<p>Sets the method to attach ZFS volumes and disk images to the guest. Most guests do not support Virt-IO block devices without installing drivers at installation.</p></li>
<li><p><code>bhyve_net_type</code>={virtio-net|e1000}</p>
<p>Sets the method to attach tap interfaces to the guest. Intel e1000 emulation is available on hosts on 12-CURRENT after commit r302504, 11-STABLE after commit r304424, and on 10-STABLE after commit r304425.</p></li>
<li><p><code>cpu</code>={n}</p>
<p>Assigns {n} number of CPU cores to a guest, up to 16.</p></li>
<li><p><code>chyves_guest_version</code>=<var>MMmm</var></p>
<p><strong>Managed through 'chyves <var>guest</var> upgrade' command.</strong></p>
<p>Used to ensure the guest contains latest properties when moved between hosts on different versions of chyves. "MM" signifies the major version as an integer and "mm" as the minor version as an integer. Changes to the major version require an upgrade via 'chyves <var>guest</var> upgrade' because a guest property value format has changed or a new required property was added. Differences in the minor version do no require an upgrade but may not have full functionality.</p></li>
<li><p><code>description</code>="<var>INSERT BRIEF DESCRIPTION</var>"</p>
<p>Used to describe guest. Use double quotes when description contains spaces.</p></li>
<li><p><code>eject_iso_on_n_reboot</code>={n}</p>
<p>This property determines if and when to eject the optical media when installing an OS. By default this is set to '1' because most *nix systems install on the first boot. Live CD should be turned to '0' and Windows systems should be set to '2' or greater.</p>
<p>There is a global property which shares the same name has has the same functionality. The global property is used if not set on the guest.</p></li>
<li><p><code>loader</code>={bhyveload|uefi|grub-bhyve}</p>
<p>Tells which loader to use to boot guest. <code>bhyveload</code> is for FreeBSD based guests, <code>uefi</code> is used for UEFI based guests, and <code>grub-bhyve</code> is used for all other guests.</p>
<p>When setting a guest to use the <code>uefi</code> loader, some <code>uefi_*</code> properties are populated. One of these properties is <code>uefi_firmware</code> which is required for guests to start.</p></li>
<li><p><code>net_ifaces</code>=tap{n}|vale{n}[:{p}]</p>
<p><strong>Managed through 'chyves network' commands when 'network_design_mode' is set to 'auto'.</strong></p>
<p><strong>User settable when 'network_design_mode' is set to 'system'.</strong></p>
<p>Stores which tap and VALE interfaces are assigned to a guest. Where {n} is a unique interface number. Taps are process locked and can not be shared simultaneously by multiple guests. Multiple devices are stored using commas as delimiters.</p>
<p>VALE interface names must be vale{n}[:{p}] where {n} can be alpha-numeric up to 9 characters long. Optionally a port can be specified where :{p} starts with a separating colon and either a single alphabetical character or a number 0-9999.</p>
<p>Usage:</p>
<p><code>chyves network <guest> add {tap|tap{n}|vale{s}[:{p}]}</code></p>
<p><code>chyves network <guest> add {tap|tap{n}} bridge{n}</code></p>
<p><code>chyves network <guest> remove {tap{n}|vale{s}[:{p}]}</code></p>
<p>See <a href="#NETWORK-SUB-COMMANDS" title="NETWORK SUB-COMMANDS" data-bare-link="true">NETWORK SUB-COMMANDS</a> section for complete list of commands to manage this property.</p></li>
<li><p><code>notes</code>="<var>INSERT FURTHER NOTES</var>"</p>
<p>Used to further describe guests. Use double quotes when description contains spaces.</p></li>
<li><p><code>os</code>=<var>operating-system</var></p>
<p>Used to determine the properties to use for the <code>grub.cfg</code> and <code>device.map</code> files when the <code>loader</code> property is set to <code>grub-bhyve</code>.</p>
<p>Supported values are openbsd60, openbsd59, openbsd58, openbsd57, netbsd, debian, d8lvm, centos6, centos7, arch, gentoo, coreos, coreossecure, default, or custom. Any other values are invalid. <code>default</code> is the generic catch-all value.</p>
<p>When 'coreos' is used, the flag 'coreos.autologin' is used to bypass authentication for the console. When 'coreossecure' is used, the console requires a username and password.</p>
<p>Using <code>custom</code> relies on the user to manually create the <code>grub.cfg</code> and <code>device.map</code> files in the guest directory <code>/chyves/<pool>/guests/<guest></code>.</p>
<p>Example:</p>
<p>For an OpenBSD guest "obsd59" located in <code>/chyves/kubota/obsd59/</code> and an install ISO in <code>/chyves/dozer/ISO/install59.iso/</code>, your files will look like this:</p>
<p><code>device.map</code> file:</p>
<pre><code>(hd0) /dev/zvol/kubota/chyves/obsd59/disk0
(cd0) /chyves/dozer/ISO/install59.iso/install59.iso
</code></pre>
<p><code>grub.cfg</code> file for installation:</p>
<pre><code>kopenbsd -h com0 (cd0)/5.9/amd64/bsd.rd
boot
</code></pre>
<p><code>grub.cfg</code> file after installation is complete:</p>
<pre><code>kopenbsd -h com0 -r sd0a (hd0,openbsd1)/bsd
boot
</code></pre>
<p>The <code>chyves</code> project welcomes any OS submissions to help other users from re-discovering leg work done by others.</p></li>
<li><p><code>pcidev_{n}</code>={bhyve-pci-dev}</p>
<p>This is an advance feature and assumes you have read <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?bhyve(8)">bhyve<span class="s">(8)</span></a> AND understood it. This property does NOT have a complete input verification suite or complete host support verification.</p>
<p>This property attaches a bhyve PCI device to the guest. The '{n}' is completely arbitrary number and is only a matter of the order of attachment. '{bhyve-pci-dev}' is the bhyve PCI device to attach. See <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?bhyve(8)">bhyve<span class="s">(8)</span></a> for a complete list or below for common uses.</p>
<p><code>chyves</code> attaches each custom PCI device alone on the PCI bus, except for pass-through devices.</p>
<p>To create a virtio RNG, the command would be</p>
<p><code>chyves <guest> set pcidev_0=virtio-rnd</code></p>
<p>To create a permanently attached optical media device using a chyves ISO resource where "cd.iso" is the ISO name, the command would be:</p>
<p><code>chyves <guest> set pcidev_1=ahci-cd,/chyves/<primary-pool>/ISO/cd.iso/cd.iso</code></p>
<p>To create a sparse 16G disk and attach, the commands would be:</p>
<p><code>truncate -s 16G /chyves/<pool>/guests/<guest>/01.img</code></p>
<p><code>chyves <guest> set pcidev_2=ahci-hd,/chyves/<pool>/guests/<guest>/01.img[,block-options]</code></p>
<p>Although not recommended, a tap interface can be manually attached using this command:</p>
<p><code>chyves <guest> set pcidev_3=virtio-net,tap10</code></p>
<p>...using Intel e1000 emulation (only 12-CURRENT hosts):</p>
<p><code>chyves <guest> set pcidev_5=e1000,tap10</code></p>
<p>...with an associated mac address:</p>
<p><code>chyves <guest> set pcidev_4=virtio-net,tap10,mac=58:9C:FC:00:00:00</code></p>
<p>PCI pass-through devices which share the same physical PCI slot number on the host also will share the same virtual physical slot number in the guest. This is due to the potential for kernel panics on certain devices such as Fiber Channel PCI cards. Keep in mind, only eight PCI functions can be assigned to a virtual physical slot in <code>bhyve</code>, additional devices are ignored. To set a PCI pass-through device use the follow commands, where '6' and '7' are arbitrary values and '9/0/0' and '9/0/1' is the PCI bus/slot/function device triplet.</p>
<p><code>chyves <guest> set pcidev_6=passthru,9/0/0</code></p>
<p><code>chyves <guest> set pcidev_7=passthru,9/0/1</code></p>
<p>To get the PCI triplet on the host, run:</p>
<pre><code>root@bhost:~ # pciconf -lv | grep -A4 -E '^ppt'
ppt0@pci0:9:0:0: class=0x0c0400 card=0x01461077 chip=0x24321077 rev=0x02 hdr=0x00
vendor = 'QLogic Corp.'
device = 'ISP2432-based 4Gb Fibre Channel to PCI Express HBA'
class = serial bus
subclass = Fibre Channel
ppt1@pci0:9:0:1: class=0x0c0400 card=0x01461077 chip=0x24321077 rev=0x02 hdr=0x00
vendor = 'QLogic Corp.'
device = 'ISP2432-based 4Gb Fibre Channel to PCI Express HBA'
class = serial bus
subclass = Fibre Channel
</code></pre>
<p>Normally the device in the example above would use the <code>isp(4)</code> drivers. However, the devices need to be using the <code>ppt</code> drivers. In this context, the <code>ppt</code> drivers tell the host to ignore the device as it will be pass-through to a virtualized guest. To get a PCI device to load the <code>ppt</code> drivers instead of it's normal drivers, edit the <code>/boot/loader.conf</code> file to contain the PCI triplet of each device in the <code>pptdevs</code> directive. The following is consistent with our examples above:</p>
<pre><code>pptdevs="9/0/0 9/0/1"
</code></pre>
<p>A reboot is necessary after editing the <code>/boot/loader.conf</code>.</p>
<p>The '<code>-S</code>' flag <em>must</em> be appended to the current '<code>bargs</code>' guest property to wire the guest memory for PCI pass-through to work.</p>
<p>To remove a <code>pcidev_{n}</code> from a guest run: <code>chyves <guest>|MG|all unset <pcidev_{n}></code>.</p>
<p>VGA/GPU Passthrough has not been reported to work. chyves issue #3 on GitHub was opened to document success and failures of bhyve passthrough of VGA/GPU devices. Check there for the latest status.</p></li>
<li><p><code>ram</code>={n}[S]</p>
<p>{n} is the number of bytes and [S] is the size denomination in "K" kilobytes, "M" megabytes, "G" gigabytes, or "T" terabytes. Megabytes are assumed if no suffix is given.</p></li>
<li><p><code>rcboot</code>={n}</p>
<p>Any non-zero number tells chyves to start the guest upon host boot when the 'chyves_enable=YES' directive is used in '/etc/rc.conf'. The integer represents the boot priority where the highest numbered guest is started first. Using '0' disables starting on host boot. If multiple guest share the same priority number, then those guests are started alphabetically.</p></li>
<li><p><code>revert_to_snapshot</code>=@snapshot-name</p>
<p>Describes the snapshot to revert to based on the handling method specified in 'revert_to_snapshot_method'. If this property is blank but a method is specified, then the latest snapshot is used.</p></li>
<li><p><code>revert_to_snapshot_method</code>={both|off|reboot|start}</p>
<p>Prior to starting and/or rebooting, a guest can be reverted to a previous snapshot state. This is helpful for guests that get modified outside of specification such as frequently compromised web server or VDI instances. Setting to 'start' only reverts the guest when starting the guest, 'reboot' only on reboots, 'both' for both starts and restarts, and 'off' to disable this feature on the guest.</p>
<p>The snapshot rollback impacts the entire dataset including guest properties. The guest properties are reloaded after the rollback to ensure there is a consistent guest state. See the <code>snapshot rollback</code> command under the <a href="#GUEST-SNAPSHOT-SUB-SUB-COMMANDS" title="GUEST SNAPSHOT SUB-SUB-COMMANDS" data-bare-link="true">GUEST SNAPSHOT SUB-SUB-COMMANDS</a> section for details on what actions are taken during a rollback.</p></li>
<li><p><code>serial</code>=nmdm{n}</p>
<p>Attaches null modem console. {n} must be a unique number and can not be shared between started guests. A unique number is given on creation. Not recommended to be changed and can never be changed while guest is running.</p></li>
<li><p><code>tap{n}_mac</code>={xx:xx:xx:yy:yy:yy}</p>
<p>Where {n} is the tap interface number to assign the specified MAC address to be attached to the network adapter inside the guest OS. The MAC address is an ASCII string in <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?ethers(5)">ethers<span class="s">(5)</span></a> format.</p>
<p>Usage:</p>
<p><code>chyves <guest> set tap10_mac=58:9C:FC:00:00:00</code></p></li>
<li><p><code>template</code>={yes|no}</p>
<p>When set to 'yes' chyves will not start the guest. The guest's datasets are set to readonly so no changes can be made until set back to 'no'.</p></li>
<li><p><code>uefi_console_output</code>={vnc|serial}</p>
<p>When set to "serial", a UEFI guest will use the standard serial interface. Guests set to "vnc" will use a VNC connection on supported hosts. VNC output is experimental and introduced to bhyve in May 2016. VNC support requires at least 11-CURRENT (r300097) or later, a modified bhyve binary with graphics support, and the UEFI firmware "BHYVE_UEFI_20160526.fd".</p></li>
<li><p><code>uefi_firmware</code>=<var>firmware-resource-name</var></p>
<p>UEFI firmware bootrom file used to boot UEFI guests. These are available in Peter Grehan's public FreeBSD file directory or sysutils/uefi-edk2-bhyve. The value must be the exact name as displayed in 'chyves list firmware'.</p></li>
<li><p><code>uefi_vnc_client</code>={print|freerdp|custom}</p>
<p>This stores the preferred VNC client used to start a session with the guest properties pre-populated.</p></li>
<li><p><code>uefi_vnc_client_custom_cmd</code></p>
<p>This contains the command to start the VNC client when 'uefi_vnc_client' is set to 'custom'.</p></li>
<li><p><code>uefi_vnc_ip</code>=x.x.x.x</p>
<p>Specifies the IP for the host to bind-to for VNC connections for the guest. The default is "0.0.0.0" which binds to all IPs on the host.</p></li>
<li><p><code>uefi_vnc_mouse_type</code>=ps2|usb3</p>
<p>This property is only used when the property "uefi_console_output" is set to "vnc". When set to "ps2" a PS/2 mouse is connected to the guest. When set "usb3" a USB 3.0 tablet is emulated which provides much better mouse performance but is only supported on newer guest OSes.</p></li>
<li><p><code>uefi_vnc_pause_until_client_connect</code>={on|off}</p>
<p>When set to "on" the guest will wait to boot until a VNC client connects. This is helpful for installations requiring a key press within a short timing window.</p></li>
<li><p><code>uefi_vnc_port</code>={n}</p>
<p>Specifies the port for the host to listen on for VNC connections for the guest. Valid values are from 1 to 65536.</p></li>
<li><p><code>uefi_vnc_res</code>=<var>width</var>x<var>height</var></p>
<p>Specifies the resolution the VNC client will connect with. The following resolutions are supported:</p>
<p><code>1920x1200</code></p>
<p><code>1920x1080</code></p>
<p><code>1600x1200</code></p>
<p><code>1600x900</code></p>
<p><code>1280x1024</code></p>
<p><code>1280x720</code></p>
<p><code>1024x768</code></p>
<p><code>800x600</code></p>
<p><code>640x480</code></p></li>
<li><p><code>uuid</code>=<var>uuid</var></p>
<p>Sets UUID for bhyve instance. Set by /bin/uuidgen at creation.</p></li>
<li><p><code>virtio_block_options_disk{n}</code>=[nocache[,direct][,ro][,sectorsize=logical[/physical]]]</p>
<p>This is an advance feature and assumes you have read <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?zfs(8)">zfs<span class="s">(8)</span></a> man page AND completely understood it. This property does NOT have a complete input verification suite.</p>
<p>This is a per disk setting used to append bhyve virtio-block options to a disk. While there is a very limited use case of these options, they can be utilized but it is not recommended. See <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?bhyve(8)">bhyve<span class="s">(8)</span></a> for what these options do.</p>
<p>Keep in mind that the logical sectorsize is already used by chyves and pulled from the zvol's 'volblocksize' ZFS property when the <em>virtio_block_options</em> is not set. When the property "virtio_block_options_disk{n}" exists, the sectorsize is no longer automatically populated to prevent collision.</p>
<p>To set this property for disk0 to have read only with a 512 sector size and a 4096 physical size:</p>
<p><code>chyves <guest> set virtio_block_options_disk0=ro,sectorsize=512/4096</code></p></li>
</ul>
<h3 id="Default-Guest-Properties">Default Guest Properties</h3>
<p>These properties are referenced when creating new guests. The guest section of properties have the same purpose as described in <a href="#Guest-Properties" title="Guest Properties" data-bare-link="true">Guest Properties</a> section above, unless otherwise noted. Below are the initial default values on a fresh installation of chyves for reference.</p>
<p>The some UEFI properties are not assigned until the 'loader' value is set to 'uefi'. This is to prevent assigning properties to guests which can not utilize those features.</p>
<p>The UEFI VNC properties are not assigned until the 'uefi_console_output' value is set to 'vnc'. This is to prevent unused VNC port numbers from being assigned to guests which can not utilize those features.</p>
<p>Usage:</p>
<p><code>chyves defaults set <property>=<value></code></p>
<p><code>chyves list defaults</code></p>
<p>Defaults and initial values:</p>
<ul>
<li><p><code>bargs</code></p>
<p>"-A -H -P" - default for guests running on FreeBSD less than 10.3.</p>
<p>"-A -H -P -S" - default for guests running on FreeBSD 10.3 or later.</p></li>
<li><p><code>bhyve_net_type</code>=virtio-net</p></li>
<li><p><code>bridge</code>=bridge0</p>
<p>Used to set the bridge to join tap interfaces to for new guests.</p></li>
<li><p><code>cpu</code>=1</p></li>
<li><code>loader</code>=bhyveload</li>
<li><code>os</code>=default</li>
<li><code>ram</code>=256M</li>
<li><code>rcboot</code>=0</li>
<li><code>revert_to_snapshot</code>=""</li>
<li><code>revert_to_snapshot_method</code>=off</li>
<li><p><code>size</code>=8G</p>
<p>Used during guest and disk creation when the size property is omitted. No longer a guest property. The ZFS property 'used' is used to show the size in 'chyves info -z'.</p></li>
<li><p><code>template</code>=no</p></li>
<li><code>uefi_console_output</code>=serial</li>
<li><code>uefi_firmware</code>="-"</li>
<li><code>uefi_vnc_client</code>=print</li>
<li><code>uefi_vnc_ip</code>=0.0.0.0</li>
<li><code>uefi_vnc_mouse_type</code>=ps2</li>
<li><code>uefi_vnc_pause_until_client_connect</code>=no</li>
<li><code>uefi_vnc_res</code>=800x600</li>
</ul>
<p>These default disk properties are direct ZFS values used when creating disks for the guest. These properties are not recommended to be changed, a person is liable to chainsaw a foot off and then massacre a nearby litter of kitten and or puppies in the process. Heed this warning! The value "inherit" will inherit the value set by the ZFS (*grand)parents. See <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?zfs(8)">zfs<span class="s">(8)</span></a> on settable values but remember, think of the kittens and puppies. The initial default values are:</p>
<ul>
<li><code>disk_volmode</code>=dev</li>
<li><code>disk_volblocksize</code>=512</li>
<li><code>disk_dedup</code>=inherit</li>
<li><code>disk_compression</code>=inherit</li>
<li><code>disk_primarycache</code>=inherit</li>
<li><code>disk_secondarycache</code>=inherit</li>
</ul>
<h2 id="TMUX-SUPPORT">TMUX SUPPORT</h2>
<p>Utilization of tmux is provided under the command 'chyves <var>guest</var> console tmux'.</p>
<p>chyves utilizes tmux by creating a session called "chyves", then creates a window named after the guest, then splits that window into two panes. The left pane is used to manage the guest and the right pane is the serial console for the guest. If a window named after the guest already exists, then the command is inserted into the active pane for that guest window and then the session is joined or rather 'attached' in tmux's parlance. Each additional guest has a window created under the same 'chyves' named session. See <a class="man-ref" href="https://www.freebsd.org/cgi/man.cgi?tmux(1)">tmux<span class="s">(1)</span></a> for full details on use.</p>
<p>To use a command for tmux, enter: 'Ctrl + b (release-keys) <var>command</var>'. Where Ctrl + b is the modifier, (release-keys) is literally releasing the Ctrl and b keys, and <var>command</var> is the case sensitive letter or command to type in. Sometimes this is written as 'C-m' where 'm' means modifier. In this man page, the abbreviated syntax used is 'C-b'. Below are necessary tmux commands for basic use with chyves:</p>
<p>While in a tmux session:</p>
<ul>
<li><code>C-b n</code> Go to next guest window.</li>
<li><code>C-b p</code> Go to previous guest window.</li>
<li><code>C-b l</code> Go to last guest window.</li>
<li><code>C-b w</code> List all available guest windows and select which to go to.</li>
<li><code>C-b (left-arrow)</code> Move cursor to the pane to the left</li>
<li><code>C-b (right-arrow)</code> Move cursor to the pane to the right</li>
<li><code>C-b (up-arrow)</code> Move cursor to the pane above</li>
<li><code>C-b (down-arrow)</code> Move cursor to the pane below</li>
<li><code>C-b c</code> Create a new window</li>
<li><code>C-b %</code> Split the current pane vertically</li>
<li><code>C-b "</code> Split the current pane horizontally</li>
<li><code>C-b x</code> Kill current window</li>
<li><code>C-b d</code> Detach from tmux session, remains opened in background.</li>
<li><code>C-b D</code> Detach other connections from session. Good if a session is opened from a smaller resolution client in one location. Disconnecting it will maximum the screen use on the local connection.</li>
</ul>
<p>When not in a tmux session:</p>
<ul>
<li><p><code>tmux attach -t chyves</code></p>
<p>Reattach to the tmux session named 'chyves'.</p></li>
<li><p><code>tmux at</code></p>
<p>Reattach to the last tmux session</p></li>
</ul>
<h2 id="UEFI-SUPPORT">UEFI SUPPORT</h2>
<p>Support to boot guests via UEFI is provided through the use of a bootrom firmware set with the 'uefi_firmware' property. This boot method is set by changing the 'loader' property to 'uefi'. When this is done for the first time on a guest, many other guest UEFI properties are populated.</p>
<p>Graphical console support is provided via UEFI GOP as of May 2016, this replaces the serial interface. Support is provided as a technical preview as there are still sharp edges. Know issues: partial VNC client support and mouse mapping issues when 'uefi_vnc_mouse_type' property set to 'ps2'. The following is required for graphical console use: the property 'uefi_console_output' must be set to 'vnc' on the guest, a host on 11-BETA1, and the UEFI firmware 'BHYVE_UEFI_20160526.fd', and a VNC client.</p>
<p>See <a href="#Guest-Properties" title="Guest Properties" data-bare-link="true">Guest Properties</a> section for complete list of related <code>uefi_*</code> properties.</p>
<h3 id="VNC-CLIENT-SUPPORT">VNC CLIENT SUPPORT</h3>
<p>Support for VNC client launching is utilized with <code>chyves <guest> console vnc</code>. This either prints the VNC settings or starts a VNC session. Currently FreeRDP is preconfigured or a custom VNC client can be configured with the 'uefi_vnc_client_custom_cmd' property.</p>
<h2 id="COMMANDS">COMMANDS</h2>
<ul>
<li><p><code>dataset</code></p>
<p>See <a href="#DATASET-SUB-COMMANDS" title="DATASET SUB-COMMANDS" data-bare-link="true">DATASET SUB-COMMANDS</a> section.</p></li>
<li><p><code>firmware</code></p>
<p>See <a href="#FIRMWARE-SUB-COMMANDS" title="FIRMWARE SUB-COMMANDS" data-bare-link="true">FIRMWARE SUB-COMMANDS</a> section.</p></li>
<li><p><code><guest></code></p>
<p>See <a href="#GUEST-SUB-COMMANDS" title="GUEST SUB-COMMANDS" data-bare-link="true">GUEST SUB-COMMANDS</a> sections.</p></li>
<li><p><code>help</code></p>
<p>Prints version information, command valid syntax.</p></li>
<li><p><code>dev</code></p>
<p><code>chyves dev [<function>|<command>] "param1" ... "param7"</code></p>
<p>Allows for a function to be called direct from command line when developing for chyves. Requires <em>dev_mode</em> to be set with something other than 'off'. This is globally set on the primary pool on. See <a href="#Global-Configuration-Properties" title="Global Configuration Properties" data-bare-link="true">Global Configuration Properties</a> section above.</p>
<p>The properties are function indexed and only seven parameters are possible due to the way Bourne indexes parameters. Double quotes are required for parameters with strings, such as commands.</p></li>
<li><p><code>info</code></p>
<p>See <a href="#INFO-COMMAND" title="INFO COMMAND" data-bare-link="true">INFO COMMAND</a> section.</p></li>
<li><p><code>iso</code></p>
<p>See <a href="#ISO-SUB-COMMANDS" title="ISO SUB-COMMANDS" data-bare-link="true">ISO SUB-COMMANDS</a> section.</p></li>
<li><p><code>list</code></p>
<p>See <a href="#LIST-SUB-COMMANDS" title="LIST SUB-COMMANDS" data-bare-link="true">LIST SUB-COMMANDS</a> section.</p></li>
<li><p><code>upgrade</code></p>
<p><code>chyves upgrade [master|dev|check]</code></p>
<p>Downloads and installs the latest version from the current running branch on GitHub. Optionally the branch can be specified to change branches. Changing from <code>dev</code> to <code>master</code> may render an unusable system if the 'chyves_guest_version' or 'dataset_version' has changed in those branches and those changes have not made it to 'master' yet.</p>
<p>To run only a version check, use the keyword 'check'.</p></li>
<li><p><code>version</code></p>
<p>Prints the current running chyves version, dataset version, guest version, and branch.</p></li>
</ul>
<h3 id="DATASET-SUB-COMMANDS">DATASET SUB-COMMANDS</h3>
<ul>
<li><p><code>install</code></p>
<p><code>chyves dataset <pool> install</code></p>
<p>Creates ZFS datasets and properties on the specified pool. The first pool is always setup as the primary pool. This is the first step to getting chyves running.</p></li>
<li><p><code>upgrade</code></p>
<p><code>chyves dataset <pool> upgrade</code></p>
<p>Upgrades dataset version from an old version to the newest version incrementally. This is done by adding, removing, and updating properties which are required by the latest version of chyves. It is recommended to upgrade the primary pool first in case their are new defaults, otherwise the 'chyves <var>guest</var> upgrade' will need to be manually ran against the guests on secondary pools.</p></li>
</ul>
<h3 id="FIRMWARE-SUB-COMMANDS">FIRMWARE SUB-COMMANDS</h3>
<p>These sub-commands manage UEFI firmware resources.</p>
<ul>
<li><p><code>import</code></p>
<p><code>chyves firmware import {URL|<local-path-to-firmware>}</code></p>
<p>Imports a firmware resource into chyves. Either a local or remote source can be given. Remote sources can be from http or ftp sources.</p></li>
<li><p><code>rename</code></p>
<p><code>chyves firmware rename {firmware-name} <desired-name></code></p>
<p>Rename an firmware resource.</p></li>
<li><p><code>delete</code></p>
<p><code>chyves firmware delete {firmware-name}</code></p>
<p>Delete an firmware resource.</p></li>
<li><p><code>list</code></p>
<p><code>chyve firmware list</code></p>
<p>List available firmware resources.</p></li>
</ul>
<h3 id="GUEST-SUB-COMMANDS">GUEST SUB-COMMANDS</h3>
<ul>
<li><p><code>clone</code></p>
<p>See <a href="#GUEST-CLONE-SUB-SUB-COMMAND" title="GUEST CLONE SUB-SUB-COMMAND" data-bare-link="true">GUEST CLONE SUB-SUB-COMMAND</a> section below.</p></li>
<li><p><code>console</code></p>