forked from oVirt/vdsm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdsm.spec.in
1407 lines (1217 loc) · 45.4 KB
/
vdsm.spec.in
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
# Packages names
%global vdsm_name vdsm
# Required users and groups
%global vdsm_user vdsm
%global vdsm_group kvm
%{!?qemu_user: %global qemu_user qemu}
%{!?qemu_group: %global qemu_group qemu}
%global snlk_group sanlock
%global snlk_user sanlock
%global cdrom_group cdrom
# Features
%{!?with_ovirt_imageio: %global with_ovirt_imageio 1}
%{!?with_ovirt_vmconsole: %global with_ovirt_vmconsole 1}
%{!?with_gluster_mgmt: %global with_gluster_mgmt 1}
%{!?with_hooks: %global with_hooks 1}
%{!?with_vhostmd: %global with_vhostmd 1}
%ifarch ppc64le
%global with_openvswitch_default 0
%else
%global with_openvswitch_default 1
%endif
%{!?with_openvswitch: %global with_openvswitch %{with_openvswitch_default}}
%{!?vdsm_repo: %global vdsm_repo /rhev/data-center}
%if 0%{?centos} || 0%{?fedora}
%global gluster_version 3.12
%else #rhel
%global gluster_version 3.8
%endif
# Default to skipping autoreconf. Distros can change just this one line
# (or provide a command-line override) if they backport any patches that
# touch configure.ac or Makefile.am.
%{!?enable_autotools:%global enable_autotools 0}
# Required paths
%if 0%{?fedora}
%global _polkitdir %{_datadir}/polkit-1/rules.d
%else
%global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d
%endif
%global _vdsm_log_dir %{_localstatedir}/log/%{vdsm_name}
# Disable debuginfo package, since vdsm is a meta-package
%global debug_package %{nil}
%{!?target_py: %global target_py py3}
%if %{target_py} == py2
%global python2_or_python3 python2
%global python_or_python3 python
%global python_pyyaml PyYAML
%else
%global python2_or_python3 python3
%global python_or_python3 python3
%global python_pyyaml python3-pyyaml
%endif
%if %{target_py} == py3
# RPM packaging guidelines require all files outside of '/usr/lib[64]/pythonX.X'
# to be compiled manually [1]. Some distros try to find '*.py' files outside of the aforementioned
# dirs and compile them for us, but using hard-coded '__python' macro, which points to Python 2.
# We opt-out of this behavior and do the compilation ourselves in 'install' stage.
#
# [1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#manual-bytecompilation
%global _python_bytecompile_extra 0
%global python_sitelib %{python3_sitelib}
%endif
%if %{target_py} == py2
%global python_libvirt libvirt-python
%else
%global python_libvirt python3-libvirt
%endif
# Release must be generated dynamically and that can't be done here.
# It must be either:
# - filled in by configure
# - generated using ./build-aux/make-dist script
# - passed to rpmbuild as
# --define="vdsm_release $(./build-aux/pkg-version --release)"
%{!?vdsm_release: %global vdsm_release @PACKAGE_RELEASE@}
Name: %{vdsm_name}
Version: 4.40.9
Release: %{vdsm_release}%{?dist}%{?extra_release}
Summary: Virtual Desktop Server Manager
Group: Applications/System
License: GPLv2+
Url: http://www.ovirt.org/develop/developer-guide/vdsm/vdsm/
Source0: %{vdsm_name}-%{version}.tar.gz
%{!?_licensedir:%global license %%doc}
BuildRequires: openssl
BuildRequires: %{python_or_python3}
BuildRequires: %{python_or_python3}-six >= 1.9.0
BuildRequires: %{python_or_python3}-dateutil
%if %{target_py} == py2
BuildRequires: python-subprocess32
%endif
BuildRequires: %{python2_or_python3}-devel
BuildRequires: rpm-build
BuildRequires: systemd-units
# Autotools BuildRequires
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: util-linux
%endif
%if %{target_py} == py2
%if 0%{?rhel}
BuildRequires: python-enum34
%else # fedora
BuildRequires: python2-enum34
%endif
%endif
%if 0%{?rhel} >= 8
# we don't want BRP to change all our shebangs to platform-python
%undefine __brp_mangle_shebangs
%endif
# Numactl is not available on s390[x] and ARM
%ifnarch s390 s390x %{arm}
Requires: numactl
%endif
%ifarch x86_64
Requires: %{python_or_python3}-dmidecode
Requires: dmidecode
Requires: virt-v2v
%endif
Requires: chrony
Requires: which
Requires: sudo >= 1.7.3
Requires: logrotate
Requires: lshw
Requires: xz
Requires: %{python_or_python3}-netaddr
%if %{target_py} == py2
Requires: python-pthreading >= 0.1.3-3
Requires: rpm-python
%else
Requires: python3-rpm
%endif
Requires: %{python_or_python3}-six >= 1.9.0
Requires: %{python_or_python3}-requests
Requires: abrt-cli
Requires: abrt-addon-vmcore
Requires: abrt-addon-ccpp
%if %{target_py} == py3
Requires: python3-abrt-addon
%else
# python2 abrt-addon-python doesn't exist in Fedora anymore
%if ! 0%{?fedora}
Requires: abrt-addon-python
%endif
%endif
Requires: curl
Requires: %{name}-http = %{version}-%{release}
Requires: %{name}-jsonrpc = %{version}-%{release}
%if 0%{?rhel} >= 8
Requires: safelease >= 1.0.1-1.el8ev
%else
Requires: safelease >= 1.0-7
%endif
Requires: mom >= 0.5.14
Requires: util-linux
Requires(pre): shadow-utils
Obsoletes: %{name}-infra < 4.19
%if 0%{?rhel}
# Required for supporting minorversion mount option
# See https://bugzilla.redhat.com/1547681 for details.
Requires: nfs-utils >= 1:1.3.0-0.48.el7_4.2
%else # fedora
Requires: nfs-utils
%endif
%if %{with_ovirt_imageio}
# For kvm2ovirt
Requires: ovirt-imageio-common == 1.6.3
# For controlling /tickets
Requires: ovirt-imageio-daemon == 1.6.3
%endif
%if %{with_ovirt_vmconsole}
Requires: ovirt-vmconsole >= 1.0.0-0
%endif
# Python
%if %{target_py} == py2
# For https://bugzilla.redhat.com/1518676
%if 0%{?rhel}
Requires: %{python_or_python3} >= 2.7.5-65.el7
%else
Requires: %{python_or_python3} >= 2.7.14-4
%endif
%else # target_py
Requires: python3 >= 3.6
%endif
Requires: libvirt-client
Requires: libvirt-daemon-config-nwfilter
Requires: libvirt-lock-sanlock
%if 0%{?rhel}
%if 0%{?rhel} < 8
# 7.6 baseline
Requires: %{python_libvirt} >= 4.5.0-1.el7
# CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Requires: libvirt-daemon-kvm >= 4.5.0-10.el7_6.9
%else # RHEL 8
# Need a libvirt version with socket activation
Requires: libvirt-daemon-kvm >= 5.6
Requires: %{python_libvirt}
%endif
%else # fedora
%ifnarch s390 s390x
# virt-preview is not available for s390
# Required to fix order of VM life cycle events.
# See https://bugzilla.redhat.com/1612943 for details.
Requires: libvirt-daemon-kvm >= 4.9.0-1
Requires: %{python_libvirt} >= 4.9
%else
Requires: libvirt-daemon-kvm
# Required for preventing an HotPlug disk failure due to cgroups.
# See https://bugzilla.redhat.com/1540872 for details.
Requires: %{python_libvirt} >= 3.7.0
%endif
%endif
# iscsi-intiator versions
Requires: iscsi-initiator-utils >= 6.2.0.873-21
%if %{target_py} == py2
# Adding 4k support.
Requires: sanlock-python >= 3.7.3
%else
Requires: python3-sanlock
%endif
# device-mapper-multipath
%if 0%{?rhel}
# Required for blacklisting multipath devices by protocol.
# See https://bugzilla.redhat.com/1016535 for more details.
Requires: device-mapper-multipath >= 0.4.9-119.el7_5.1
%endif #rhel
%if 0%{?fedora}
Requires: device-mapper-multipath >= 0.7.4-3
%endif
# augeas
%if 0%{?rhel}
Requires: %{python_or_python3}-augeas
%endif
%if 0%{?fedora}
Requires: %{python2_or_python3}-augeas
%endif
%if %{target_py} == py2
Requires: policycoreutils-python
%else
Requires: python3-policycoreutils
%endif
Requires: fence-agents-all
Requires: systemd >= 219-11
Requires: initscripts >= 9.49.31
Requires: cyrus-sasl-scram
%if 0%{?fedora}
# Required for solving bug 1575762
Requires: lvm2 >= 2.02.177-5
%else
# EL 8.1 baseline.
Requires: lvm2 >= 8:2.03
%endif
%if 0%{?rhel}
# TODO - use baseline el8.1 kernel version once available
%if 0%{?centos}
# CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Requires: kernel >= 3.10.0-957.12.2.el7
%else # rhel
# CVE-2019-14835
Requires: kernel >= 4.18.0-145.el8
%endif
Requires: e2fsprogs
Requires: selinux-policy-targeted >= 3.13.1-166.el7_4.3
%else # fedora
# CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Requires: kernel >= 5.0.16-100
Requires: e2fsprogs >= 1.41.14
Requires: %{python_or_python3}-policycoreutils
Requires: sed >= 4.2.1-10
Requires: ed
Requires: selinux-policy-targeted >= 3.13-1
# In order to avoid a policycoreutils bug (rhbz 889698) when selinux is
# disabled we now require the version 2.1.13-55 (or newer) of Fedora.
Requires: policycoreutils >= 2.1.13-55
%endif
# qemu-kvm
%if 0%{?rhel} >= 8
%if 0%{?centos}
# 4.4 Advanced virt stream on CentOS 8.1
Requires: qemu-kvm >= 15:4.1.0-16
%else
# 4.4, AV 8.2 - https://bugzilla.redhat.com/1811728
# it's a libvirt bug, but let's use a matching qemu version to not split packages from same module
Requires: qemu-kvm >= 15:4.2.0-14.module+el8.2.0+5995+d02a4eeb
%endif #centos
%endif #rhel
%if 0%{?rhel} == 7
# 4k not supported yet on rhel 7.
# https://bugzilla.redhat.com/1745443
# CVE-2018-12126, CVE-2018-12127, CVE-2018-12130, CVE-2019-11091
Requires: qemu-kvm-rhev >= 10:2.12.0-18.el7_6.5
%endif
%if 0%{?fedora}
%ifarch s390 s390x
# virt-preview is not available on s390 arch.
Requires: qemu-kvm >= 2:2.11.2
%else
# For 4k support:
# - https://bugzilla.redhat.com/1737256
# - https://bugzilla.redhat.com/1738657
Requires: qemu-kvm >= 2:4.1.0-2
%endif # s390
%endif # fedora
# GlusterFS client-side RPMs needed for Gluster SD
%ifnarch ppc64le
Requires: glusterfs-cli >= %{gluster_version}
Requires: glusterfs-fuse >= %{gluster_version}
%endif
Requires: psmisc >= 22.6-15
# Make sure we require sos version which includes VDSM plugin
%if 0%{?centos} || 0%{?fedora}
# Currently we are without sos VDSM plugin on CentOS/Fedora:
# - CentOS: When 7.7 is released, we also need to require 3.7-3+
# - Fedora: When sos 3.7.1/3.8 is relased, we need to require it
Requires: sos
%else
# RHEL
%if 0%{?rhel} >= 8
Requires: sos >= 3.7-1
%else
Requires: sos >= 3.7-3
%endif
%endif
Requires: tree
Requires: dosfstools
Requires: genisoimage
%if %{target_py} == py2
Requires: libselinux-python >= 2.5-2
%else
Requires: python3-libselinux
%endif
Requires: %{name}-python = %{version}-%{release}
Requires: %{name}-hook-vmfex-dev = %{version}-%{release}
Requires: libguestfs-tools-c
Requires(post): /usr/sbin/saslpasswd2
%if 0%{?fedora} || 0%{?rhel} >= 8
Requires(post): hostname
%else
# RHEL/CentOS 7
Requires(post): /bin/hostname
%endif
# SecureBoot & q35, supported by x86_64 and aarch64; no ppc64le support at
# the moment.
%ifarch x86_64 %{arm}
%if 0%{?rhel}
Requires: OVMF
%else # fedora
Requires: edk2-ovmf
%endif
%endif
Conflicts: ovirt-hosted-engine-ha < 2.3.6
Conflicts: vdsm-hook-sriov
Obsoletes: vdsm-hook-vfio-mdev
Provides: vdsm-hook-vfio-mdev
Obsoletes: %{name}-hook-floppy
Obsoletes: %{name}-hook-numa
Obsoletes: %{name}-hook-pincpu
Obsoletes: %{name}-hook-vmdisk
Obsoletes: %{name}-hook-hostdev-scsi
%description
The VDSM service is required by a Virtualization Manager to manage the
Linux hosts. VDSM manages and monitors the host's storage, memory and
networks as well as virtual machine creation, other host administration
tasks, statistics gathering, and log collection.
%package http
Summary: VDSM http API
BuildArch: noarch
Provides: %{name}-xmlrpc = %{version}-%{release}
Requires: %{name}-python = %{version}-%{release}
Obsoletes: %{name}-xmlrpc < %{version}-%{release}
%description http
A http interface for interacting with vdsmd when using OVF store image
download or upload.
%package client
Summary: VDSM client
BuildArch: noarch
# A hack for unbreaking external packages that expect vdsm-cli.
Provides: %{name}-cli = %{version}-%{release}
Requires: %{name}-api = %{version}-%{release}
Requires: %{name}-yajsonrpc = %{version}-%{release}
Requires: %{name}-python = %{version}-%{release}
Obsoletes: %{name}-cli < %{version}-%{release}
%description client
Access vdsm API from the command line.
%package api
Summary: VDSM API
BuildArch: noarch
BuildRequires: %{python_pyyaml}
%description api
Contains api schema files
%package jsonrpc
Summary: VDSM API Server
BuildArch: noarch
Requires: %{name}-python = %{version}-%{release}
Requires: %{name}-api = %{version}-%{release}
Requires: %{name}-yajsonrpc = %{version}-%{release}
Obsoletes: %{name}-api < 4.16
%description jsonrpc
A Json-based RPC interface that serves as the protocol for libvdsm.
%package yajsonrpc
Summary: JSON RPC server and client implementation
BuildArch: noarch
%if %{target_py} == py2
Requires: python >= 2.6
%else
Requires: python3 >= 3.6
%endif
%description yajsonrpc
A JSON RPC server and client implementation.
%package common
Summary: common VDSM python libraries, required by all subsystems
BuildArch: noarch
Requires: systemd
Requires: glibc
Requires: %{python_or_python3}-dateutil
Requires: %{python_or_python3}-six >= 1.9.0
%if %{target_py} == py2
Requires: python-subprocess32
%if 0%{?rhel}
Requires: python-enum34
%else # fedora
Requires: python2-enum34
%endif
%endif
%if 0%{?rhel}
Requires: %{python_or_python3}-decorator
Requires: %{python_libvirt} >= 3.2.0-3.el7_4.1
%endif
%if 0%{?fedora}
Requires: %{python2_or_python3}-decorator
Requires: %{python_libvirt} >= 3.7.0
%endif
%description common
VDSM libraries that are imported by all subsystems
%package network
Summary: VDSM network python libraries
Requires: NetworkManager-config-server
Requires: dhcp-client
%if %{target_py} == py2
Requires: dbus-python
%else
Requires: python3-dbus
%endif
Requires: dhclient
Requires: ethtool
Requires: initscripts
Requires: iproute
Requires: iproute-tc
# remove when nmstate is finished
Requires: network-scripts
%if 0%{?rhel} || 0%{?fedora} >= 32
Requires: nmstate >= 0.2.6
%else
# Temporary HACK to not block development on Fedora 30
Requires: nmstate >= 0.0.8
%endif
Requires: libnl3
%if %{target_py} == py2
Requires: libselinux-python
%else
Requires: python3-libselinux
%endif
Requires: lldpad
%if %{with_openvswitch}
Requires: openvswitch >= 2.7.0
%endif
Requires: %{python_or_python3}-inotify
%if %{target_py} == py2
Requires: python-ipaddress
%endif
Requires: %{python_or_python3}-netaddr
Requires: %{python_or_python3}-six
Requires: systemd
Requires: %{name}-common = %{version}-%{release}
%description network
VDSM network python libraries
%package python
Summary: VDSM python libraries
Requires: %{name}-api = %{version}-%{release}
BuildArch: noarch
# Provides probe_block_size(), see https://bugzilla.redhat.com/1753898
Requires: %{python2_or_python3}-ioprocess >= 1.3.0
Requires: %{name}-common = %{version}-%{release}
Requires: %{name}-network = %{version}-%{release}
%description python
Shared libraries between the various VDSM packages.
%package hook-allocate_net
Summary: random_network allocation hook for VDSM
BuildArch: noarch
Requires: %{name}
%description hook-allocate_net
VDSM hook used to allocate networks for vms in a random fashion
%package hook-boot_hostdev
Summary: allows setting boot order for hostdev
BuildArch: noarch
Requires: %{name}
%description hook-boot_hostdev
VDSM hook used to boot vms from passthrough devices via custom property
%package hook-checkimages
Summary: Qcow2 disk image format check hook for VDSM
BuildArch: noarch
Requires: %{name}
%description hook-checkimages
VDSM hook used to perform consistency check on a qcow2 format disk image
using the QEMU disk image utility.
%package hook-checkips
Summary: Check connectivity from the host to designated IPs
Requires: %{name} = %{version}-%{release}
%description hook-checkips
VDSM hook used to check connectivity from the host network to designated IPs
%post hook-checkips
%systemd_post vdsm-checkips.service
%preun hook-checkips
%systemd_preun vdsm-checkips.service
%package hook-diskunmap
Summary: Activate UNMAP for disk/lun devices
BuildArch: noarch
Requires: qemu-kvm >= 1.5
%description hook-diskunmap
VDSM hooks which allow to activate disk UNMAP.
%package hook-ethtool-options
Summary: Allow setting custom ethtool options for vdsm controlled nics
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
%description hook-ethtool-options
VDSM hook used for applying custom network properties that define ethtool
options for vdsm network nics
%package hook-extra-ipv4-addrs
Summary: Set extra ipv4 addresses for vdsm networks.
%description hook-extra-ipv4-addrs
This hook allows the user to set extra ipv4
addresses for vdsm networks.
%if %{with_vhostmd}
%package hook-vhostmd
Summary: VDSM hook set for interaction with vhostmd
BuildArch: noarch
Requires: vhostmd
%description hook-vhostmd
VDSM hook to use vhostmd per VM according to Virtualization Manager requests.
%endif
%package hook-faqemu
Summary: Fake qemu process for VDSM quality assurance
BuildArch: noarch
Requires: %{name}
%description hook-faqemu
VDSM hook used for testing VDSM with multiple fake virtual machines without
running real guests.
To enable this hook on your host, set vars.fake_kvm_support=True in your
/etc/vdsm/vdsm.conf before adding the host to ovirt-Engine.
%package hook-localdisk
Summary: Use a local image instead of a shared storage image
BuildArch: noarch
Requires: %{name} == %{version}
%description hook-localdisk
This hook adds the ability to use fast local storage instead of shared
storage, while using shared storage for managing VM templates.
To enable this hook, the VM should have a custom property of 'localdisk=lvm'.
The system administrator will be responsible for creating the host "ovirt-local"
volume group and extending it with new devices if needed.
The VM must be pinned to the host.
%package hook-macbind
Summary: Bind a vNIC to a Bridge
BuildArch: noarch
Requires: %{name} >= 4.14
%description hook-macbind
VDSM hooks which allow to bind a vNIC to a Bridge, managed or not by engine.
%package hook-extnet
Summary: Force a vNIC to connect to a specific libvirt network
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
%description hook-extnet
VDSM hook which allows to connect a vNIC to a libvirt network that is managed
outside of oVirt, such as an openvswitch network.
%package hook-fakevmstats
Summary: Generate random VM statistics
BuildArch: noarch
Requires: %{name}
%description hook-fakevmstats
Hook intercepts VM's stats and randomizes various fields.
To enable this hook on your host, set vars.fake_vmstats_enable=true in your
/etc/vdsm/vdsm.conf.
%package hook-fileinject
Summary: Allow uploading file to VMs disk
BuildArch: noarch
Requires: %{python_or_python3}-libguestfs
%description hook-fileinject
Hook is getting target file name and its content and
create that file in target machine.
%package hook-httpsisoboot
Summary: Allow directly booting from an https available ISO
BuildArch: noarch
%description hook-httpsisoboot
Let the VM boot from an ISO image made available via an https URL without
the need to import the ISO into an ISO storage domain.
It doesn't support plain http.
%package hook-nestedvt
Summary: Nested Virtualization support for VDSM
BuildArch: noarch
%description hook-nestedvt
If the nested virtualization is enabled in your kvm module
this hook will expose it to the guests.
%package hook-openstacknet
Summary: OpenStack Network vNICs support for VDSM
BuildArch: noarch
%description hook-openstacknet
Hook for OpenStack Network vNICs.
%package hook-qemucmdline
Summary: QEMU cmdline hook for VDSM
BuildArch: noarch
Requires: %{name}
%description hook-qemucmdline
Provides support for injecting QEMU cmdline via VDSM hook.
It exploits libvirt's qemu:commandline facility available in the
qemu xml namespace.
%package hook-scratchpad
Summary: One time disk creation for VDSM
BuildArch: noarch
%description hook-scratchpad
scratchpad hook for VDSM
Hook creates a disk for a VM onetime usage,
the disk will be erased when the VM destroyed.
VM cannot be migrated when using scratchpad hook
%package hook-smbios
Summary: Adding custom smbios entries to libvirt domain via VDSM
BuildArch: noarch
%description hook-smbios
Adding custom smbios entries to libvirt domain via VDSM
such as: vendor, version, date and release
%package hook-spiceoptions
Summary: To configure spice options for vm
BuildArch: noarch
%description hook-spiceoptions
This vdsm hook can be used to configure some of
the spice optimization attributes and values..
%package hook-vmfex-dev
Summary: VM-FEX vNIC support for VDSM
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Conflicts: hook-vmfex
%description hook-vmfex-dev
Allows to use custom device properties to connect a guest vNIC to a host
VM-FEX Virtual Function (SR-IOV with macvtap mode).
%package hook-fcoe
Summary: Hook to enable FCoE support
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: fcoe-utils
%description hook-fcoe
VDSM hook used for configure specified NICs as FCoE interface through custom
network properties
%post hook-fcoe
%systemd_post lldpad.service
%systemd_post fcoe.service
%package hook-cpuflags
Summary: Hook that modifies guest's CPU flags
BuildArch: noarch
%description hook-cpuflags
Hook that modifies guest's CPU flags using custom properties.
%package hook-hostdev-scsi
Summary: Hook to optimize hostdev SCSI devices translating their config.
BuildArch: noarch
%description hook-hostdev-scsi
Hook to optimizet hostdev SCSI generic devices translating their configuration
into more specific one.
%if %{with_gluster_mgmt}
%package gluster
Summary: Gluster Plugin for VDSM
Requires: %{name} = %{version}-%{release}
Requires: glusterfs-server >= %{gluster_version}
Requires: glusterfs-api >= %{gluster_version}
Requires: glusterfs-geo-replication >= %{gluster_version}
Requires: glusterfs-events >= %{gluster_version}
Requires: %{python_or_python3}-magic
Requires: %{python_pyyaml}
%if 0%{?fedora} && %{target_py} == py2
Requires: python2-blivet1 >= 1.20.4-1
%else
Requires: %{python_or_python3}-blivet
%endif
Requires: xfsprogs
%ifarch x86_64
Requires: vdo
Requires: kmod-kvdo
%endif
%description gluster
Gluster plugin enables VDSM to serve Gluster functionalities.
%endif
%prep
%setup -q
%build
%if 0%{?enable_autotools}
autoreconf -if
%endif
%if %{with_ovirt_imageio}
%define enable_ovirt_imageio yes
%else
%define enable_ovirt_imageio no
%endif
%if %{with_ovirt_vmconsole}
%define enable_ovirt_vmconsole yes
%else
%define enable_ovirt_vmconsole no
%endif
%if %{with_gluster_mgmt}
%define enable_gluster_mgmt yes
%else
%define enable_gluster_mgmt no
%endif
%if %{with_hooks}
%define enable_hooks yes
%else
%define enable_hooks no
%endif
%if %{with_vhostmd}
%define enable_vhostmd yes
%else
%define enable_vhostmd no
%endif
%configure --with-qemu-user=%{qemu_user} --with-qemu-group=%{qemu_group} --enable-ovirt-imageio=%{enable_ovirt_imageio} --enable-ovirt-vmconsole=%{enable_ovirt_vmconsole} --enable-gluster-mgmt=%{enable_gluster_mgmt} --enable-hooks=%{enable_hooks} --enable-vhostmd=%{enable_vhostmd} --with-data-center=%{vdsm_repo}
make
%install
make DESTDIR=%{buildroot} install
%if %{target_py} == py3
%py_byte_compile python3 %{buildroot}/%{_datadir}/%{vdsm_name}/sitecustomize.py
%py_byte_compile python3 %{buildroot}/%{_libexecdir}/%{vdsm_name}/hooks/after_device_create/openstacknet_utils.py
%py_byte_compile python3 %{buildroot}/%{_libexecdir}/%{vdsm_name}/hooks/after_device_migrate_destination/openstacknet_utils.py
%py_byte_compile python3 %{buildroot}/%{_libexecdir}/%{vdsm_name}/hooks/after_get_caps/openstacknet_utils.py
%py_byte_compile python3 %{buildroot}/%{_libexecdir}/%{vdsm_name}/hooks/after_get_stats/checkips_utils.py
%py_byte_compile python3 %{buildroot}/%{_libexecdir}/%{vdsm_name}/hooks/after_nic_hotplug/openstacknet_utils.py
%py_byte_compile python3 %{buildroot}/%{_libexecdir}/%{vdsm_name}/hooks/after_vm_start/openstacknet_utils.py
%py_byte_compile python3 %{buildroot}/%{_libexecdir}/%{vdsm_name}/hooks/before_device_create/openstacknet_utils.py
%py_byte_compile python3 %{buildroot}/%{_libexecdir}/%{vdsm_name}/hooks/before_nic_hotplug/openstacknet_utils.py
%py_byte_compile python3 %{buildroot}/%{_libexecdir}/%{vdsm_name}/vm_libvirt_hook.py
%endif
%pre
# Force standard locale behavior (English)
export LC_ALL=C
/usr/bin/getent passwd %{vdsm_user} >/dev/null || \
/usr/sbin/useradd -r -u 36 -g %{vdsm_group} -d /var/lib/vdsm \
-s /sbin/nologin -c "Node Virtualization Manager" %{vdsm_user}
/usr/sbin/usermod -a -G %{qemu_group},%{snlk_group} %{vdsm_user}
/usr/sbin/usermod -a -G %{cdrom_group} %{qemu_user}
# We keep the previous rpm version number in a file for managing upgrade flow
if [ "$1" -gt 1 ]; then
rpm -q %{vdsm_name} > "%{_localstatedir}/lib/%{vdsm_name}/upgraded_version"
# Both vdsm and supervdsm should be managed here and must be restarted if
# ran before the upgrade
if /bin/systemctl status vdsmd >/dev/null 2>&1; then
/usr/bin/touch "%{_localstatedir}/lib/%{vdsm_name}/vdsmd_start_required"
fi
if /bin/systemctl status supervdsmd >/dev/null 2>&1; then
/usr/bin/touch "%{_localstatedir}/lib/%{vdsm_name}/supervdsmd_start_required"
fi
fi
%post
# After vdsm install we should create the logs files.
# In the install session we create it but since we use
# the ghost macro (in files session) the files are not included
touch %{_vdsm_log_dir}/{mom.log,supervdsm.log,vdsm.log}
chmod 0644 %{_vdsm_log_dir}/{mom.log,supervdsm.log,vdsm.log}
chown %{vdsm_user}:%{vdsm_group} %{_vdsm_log_dir}/{mom.log,vdsm.log}
chown root:root %{_vdsm_log_dir}/supervdsm.log
# On CentOS/RHEL we rely on abrt-ccpp addon to generate
# core dumps for us, so we have to disable the systemd's core
# dump generation machinery. Fedoras use newer abrt versions
# which don't have abrt-ccpp anymore.
%if ! 0%{?fedora}
ln -s /dev/null /etc/sysctl.d/50-coredump.conf
%endif
systemd-tmpfiles --create %{vdsm_name}.conf
# Have moved vdsm section in /etc/sysctl.conf to /etc/sysctl.d/vdsm.conf.
# So Remove them if it is played with /etc/sysctl.conf.
if grep -q "# VDSM section begin" /etc/sysctl.conf; then
/bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
/etc/sysctl.conf
fi
# VDSM installs vdsm-modules-load.d.conf file - the following command will
# refresh vdsm kernel modules requirements to start on boot
/bin/systemctl restart systemd-modules-load.service >/dev/null 2>&1 || :
# The following triggers vdsmd.preset file and enables vdsm required services
%systemd_post dev-hugepages1G.mount
%systemd_post vdsmd.service
%systemd_post supervdsmd.service
%systemd_post vdsm-network.service
%systemd_post vdsm-network-init.service
%systemd_post mom-vdsm.service
%systemd_post ksmtuned.service
# VDSM installs unit files - daemon-reload will refresh systemd
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
exit 0
%preun
if [ "$1" -eq 0 ]; then
%{_bindir}/vdsm-tool remove-config
fi
%systemd_preun dev-hugepages1G.mount
%systemd_preun vdsmd.service
%systemd_preun vdsm-network.service
%systemd_preun vdsm-network-init.service
%systemd_preun supervdsmd.service
%systemd_preun mom-vdsm.service
%systemd_preun ksmtuned.service
exit 0
%posttrans
if [ -f "%{_localstatedir}/lib/%{vdsm_name}/upgraded_version" ]; then
# removing temporary files at first to avoid leaving upgrade leftovers
/bin/rm -f "%{_localstatedir}/lib/%{vdsm_name}/upgraded_version"
if [ -f "%{_localstatedir}/lib/%{vdsm_name}/vdsmd_start_required" ]; then
vdsmd_start_required='yes'
/bin/rm -f "%{_localstatedir}/lib/%{vdsm_name}/vdsmd_start_required"
/bin/systemctl stop vdsmd >/dev/null 2>&1 || :
fi
if [ -f "%{_localstatedir}/lib/%{vdsm_name}/supervdsmd_start_required" ]; then
supervdsmd_start_required='yes'
/bin/rm -f "%{_localstatedir}/lib/%{vdsm_name}/supervdsmd_start_required"
/bin/systemctl stop supervdsmd >/dev/null 2>&1 || :
fi
if /bin/systemctl status vdsm-network >/dev/null 2>&1; then
/bin/systemctl stop vdsm-network >/dev/null 2>&1 || :
fi
if ! %{_bindir}/vdsm-tool is-configured >/dev/null 2>&1; then
%{_bindir}/vdsm-tool configure --force >/dev/null 2>&1
fi
if [ "${supervdsmd_start_required}" = 'yes' ]; then
/bin/systemctl start supervdsmd >/dev/null 2>&1 || :
fi
if [ "${vdsmd_start_required}" = 'yes' ]; then
/bin/systemctl start vdsmd >/dev/null 2>&1 || :
fi
fi
exit 0
%files
%doc README.md
%doc lib/vdsm/vdsm.conf.sample
%doc README.logging
%doc ChangeLog
%license COPYING
%{_presetdir}/85-vdsmd.preset
%{_unitdir}/dev-hugepages1G.mount
%{_unitdir}/vdsmd.service
%{_unitdir}/vdsm-network.service
%{_unitdir}/vdsm-network-init.service
%{_unitdir}/supervdsmd.service
%{_unitdir}/mom-vdsm.service
%{_sysconfdir}/systemd/system/libvirtd.service.d/unlimited-core.conf
%dir %attr(-, %{vdsm_user}, %{vdsm_group}) %{vdsm_repo}
%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) %{_vdsm_log_dir}/mom.log
%ghost %config %attr(0644, root, root) %{_vdsm_log_dir}/supervdsm.log
%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) %{_vdsm_log_dir}/vdsm.log
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) %{vdsm_repo}/hsm-tasks
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) %{vdsm_repo}/mnt