forked from oVirt/vdsm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdsm.spec.in
1550 lines (1340 loc) · 55.2 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 @VDSMUSER@
%global vdsm_group @VDSMGROUP@
%global qemu_user @QEMUUSER@
%global qemu_group @QEMUGROUP@
%global snlk_group @SNLKGROUP@
%global snlk_user @SNLKUSER@
%global cdrom_group @CDROMGROUP@
# Features
%global with_gluster_mgmt @GLUSTER_MGMT@
%global with_hooks @HOOKS@
%global with_vhostmd @VHOSTMD@
# Glusterfs package version
%global gluster_version 3.7.1
# 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}
# Skips check since rhel default repos lack pep8 and pyflakes
%if ! 0%{?rhel}
%{!?with_check:%global with_check 1}
%else
%{!?with_check:%global with_check 0}
%endif
# 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 _udevrulesdir /usr/lib/udev/rules.d/
%global _udevexecdir /usr/lib/udev/
Name: %{vdsm_name}
Version: @PACKAGE_VERSION@
Release: @PACKAGE_RELEASE@%{?dist}%{?extra_release}
Summary: Virtual Desktop Server Manager
BuildArch: noarch
Group: Applications/System
License: GPLv2+
Url: http://www.ovirt.org/wiki/Vdsm
Source0: %{vdsm_name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%{!?_licensedir:%global license %%doc}
BuildRequires: cyrus-sasl-lib
BuildRequires: python
BuildRequires: python-devel
BuildRequires: python-netaddr
BuildRequires: python-nose
BuildRequires: python-six >= 1.9.0
BuildRequires: rpm-build
# BuildRequires needed by the tests during the build
BuildRequires: dosfstools
BuildRequires: genisoimage
BuildRequires: libnl3
BuildRequires: libselinux-python
BuildRequires: libvirt-python
BuildRequires: m2crypto
BuildRequires: mom >= 0.4.5
BuildRequires: openssl
BuildRequires: policycoreutils-python
BuildRequires: psmisc
BuildRequires: python-cpopen >= 1.4
BuildRequires: python-inotify
BuildRequires: python-ioprocess >= 0.15.0-4
BuildRequires: python-pthreading
BuildRequires: qemu-img
BuildRequires: rpm-python
BuildRequires: python-blivet
%if "@PYTHON3@" != ""
BuildRequires: python3-nose
BuildRequires: python3-six
%endif
# Autotools BuildRequires
%if 0%{?enable_autotools}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
%endif
%if 0%{?with_check}
BuildRequires: pyflakes
BuildRequires: python-pep8
%endif
BuildRequires: systemd-units
Requires: ethtool
Requires: which
Requires: sudo >= 1.7.3
Requires: logrotate
Requires: xz
Requires: ntp
Requires: iproute >= 3.10.0
Requires: python-netaddr
Requires: python-inotify
Requires: python-argparse
Requires: python-cpopen >= 1.4
Requires: python-ioprocess >= 0.15.0-4
Requires: python-pthreading >= 0.1.3-3
Requires: python-six >= 1.9.0
Requires: python-requests
Requires: %{name}-infra = %{version}-%{release}
Requires: rpm-python
Requires: nfs-utils
Requires: m2crypto
Requires: libnl3
Requires: curl
Requires: %{name}-xmlrpc = %{version}-%{release}
Requires: %{name}-jsonrpc = %{version}-%{release}
%if 0%{?fedora} >= 23
Requires: safelease >= 1.0-6
%else
Requires: safelease >= 1.0-5
%endif
Requires: mom >= 0.4.5
Requires: ovirt-vmconsole >= 1.0.0-0
%if 0%{?rhel}
Requires: libguestfs-tools-c >= 1:1.20.11-10
%else # fedora
Requires: libguestfs-tools-c >= 1:1.26.7-2
%endif
Requires: libvirt-daemon-config-nwfilter
Requires: libvirt-daemon-driver-network
Requires: libvirt-daemon-driver-nwfilter
Requires: libvirt-daemon-driver-qemu
%if 0%{?rhel}
Requires: libvirt-daemon >= 1.2.17-9
Requires: libvirt-python >= 1.2.17-2
%endif # rhel
%if 0%{?fedora} >= 23
Requires: libvirt-daemon >= 1.2.18.1-1
Requires: libvirt-python >= 1.2.18-1
%endif
%if 0%{?fedora} == 22
Requires: libvirt-daemon >= 1.2.13
Requires: libvirt-python >= 1.2.9-2
%endif
Requires: libvirt-lock-sanlock, libvirt-client
# iscsi-intiator versions
%if 0%{?rhel}
Requires: iscsi-initiator-utils
%else # fedora
Requires: iscsi-initiator-utils >= 6.2.0.873-21
%endif
Requires: sanlock >= 2.8-2, sanlock-python
# device-mapper-multipath
%if 0%{?rhel}
Requires: device-mapper-multipath >= 0.4.9-84.el7
%endif #rhel
%if 0%{?fedora} == 22
Requires: device-mapper-multipath >= 0.4.9-73.fc22.2
%endif
%if 0%{?fedora} >= 23
Requires: device-mapper-multipath >= 0.4.9-80.fc23
%endif
%if 0%{?rhel}
Requires: e2fsprogs
Requires: fence-agents-all
%if 0%{?centos}
Requires: kernel >= 3.10.0-132.el7
%else
Requires: kernel >= 3.10.0-229.17.1.el7
%endif
%if 0%{?centos}
# TODO: Remove when lvm2 2.02.130 is available
Requires: lvm2 >= 2.02.107
%else
Requires: lvm2 >= 2.02.130-2
%endif
Requires: python >= 2.7.5-18.el7_1.1
Requires: policycoreutils-python
Requires: selinux-policy-targeted >= 3.13.1-16.el7
Requires: systemd >= 219-11.el7
%else
Requires: fence-agents-all
Requires: kernel >= 4.1.6
# Subprocess and thread bug was found on python 2.7.2
Requires: python >= 2.7.3
Requires: initscripts >= 9.42.2-1
Requires: e2fsprogs >= 1.41.14
%if 0%{?fedora} >= 23
Requires: policycoreutils-python-utils
%endif # fedora 23
Requires: policycoreutils-python
Requires: sed >= 4.2.1-10
Requires: ed
Requires: lvm2 >= 2.02.107
Requires: selinux-policy-targeted >= 3.12.1-177
# 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
Requires: systemd >= 209
%endif
%if 0%{?rhel}
Requires: qemu-kvm-rhev >= 10:2.3.0-31.el7_2.4
Requires: qemu-img-rhev >= 10:2.3.0-31.el7_2.4
%else
Requires: qemu-kvm >= 2:2.3.0
Requires: qemu-img >= 2:2.3.0
%endif # rhel
# GlusterFS client-side RPMs needed for Gluster SD
%if 0%{?with_gluster_mgmt}
Requires: glusterfs-cli >= %{gluster_version}
Requires: glusterfs-fuse >= %{gluster_version}
%endif
Requires: psmisc >= 22.6-15
Requires: bridge-utils
Requires: sos
Requires: tree
Requires: dosfstools
Requires: genisoimage
Requires: libselinux-python
Requires: %{name}-python = %{version}-%{release}
Requires: pyparted
Requires: %{name}-hook-vmfex-dev = %{version}-%{release}
Requires(post): /usr/sbin/saslpasswd2
%if 0%{?fedora}
Requires(post): hostname
%else
Requires(post): /bin/hostname
%endif
Conflicts: vdsm-hook-sriov
%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 cli
Summary: VDSM command line interface
Requires: %{name}-python = %{version}-%{release}
Requires: %{name}-xmlrpc = %{version}-%{release}
%description cli
Call VDSM commands from the command line. Used for testing and debugging.
%package xmlrpc
Summary: VDSM xmlrpc API
Requires: %{name}-python = %{version}-%{release}
%description xmlrpc
An XMLRPC interface for interacting with vdsmd. Primary control interface for
ovirt-engine and vdsClient.
%package api
Summary: VDSM API
%description api
Contains api schema files
%package jsonrpc
Summary: VDSM API Server
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
Requires: python >= 2.6
%description yajsonrpc
A JSON RPC server and client implementation.
%package infra
Summary: Utilities and libraries for vdsm
Requires: python >= 2.6
Obsoletes: %{name}-python-zombiereaper
%description infra
Utilities and libraries for vdsm.
%package reg
Summary: VDSM registration package
Requires: %{name} = %{version}-%{release}
Requires: m2crypto
Requires: openssl
Conflicts: ovirt-node < 3.0.4
%description reg
VDSM registration package. Used to register a Linux host to a Virtualization
Manager.
%package python
Summary: VDSM python libraries
Requires: %{name}-api = %{version}-%{release}
Requires: %{name}-infra = %{version}-%{release}
Requires: python-cpopen >= 1.4
Requires: m2crypto
Requires: python-ioprocess >= 0.15.0-4
%description python
Shared libraries between the various VDSM packages.
%post python
# REQUIRED_FOR: Upgrade from 4.14 to 4.17
# HACK: Remove vdsm python lib __init__ file if installed on old location
# https://bugzilla.redhat.com/show_bug.cgi?id=1279167
if [ "$1" -ge 2 ]; then
if [ -d "%{python2_sitearch}/%{vdsm_name}" ]; then
logger -t '%{vdsm_name}' \
'Disabling old vdsm package in %{python2_sitearch}/%{vdsm_name}.' \
'Removing %{python2_sitearch}/%{vdsm_name}/init.py*'
rm -f %{python2_sitearch}/%{vdsm_name}/__init__.py*
fi
fi
%package tests
Summary: VDSM Test Suite
Requires: %{name} = %{version}-%{release}
Requires: dracut
Requires: python-nose
%description tests
A test suite for verifying the functionality of a running vdsm instance
%package hook-allocate_net
Summary: random_network allocation hook for VDSM
Requires: %{name}
%description hook-allocate_net
VDSM hook used to allocate networks for vms in a random fashion
%package hook-checkimages
Summary: Qcow2 disk image format check hook for VDSM
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-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
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 0%{?with_vhostmd}
%package hook-vhostmd
Summary: VDSM hook set for interaction with vhostmd
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
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-macbind
Summary: Bind a vNIC to a Bridge
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-macspoof
Summary: Disables MAC spoofing filtering
%description hook-macspoof
VDSM hooks which allow to disable mac spoof filtering
either on all the of the VM's interfaces or on
specific vnics.
%package hook-noipspoof
Summary: Enables strict anti-spoofing filtering
%description hook-noipspoof
VDSM hook which allows to enable strict anti-spoofing filtering
on all of the the VM's interfaces.
%package hook-extnet
Summary: Force a vNIC to connect to a specific libvirt network
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
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-fakesriov
Summary: Generate fake SR-IOV devices
Requires: %{name}
%description hook-fakesriov
Hook intercepts reported host device by hostdevListByCaps and adds
1 fake sriov devices and 2 fake virtual function devices
To enable this hook on your host, set vars.fake_sriov_enable=true in your
/etc/vdsm/vdsm.conf.
%package hook-fileinject
Summary: Allow uploading file to VMs disk
Requires: python-libguestfs
%description hook-fileinject
Hook is getting target file name and its content and
create that file in target machine.
%package hook-floppy
Summary: Allow adding floppy to VM
%description hook-floppy
Allow adding floppy to VM
%package hook-hostusb
Summary: Allow attaching USB device from host
Requires: usbutils
%description hook-hostusb
Hook is getting vendor and product id of USB device
disconnect it from host and attach it to VM
%package hook-httpsisoboot
Summary: Allow directly booting from an https available ISO
BuildArch: noarch
%if 0%{?rhel}
Requires: qemu-kvm-rhev >= 10:2.1.2-3
%endif
%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-hugepages
Summary: Huge pages enable user to handle VM with 2048KB page files.
%description hook-hugepages
Hook is getting number of huge pages reserve them for the VM,
and enable user to handle VM with 2048KB page files.
%package hook-isolatedprivatevlan
Summary: Isolated network environment for VMs
%description hook-isolatedprivatevlan
limit VM traffic to a specific gateway by its mac address,
hook prevent VM from spoofing its mac or ip address
by using <filterref filter='clean-traffic'/> libvirt filter
and by adding custom filter: isolatedprivatevlan-vdsm.xml
%package hook-nestedvt
Summary: Nested Virtualization support for VDSM
%description hook-nestedvt
If the nested virtualization is enabled in your kvm module
this hook will expose it to the guests.
%package hook-numa
Summary: NUMA support for VDSM
%description hook-numa
Hooks is getting number/rage of NUMA nodes and NUMA mode,
and update the VM xml.
%package hook-openstacknet
Summary: OpenStack Network vNICs support for VDSM
%description hook-openstacknet
Hook for OpenStack Network vNICs.
%package hook-ovs
Summary: Open vSwitch support for VDSM
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: openvswitch >= 2.0.0
%description hook-ovs
Hook for Open vSwitch support.
%package hook-pincpu
Summary: Hook pin VM so specific CPUs
%description hook-pincpu
pincpu is hook for VDSM.
pincpu enable to pin virtual machine to a specific CPUs.
%package hook-promisc
Summary: Network interface promiscuous mode support for VDSM
%description hook-promisc
VDSM promiscuous mode let user define a VM interface that will capture
all network traffic.
%package hook-qemucmdline
Summary: QEMU cmdline hook for VDSM
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-qos
Summary: QoS network in/out traffic support for VDSM
%description hook-qos
Hook adds QoS in/out traffic to VMs interfaces
%package hook-scratchpad
Summary: One time disk creation for VDSM
%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
%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
%description hook-spiceoptions
This vdsm hook can be used to configure some of
the spice optimization attributes and values..
%package hook-vmfex
Summary: vmfex support for VDSM
Conflicts: hook-vmfex-dev
%description hook-vmfex
Hook for vmfex.
%package hook-vmfex-dev
Summary: VM-FEX vNIC support for VDSM
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-vmdisk
Summary: External disk support for VDSM
%description hook-vmdisk
Hook adds additional disk image for a VM (raw or qcow2)
%package hook-ipv6
Summary: Set IPv6 configuration through custom network properties
Requires: %{name} >= 4.16.7
%description hook-ipv6
VDSM hook used for applying IPv6 configuration through custom network
properties
%if 0%{?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: python-magic
Requires: python-blivet
Requires: xfsprogs
%description gluster
Gluster plugin enables VDSM to serve Gluster functionalities.
%endif
%prep
%setup -q
%build
%if 0%{?enable_autotools}
autoreconf -if
%endif
%configure \
%if 0%{?with_hooks}
--enable-hooks \
%endif
%if ! 0%{?with_gluster_mgmt}
--disable-gluster-mgmt \
%endif
--with-smbios-manufacturer='@SMBIOS_MANUFACTURER@' \
--with-smbios-osname='@SMBIOS_OSNAME@' \
--with-qemu-kvm='@QEMU_KVM_PKG@' \
--with-qemu-img='@QEMU_IMG_PKG@'
make
# Setting software_version and software_revision in dsaversion.py
baserelease=`echo "%{release}" | sed 's/\([0-9]\+\(\.[0-9]\+\)\?\).*/\1/'`
baseversion=`echo "%{version}" | sed 's/\([0-9]\+\(\.[0-9]\+\)\?\).*/\1/'`
rawversion=%{version}-%{release}
sed -i -e 's/^software_version =.*/software_version = "'"${baseversion}"'"/' \
-e 's/^raw_version_revision =.*/raw_version_revision = "'"${rawversion}"'"/' \
-e 's/^software_revision =.*/software_revision = "'"${baserelease}"'"/' lib/vdsm/dsaversion.py
sed -i -e 's/@SSL_IMPLEMENTATION@/m2c/g' lib/vdsm/config.py
%install
rm -rf %{buildroot}
make DESTDIR=%{buildroot} install
# Creating VDSM logs in this session to avoid rpmbuild
# complain during the build
install -dDm 0755 %{buildroot}@VDSMLOGDIR@
touch %{buildroot}@VDSMLOGDIR@/{connectivity.log,mom.log,supervdsm.log,vdsm.log}
# Install the lvm rules
install -Dm 0644 vdsm/storage/vdsm-lvm.rules \
%{buildroot}%{_udevrulesdir}/12-vdsm-lvm.rules
install -Dm 0644 vdsm/limits.conf \
%{buildroot}/etc/security/limits.d/99-vdsm.conf
install -Dm 0755 init/systemd/systemd-vdsmd %{buildroot}/usr/lib/systemd/systemd-vdsmd
install -Dm 0644 init/systemd/85-vdsmd.preset %{buildroot}/usr/lib/systemd/system-preset/85-vdsmd.preset
install -Dm 0644 init/systemd/vdsmd.service %{buildroot}%{_unitdir}/vdsmd.service
install -Dm 0644 init/systemd/vdsm-network.service %{buildroot}%{_unitdir}/vdsm-network.service
install -Dm 0644 init/systemd/supervdsmd.service %{buildroot}%{_unitdir}/supervdsmd.service
install -Dm 0644 init/systemd/mom-vdsm.service %{buildroot}%{_unitdir}/mom-vdsm.service
install -Dm 0644 vdsm/vdsm-modules-load.d.conf \
%{buildroot}%{_sysconfdir}/modules-load.d/vdsm.conf
install -Dm 0644 init/systemd/vdsm-tmpfiles.d.conf \
%{buildroot}%{_tmpfilesdir}/%{vdsm_name}.conf
install -Dm 0644 init/systemd/unlimited-core.conf \
%{buildroot}%{_sysconfdir}/systemd/system/libvirtd.service.d/unlimited-core.conf
%if 0%{?rhel}
# This is not commonplace, but we want /var/log/core to be a world-writable
# dropbox for core dumps
install -dDm 1777 %{buildroot}%{_localstatedir}/log/core
%endif
# Install the polkit for libvirt
install -Dm 0644 vdsm/vdsm-libvirt-access.rules \
%{buildroot}%{_polkitdir}/10-vdsm-libvirt-access.rules
# Install the libvirt hook for cleaning up the XML
install -Dm 0755 vdsm/virt/libvirt-hook.sh \
%{buildroot}%{_sysconfdir}/libvirt/hooks/qemu
%check
%if 0%{?with_check}
make check
%endif
%clean
rm -rf %{buildroot}
%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
# in vdsmd_init_script upgraded_version_check task
if [ "$1" -gt 1 ]; then
rpm -q %{vdsm_name} > "%{_localstatedir}/lib/%{vdsm_name}/upgraded_version"
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 @VDSMLOGDIR@/{connectivity.log,mom.log,supervdsm.log,vdsm.log}
chmod 0644 @VDSMLOGDIR@/{connectivity.log,mom.log,supervdsm.log,vdsm.log}
chown @VDSMUSER@:@VDSMGROUP@ @VDSMLOGDIR@/{connectivity.log,mom.log,vdsm.log}
chown root:root @VDSMLOGDIR@/supervdsm.log
# 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
# hack until we replace core dump with abrt
if /usr/sbin/selinuxenabled; then
/usr/sbin/semanage fcontext -a -t virt_cache_t '/var/log/core(/.*)?'
fi
/sbin/restorecon -R /var/log/core >/dev/null 2>&1
# hack until we replace core dump with abrt
# 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 vdsmd.service
%systemd_post supervdsmd.service
%systemd_post vdsm-network.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 vdsmd.service
%systemd_preun vdsm-network.service
%systemd_preun supervdsmd.service
%systemd_preun mom-vdsm.service
%systemd_preun ksmtuned.service
exit 0
%postun
if [ "$1" -ge 1 ]; then
supervdsmd_start_required='no'
vdsmd_start_required='no'
# Both vdsm and supervdsm should be managed here and must be restarted if
# ran before (code might changed)
if %{_bindir}/vdsm-tool service-status vdsmd >/dev/null 2>&1; then
%{_bindir}/vdsm-tool service-stop vdsmd >/dev/null 2>&1 || :
vdsmd_start_required='yes'
fi
if %{_bindir}/vdsm-tool service-status supervdsmd >/dev/null 2>&1; then
%{_bindir}/vdsm-tool service-stop supervdsmd >/dev/null 2>&1 || :
supervdsmd_start_required='yes'
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
%{_bindir}/vdsm-tool service-start supervdsmd >/dev/null 2>&1 || :
fi
if [ "${vdsmd_start_required}" = 'yes' ]; then
%{_bindir}/vdsm-tool service-start vdsmd >/dev/null 2>&1 || :
fi
fi
exit 0
%files
%defattr(-, root, root, -)
%doc README lib/vdsm/vdsm.conf.sample
%license COPYING
/usr/lib/systemd/systemd-vdsmd
/usr/lib/systemd/system-preset/85-vdsmd.preset
%{_unitdir}/vdsmd.service
%{_unitdir}/vdsm-network.service
%{_unitdir}/supervdsmd.service
%{_unitdir}/mom-vdsm.service
%{_sysconfdir}/systemd/system/libvirtd.service.d/unlimited-core.conf
%dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/connectivity.log
%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/mom.log
%ghost %config %attr(0644, root, root) @VDSMLOGDIR@/supervdsm.log
%ghost %config %attr(0644, %{vdsm_user}, %{vdsm_group}) @VDSMLOGDIR@/vdsm.log
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/hsm-tasks
%ghost %dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@/mnt
%dir %{_libexecdir}/%{vdsm_name}
%dir %{_sysconfdir}/%{vdsm_name}
%dir %{_sysconfdir}/%{vdsm_name}/mom.d
%dir %{_datadir}/%{vdsm_name}
%dir %{_datadir}/%{vdsm_name}/supervdsm_api
%dir %{_datadir}/%{vdsm_name}/storage
%dir %{_datadir}/%{vdsm_name}/storage/imageRepository
%dir %{_datadir}/%{vdsm_name}/virt
%dir %{_datadir}/%{vdsm_name}/virt/vmdevices
%dir %{_datadir}/%{vdsm_name}/rpc
%{_datadir}/%{vdsm_name}/alignmentScan.py*
%{_datadir}/%{vdsm_name}/blkid.py*
%{_datadir}/%{vdsm_name}/caps.py*
%{_datadir}/%{vdsm_name}/clientIF.py*
%{_datadir}/%{vdsm_name}/daemonAdapter
%{_datadir}/%{vdsm_name}/API.py*
%{_datadir}/%{vdsm_name}/hooking.py*
%{_datadir}/%{vdsm_name}/hostdev.py*
%{_datadir}/%{vdsm_name}/mk_sysprep_floppy
%{_datadir}/%{vdsm_name}/parted_utils.py*
%{_datadir}/%{vdsm_name}/mkimage.py*
%{_datadir}/%{vdsm_name}/numaUtils.py*
%{_datadir}/%{vdsm_name}/protocoldetector.py*
%{_datadir}/%{vdsm_name}/sitecustomize.py*
%{_datadir}/%{vdsm_name}/supervdsmServer
%{_datadir}/%{vdsm_name}/vdsm
%{_datadir}/%{vdsm_name}/vdsm-restore-net-config
%{_datadir}/%{vdsm_name}/vdsm-store-net-config
%{_datadir}/%{vdsm_name}/virt/__init__.py*
%{_datadir}/%{vdsm_name}/virt/domain_descriptor.py*
%{_datadir}/%{vdsm_name}/virt/guestagent.py*
%{_datadir}/%{vdsm_name}/virt/hoststats.py*
%{_datadir}/%{vdsm_name}/virt/migration.py*
%{_datadir}/%{vdsm_name}/virt/periodic.py*
%{_datadir}/%{vdsm_name}/virt/recovery.py*
%{_datadir}/%{vdsm_name}/virt/sampling.py*
%{_datadir}/%{vdsm_name}/virt/secret.py*
%{_datadir}/%{vdsm_name}/virt/virdomain.py*
%{_datadir}/%{vdsm_name}/virt/vmchannels.py*
%{_datadir}/%{vdsm_name}/virt/vmstats.py*
%{_datadir}/%{vdsm_name}/virt/vmstatus.py*
%{_datadir}/%{vdsm_name}/virt/vmtune.py*
%{_datadir}/%{vdsm_name}/virt/vm.py*
%{_datadir}/%{vdsm_name}/virt/vmexitreason.py*
%{_datadir}/%{vdsm_name}/virt/vmpowerdown.py*
%{_datadir}/%{vdsm_name}/virt/vmxml.py*
%{_datadir}/%{vdsm_name}/virt/utils.py*
%{_datadir}/%{vdsm_name}/virt/vmdevices/__init__.py*
%{_datadir}/%{vdsm_name}/virt/vmdevices/core.py*
%{_datadir}/%{vdsm_name}/virt/vmdevices/graphics.py*
%{_datadir}/%{vdsm_name}/virt/vmdevices/hostdevice.py*
%{_datadir}/%{vdsm_name}/virt/vmdevices/hwclass.py*
%{_datadir}/%{vdsm_name}/virt/vmdevices/network.py*
%{_datadir}/%{vdsm_name}/virt/vmdevices/storage.py*
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/vdsm.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/logger.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/svdsm.logger.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.d/*.policy
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/logrotate/vdsm
%config(noreplace) %{_sysconfdir}/rwtab.d/vdsm
%config(noreplace) %{_sysconfdir}/sysctl.d/vdsm.conf
%config(noreplace) %{_sysconfdir}/modules-load.d/vdsm.conf
%config(noreplace) %{_tmpfilesdir}/%{vdsm_name}.conf
%{_sysconfdir}/dhcp/dhclient.d/sourceRoute.sh
%{_sysconfdir}/sudoers.d/50_vdsm
%{_sysconfdir}/cron.hourly/vdsm-logrotate
%{_sysconfdir}/libvirt/hooks/qemu
%{_datadir}/%{vdsm_name}/logUtils.py*
%{_libexecdir}/%{vdsm_name}/curl-img-wrap
%{_libexecdir}/%{vdsm_name}/fc-scan
%{_libexecdir}/%{vdsm_name}/persist-vdsm-hooks
%{_libexecdir}/%{vdsm_name}/unpersist-vdsm-hook
%{_libexecdir}/%{vdsm_name}/ovirt_functions.sh
%{_libexecdir}/%{vdsm_name}/vdsm-gencerts.sh
%{_libexecdir}/%{vdsm_name}/vdsmd_init_common.sh
%{_libexecdir}/%{vdsm_name}/wait_for_ipv4s
%{_datadir}/%{vdsm_name}/supervdsm_api/__init__.py*
%{_datadir}/%{vdsm_name}/supervdsm_api/hwinfo.py*
%{_datadir}/%{vdsm_name}/supervdsm_api/network.py*
%{_datadir}/%{vdsm_name}/storage/__init__.py*
%{_datadir}/%{vdsm_name}/storage/blockSD.py*
%{_datadir}/%{vdsm_name}/storage/blockVolume.py*
%{_datadir}/%{vdsm_name}/storage/constants.py*
%{_datadir}/%{vdsm_name}/storage/curlImgWrap.py*
%{_datadir}/%{vdsm_name}/storage/devicemapper.py*
%{_datadir}/%{vdsm_name}/storage/dispatcher.py*
%{_datadir}/%{vdsm_name}/storage/monitor.py*
%{_datadir}/%{vdsm_name}/storage/fileSD.py*
%{_datadir}/%{vdsm_name}/storage/fileUtils.py*
%{_datadir}/%{vdsm_name}/storage/fileVolume.py*
%{_datadir}/%{vdsm_name}/storage/fuser.py*
%{_datadir}/%{vdsm_name}/storage/imagetickets.py*
%{_datadir}/%{vdsm_name}/storage/glusterSD.py*
%{_datadir}/%{vdsm_name}/storage/glusterVolume.py*
%{_datadir}/%{vdsm_name}/storage/hba.py*
%{_datadir}/%{vdsm_name}/storage/hsm.py*
%{_datadir}/%{vdsm_name}/storage/image.py*
%{_datadir}/%{vdsm_name}/storage/imageSharing.py*
%{_datadir}/%{vdsm_name}/storage/iscsiadm.py*
%{_datadir}/%{vdsm_name}/storage/iscsi.py*
%{_datadir}/%{vdsm_name}/storage/localFsSD.py*
%{_datadir}/%{vdsm_name}/storage/lvm.env
%{_datadir}/%{vdsm_name}/storage/lvm.py*
%{_datadir}/%{vdsm_name}/storage/misc.py*
%{_datadir}/%{vdsm_name}/storage/mount.py*
%{_datadir}/%{vdsm_name}/storage/multipath.py*
%{_datadir}/%{vdsm_name}/storage/nfsSD.py*
%{_datadir}/%{vdsm_name}/storage/outOfProcess.py*
%{_datadir}/%{vdsm_name}/storage/persistentDict.py*
%{_datadir}/%{vdsm_name}/storage/resourceFactories.py*
%{_datadir}/%{vdsm_name}/storage/remoteFileHandler.py*
%{_datadir}/%{vdsm_name}/storage/resourceManager.py*
%{_datadir}/%{vdsm_name}/storage/clusterlock.py*
%{_datadir}/%{vdsm_name}/storage/sdc.py*
%{_datadir}/%{vdsm_name}/storage/sd.py*
%{_datadir}/%{vdsm_name}/storage/securable.py*
%{_datadir}/%{vdsm_name}/storage/sp.py*
%{_datadir}/%{vdsm_name}/storage/spbackends.py*
%{_datadir}/%{vdsm_name}/storage/storage_exception.py*
%{_datadir}/%{vdsm_name}/storage/storage_mailbox.py*
%{_datadir}/%{vdsm_name}/storage/storageServer.py*
%{_datadir}/%{vdsm_name}/storage/sync.py*
%{_datadir}/%{vdsm_name}/storage/taskManager.py*
%{_datadir}/%{vdsm_name}/storage/task.py*
%{_datadir}/%{vdsm_name}/storage/threadLocal.py*
%{_datadir}/%{vdsm_name}/storage/threadPool.py*
%{_datadir}/%{vdsm_name}/storage/volume.py*
%{_datadir}/%{vdsm_name}/storage/imageRepository/__init__.py*
%{_datadir}/%{vdsm_name}/storage/imageRepository/formatConverter.py*
%{_libexecdir}/%{vdsm_name}/spmprotect.sh
%{_libexecdir}/%{vdsm_name}/spmstop.sh
%dir %{_libexecdir}/%{vdsm_name}/hooks
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_device_create
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_device_create
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_device_destroy
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_device_destroy
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_start
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_start
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_cont
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_cont
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_pause
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_pause
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_hibernate
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_hibernate
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_dehibernate
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_dehibernate
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_device_migrate_source
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_device_migrate_source
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_device_migrate_destination
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_device_migrate_destination
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_migrate_source
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_migrate_source
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_migrate_destination
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_migrate_destination
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_destroy
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_destroy
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_vm_set_ticket
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_vm_set_ticket
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_update_device
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_update_device
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_update_device_fail
%dir %{_libexecdir}/%{vdsm_name}/hooks/before_nic_hotplug
%dir %{_libexecdir}/%{vdsm_name}/hooks/after_nic_hotplug