forked from oVirt/vdsm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vdsm.spec.in
1498 lines (1296 loc) · 49.1 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
%global vdsm_bootstrap vdsm-bootstrap
%global vdsm_reg vdsm-reg
# 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@
# Fedora official build
%global fedora_koji_build 0
# 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:%define enable_autotools 0}
# Skips check since rhel default repos lack pep8 and pyflakes
%if ! 0%{?rhel}
%global with_check 1
%endif
# Required paths
%if 0%{?fedora} >= 18
%global _polkitdir %{_datadir}/polkit-1/rules.d
%else
%global _polkitdir %{_localstatedir}/lib/polkit-1/localauthority/10-vendor.d
%endif
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 6
%global with_gluster 1
%endif
%if ! 0%{?rhel}
%global with_vhostmd 1
%endif
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
%global with_systemd 1
%endif
%if 0%{?fedora} >= 18
%global with_systemd_macros 1
%global with_tmpfiles_macro 1
%endif
Name: %{vdsm_name}
Version: @PACKAGE_VERSION@
Release: @PACKAGE_RELEASE@%{?dist}%{?extra_release}
Summary: Virtual Desktop Server Manager
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)
BuildRequires: gcc
BuildRequires: python
BuildRequires: python-devel
BuildRequires: python-nose
BuildRequires: python-netaddr
BuildRequires: rpm-build
BuildRequires: cyrus-sasl-lib
# BuildRequires needed by the tests during the build
BuildRequires: dosfstools
BuildRequires: psmisc
BuildRequires: python-ethtool
BuildRequires: python-inotify
BuildRequires: python-pthreading
BuildRequires: python-cpopen >= 1.3
BuildRequires: python-ioprocess >= 0.5-1
BuildRequires: rpm-python
BuildRequires: libnl
BuildRequires: libselinux-python
BuildRequires: libvirt-python
BuildRequires: genisoimage
BuildRequires: openssl
BuildRequires: m2crypto
%ifarch x86_64
BuildRequires: python-dmidecode
%endif
%if 0%{?rhel} == 6
BuildRequires: python-argparse
BuildRequires: python-ordereddict
%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
%if 0%{?with_systemd}
BuildRequires: systemd-units
%endif
Requires: ethtool
Requires: which
Requires: sudo >= 1.7.3
Requires: logrotate
Requires: xz
Requires: ntp
Requires: iproute
Requires: python-netaddr
Requires: python-inotify
Requires: python-argparse
Requires: python-cpopen >= 1.3
Requires: python-ioprocess >= 0.5-1
Requires: python-ethtool >= 0.6-3
Requires: %{name}-python-zombiereaper = %{version}-%{release}
Requires: rpm-python
Requires: nfs-utils
Requires: m2crypto
Requires: libguestfs-tools-c
Requires: libnl
Requires: %{name}-xmlrpc = %{version}-%{release}
Requires: %{name}-jsonrpc = %{version}-%{release}
Requires: mom >= 0.4.1
Requires: numactl
%ifarch x86_64
Requires: python-dmidecode
Requires: dmidecode
%endif
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 18
Requires: libvirt-daemon >= 1.0.2-1
Requires: libvirt-daemon-config-nwfilter
Requires: libvirt-daemon-driver-network
Requires: libvirt-daemon-driver-nwfilter
Requires: libvirt-daemon-driver-qemu
%else
%if 0%{?rhel}
Requires: libvirt >= 0.10.2-29.el6_5.4
%else
Requires: libvirt >= 1.0.2-1
%endif
%endif
Requires: libvirt-python, libvirt-lock-sanlock, libvirt-client
# iscsi-intiator versions
%if 0%{?rhel}
%if 0%{?rhel} >= 7
Requires: iscsi-initiator-utils
%else
Requires: iscsi-initiator-utils >= 6.2.0.872-15
%endif # rhel 7
%else # fedora
Requires: iscsi-initiator-utils >= 6.2.0.873-21
%endif
Requires: sanlock >= 2.8, sanlock-python
%if 0%{?rhel}
Requires: python-ethtool >= 0.6-3
%if 0%{?rhel} >= 7
ExclusiveArch: x86_64
Requires: device-mapper-multipath
Requires: e2fsprogs
Requires: fence-agents-all
Requires: lvm2
Requires: python
Requires: policycoreutils-python
Requires: python-pthreading >= 0.1.2
Requires: qemu-kvm
Requires: qemu-img
Requires: selinux-policy-targeted
%else
Requires: python
# Update the qemu-kvm requires when block_stream will be included
Requires: qemu-kvm >= 2:0.12.1.2-2.295.el6_3.4
Requires: qemu-img >= 2:0.12.1.2-2.295.el6_3.4
Requires: device-mapper-multipath >= 0.4.9-52
Requires: e2fsprogs >= 1.41.12-11
Requires: fence-agents
Requires: kernel >= 2.6.32-279.9.1
Requires: initscripts >= 9.03.31-2.el6_3.1
Requires: policycoreutils >= 2.0.83-19.30
Requires: policycoreutils-python >= 2.0.83-19.30
Requires: python-pthreading
Requires: selinux-policy-targeted >= 3.7.19-195.el6_4.13
Requires: lvm2 >= 2.02.100-5
Requires: logrotate < 3.8.0
%endif
%else
Requires: python-pthreading >= 0.1.2
Requires: fence-agents-all
Requires: kernel >= 3.11.3-201
# Subprocess and thread bug was found on python 2.7.2
Requires: python >= 2.7.3
Requires: qemu-kvm >= 2:0.15.0-4
Requires: qemu-img >= 2:0.15.0-4
Requires: python-ethtool >= 0.8-1
Requires: initscripts >= 9.42.2-1
Requires: device-mapper-multipath >= 0.4.9-18
Requires: e2fsprogs >= 1.41.14
Requires: policycoreutils-python
Requires: sed >= 4.2.1-10
Requires: ed
Requires: lvm2 >= 2.02.98-15
Requires: selinux-policy-targeted >= 3.12.1-71
# 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 >= 197-1.fc18.2
%endif
# GlusterFS client-side RPMs needed for Gluster SD
%if 0%{?with_gluster}
Requires: glusterfs >= 3.4.2
Requires: glusterfs-cli
Requires: glusterfs-api
Requires: glusterfs-fuse
Requires: glusterfs-rdma
%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(post): /usr/sbin/saslpasswd2
%if 0%{?fedora} && 0%{?fedora} >= 21
Requires(post): hostname
%else
Requires(post): /bin/hostname
%endif
Requires(post): policycoreutils-python
Requires(preun): policycoreutils-python
%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
BuildArch: noarch
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
BuildArch: noarch
Requires: %{name}-python = %{version}-%{release}
%description xmlrpc
An XMLRPC interface for interacting with vdsmd. Primary control interface for
ovirt-engine and vdsClient.
%package jsonrpc
Summary: VDSM API Server
BuildArch: noarch
Requires: %{name}-python = %{version}-%{release}
Requires: %{name}-yajsonrpc = %{version}-%{release}
%if 0%{?rhel} == 6
Requires: python-ordereddict
%endif
%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
Requires: python >= 2.6
%description yajsonrpc
A JSON RPC server and client implementation.
%package python-zombiereaper
Summary: Collects zombie processes automatically
BuildArch: noarch
Requires: python >= 2.6
%description python-zombiereaper
Collects zombie processes automatically so you don't have to
%package bootstrap
Summary: VDSM bootstrapping package
BuildArch: noarch
%description bootstrap
VDSM bootstrapping package. Used for delivering the bootstrap code onto the
Virtualization Manager.
%package reg
Summary: VDSM registration package
BuildArch: noarch
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}-python-zombiereaper = %{version}-%{release}
Requires: python-cpopen >= 1.2.3-5
Requires: m2crypto
Requires: python-ioprocess >= 0.5-1
%description python
Shared libraries between the various VDSM packages.
%package debug-plugin
Summary: VDSM Debug Plugin
Requires: %{name}
Requires: %{name}-xmlrpc = %{version}-%{release}
BuildArch: noarch
%description debug-plugin
Used by the trained monkeys at Red Hat to insert chaos and mayhem in to VDSM.
%package tests
Summary: VDSM Test Suite
Requires: %{name} = %{version}-%{release}
Requires: dracut
Requires: python-nose
BuildArch: noarch
%description tests
A test suite for verifying the functionality of a running vdsm instance
%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-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
%if 0%{?with_vhostmd}
%package hook-vhostmd
Summary: VDSM hook set for interaction with vhostmd
Requires: vhostmd
BuildArch: noarch
%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-directlun
Summary: Direct LUN support for VDSM
BuildArch: noarch
%description hook-directlun
VDSM hook enable user to add storage LUN for VDSM
without the sharing and storage handling of VDSM.
%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-macspoof
Summary: Disables MAC spoofing filtering
BuildArch: noarch
%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-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.
%package hook-fileinject
Summary: Allow uploading file to VMs disk
BuildArch: noarch
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
BuildArch: noarch
%description hook-floppy
Allow adding floppy to VM
%package hook-hostusb
Summary: Allow attaching USB device from host
BuildArch: noarch
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-hugepages
Summary: Huge pages enable user to handle VM with 2048KB page files.
BuildArch: noarch
%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
BuildArch: noarch
%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
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-numa
Summary: NUMA support for VDSM
BuildArch: noarch
%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
BuildArch: noarch
%description hook-openstacknet
Hook for OpenStack Network vNICs.
%package hook-pincpu
Summary: Hook pin VM so specific CPUs
BuildArch: noarch
%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
BuildArch: noarch
%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
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-qos
Summary: QoS network in/out traffic support for VDSM
BuildArch: noarch
%description hook-qos
Hook adds QoS in/out traffic to VMs interfaces
%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-sriov
Summary: sr-iov support for VDSM
%if 0%{?rhel} >= 7 || 0%{?fedora} >= 18
Requires: libvirt-daemon-driver-nodedev
%endif
BuildArch: noarch
%description hook-sriov
sr-iov hook enable to add virtual functions exposed by the device
directly to a virtual machine.
%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
Summary: vmfex support for VDSM
BuildArch: noarch
Conflicts: hook-vmfex-dev
%description hook-vmfex
Hook for vmfex.
%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-vmdisk
Summary: External disk support for VDSM
BuildArch: noarch
%description hook-vmdisk
Hook adds additional disk image for a VM (raw or qcow2)
%if 0%{?with_gluster}
%package gluster
Summary: Gluster Plugin for VDSM
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: glusterfs-server
Requires: python-magic
%description gluster
Gluster plugin enables VDSM to serve Gluster functionalities.
%endif
%prep
%setup -q
%if 0%{?rhel} == 6
sed -i '/ su /d' vdsm/vdsm-logrotate.conf.in
%endif
%build
%if 0%{?enable_autotools}
autoreconf -if
%endif
%configure %{?with_hooks:--enable-hooks}
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}"'"/' vdsm/dsaversion.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@/{mom.log,supervdsm.log,vdsm.log}
# Install the respawn utility
install -Dm 0755 init/sysvinit/respawn \
%{buildroot}%{_datadir}/%{vdsm_name}/respawn
# Install the lvm rules
install -Dm 0644 vdsm/storage/vdsm-lvm.rules \
%{buildroot}/lib/udev/rules.d/12-vdsm-lvm.rules
install -Dm 0644 vdsm/limits.conf \
%{buildroot}/etc/security/limits.d/99-vdsm.conf
%if 0%{?with_systemd}
install -Dm 0755 init/systemd/systemd-vdsmd %{buildroot}/lib/systemd/systemd-vdsmd
install -Dm 0644 init/systemd/vdsmd.service %{buildroot}%{_unitdir}/vdsmd.service
install -Dm 0644 init/systemd/supervdsmd.service %{buildroot}%{_unitdir}/supervdsmd.service
install -Dm 0755 vdsm_reg/vdsm-reg.init \
%{buildroot}/lib/systemd/systemd-vdsm-reg
install -Dm 0644 vdsm_reg/vdsm-reg.service \
%{buildroot}%{_unitdir}/vdsm-reg.service
install -Dm 0644 vdsm/vdsm-modules-load.d.conf \
%{buildroot}%{_sysconfdir}/modules-load.d/vdsm.conf
%else
# Install the SysV init scripts
install -Dm 0755 init/sysvinit/vdsmd.init %{buildroot}%{_initrddir}/vdsmd
install -Dm 0755 init/sysvinit/supervdsmd.init %{buildroot}%{_initrddir}/supervdsmd
install -Dm 0755 vdsm_reg/vdsm-reg.init %{buildroot}%{_initrddir}/vdsm-reg
%endif
%if 0%{?with_tmpfiles_macro}
install -Dm 0644 init/systemd/vdsm-tmpfiles.d.conf \
%{buildroot}%{_tmpfilesdir}/%{vdsm_name}.conf
%endif
%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
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
install -Dm 0644 vdsm/vdsm-libvirt-access.rules \
%{buildroot}%{_polkitdir}/10-vdsm-libvirt-access.rules
%else
install -Dm 0644 vdsm/vdsm-libvirt-access.pkla \
%{buildroot}%{_polkitdir}/10-vdsm-libvirt-access.pkla
%endif
%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}
%post
%{_bindir}/vdsm-tool configure --module sanlock --force
%{_bindir}/vdsm-tool sebool-config || :
# set the vdsm "secret" password for libvirt
%{_bindir}/vdsm-tool set-saslpasswd
# 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@/{mom.log,supervdsm.log,vdsm.log}
chmod 0644 @VDSMLOGDIR@/{mom.log,supervdsm.log,vdsm.log}
chown @VDSMUSER@:@VDSMGROUP@ @VDSMLOGDIR@/{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
%if ! 0%{?with_systemd}
if [ "$1" -eq 1 ] ; then
/sbin/chkconfig --add vdsmd
/sbin/chkconfig --add supervdsmd
fi
%else
/bin/systemctl restart systemd-modules-load.service >/dev/null 2>&1 || :
if [ "$1" -eq 1 ] ; then
/bin/systemctl enable vdsmd.service >/dev/null 2>&1 || :
/bin/systemctl enable supervdsmd.service >/dev/null 2>&1 || :
fi
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
exit 0
%endif
%preun
if [ "$1" -eq 0 ]; then
%{_bindir}/vdsm-tool remove-config
fi
%if ! 0%{?with_systemd}
if [ "$1" -eq 0 ]
then
/sbin/service vdsmd stop > /dev/null 2>&1 || :
/sbin/chkconfig --del vdsmd
/sbin/service supervdsmd stop > /dev/null 2>&1 || :
/sbin/chkconfig --del supervdsmd
/bin/sed -i '/# VDSM section begin/,/# VDSM section end/d' \
/etc/sysctl.conf
%{_bindir}/vdsm-tool sebool-unconfig || :
%{_bindir}/vdsm-tool remove-saslpasswd
if /sbin/initctl status libvirtd >/dev/null 2>/dev/null ; then
/sbin/initctl stop libvirtd >/dev/null 2>/dev/null
rm -f /etc/init/libvirtd.conf
/sbin/chkconfig libvirtd on
/sbin/service libvirtd start >/dev/null
fi
fi
%else
%if 0%{?with_systemd_macros}
%systemd_preun vdsmd.service
%systemd_preun supervdsmd.service
%else
if [ "$1" -eq 0 ]; then
/bin/systemctl --no-reload disable vdsmd.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable supervdsmd.service > /dev/null 2>&1 || :
/bin/systemctl stop vdsmd.service > /dev/null 2>&1 || :
/bin/systemctl stop supervdsmd.service > /dev/null 2>&1 || :
fi
exit 0
%endif
%endif
%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 --module libvirt >/dev/null 2>&1;
then
if ! %{_bindir}/vdsm-tool configure --module libvirt --force \
>/dev/null 2>&1; then
# fallback to vdsmd reconfigure api - This change may be removed
# when vdsm won't support any downgrade\upgrade to versions that
# don't include vdsm-tool configure api (vdsm <= 3.3)
for f in '/lib/systemd/systemd-vdsmd' '/etc/init.d/vdsmd'; do
if [ -f "${f}" ]; then
"${f}" reconfigure >/dev/null 2>&1 || :
fi
done
fi
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
%if 0%{?rhel} == 6
# In el6, We configure libvirt to use upstart without the libvirt.rpm's
# awareness. Thus, we must stop/restart libvirt ourselves when the
# libvirt.rpm is removed/upgraded.
%triggerun -- libvirt
if [ "$2" -eq "0" ]; then
/sbin/initctl stop libvirtd > /dev/null 2>&1 || :
fi
%triggerpostun -- libvirt
if [ "$2" -ge "1" ]; then
/sbin/initctl restart libvirtd > /dev/null 2>&1 || :
fi
%endif
%post reg
%if ! 0%{?with_systemd}
if [ "$1" -eq 1 ] ; then
/sbin/chkconfig --add vdsm-reg
fi
%else
%if 0%{?with_systemd_macros}
%systemd_post vdsm-reg.service
%else
if [ "$1" -eq 1 ] ; then
/bin/systemctl enable vdsm-reg.service >/dev/null 2>&1 || :
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
exit 0
%endif
%endif
%preun reg
%if ! 0%{?with_systemd}
if [ "$1" -eq 0 ]
then
/sbin/service vdsm-reg stop > /dev/null 2>&1 || :
/sbin/chkconfig --del vdsm-reg
fi
%else
%if 0%{?with_systemd_macros}
%systemd_preun vdsm-reg.service
%else
if [ "$1" -eq 0 ]; then
/bin/systemctl --no-reload disable vdsm-reg.service > /dev/null 2>&1 || :
/bin/systemctl stop vdsm-reg.service > /dev/null 2>&1 || :
fi
exit 0
%endif
%endif
%files
%defattr(-, root, root, -)
%doc COPYING README lib/vdsm/vdsm.conf.sample
%if 0%{?with_systemd}
/lib/systemd/systemd-vdsmd
%{_unitdir}/vdsmd.service
%{_unitdir}/supervdsmd.service
%else
%{_initrddir}/vdsmd
%{_initrddir}/supervdsmd
%endif
%dir %attr(-, %{vdsm_user}, %{vdsm_group}) @vdsmrepo@
%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}/network
%dir %{_datadir}/%{vdsm_name}/network/configurators
%dir %{_datadir}/%{vdsm_name}/storage
%dir %{_datadir}/%{vdsm_name}/storage/imageRepository
%dir %{_datadir}/%{vdsm_name}/virt
%{_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}/dmidecodeUtil.py*
%{_datadir}/%{vdsm_name}/API.py*
%{_datadir}/%{vdsm_name}/hooking.py*
%{_datadir}/%{vdsm_name}/hooks.py*
%{_datadir}/%{vdsm_name}/lsblk.py*
%{_datadir}/%{vdsm_name}/md_utils.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}/ppc64HardwareInfo.py*
%{_datadir}/%{vdsm_name}/protocoldetector.py*
%{_datadir}/%{vdsm_name}/supervdsm.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/guestagent.py*
%{_datadir}/%{vdsm_name}/virt/migration.py*
%{_datadir}/%{vdsm_name}/virt/vmchannels.py*
%{_datadir}/%{vdsm_name}/virt/vmstatus.py*
%{_datadir}/%{vdsm_name}/virt/vm.py*
%{_datadir}/%{vdsm_name}/virt/vmexitreason.py*
%{_datadir}/%{vdsm_name}/virt/vmpowerdown.py*
%{_datadir}/%{vdsm_name}/virt/sampling.py*
%{_datadir}/%{vdsm_name}/virt/utils.py*
%{_datadir}/%{vdsm_name}/tool
%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
%if 0%{?with_systemd}
%config(noreplace) %{_sysconfdir}/modules-load.d/vdsm.conf
%endif
%if 0%{?with_tmpfiles_macro}
%config(noreplace) %{_tmpfilesdir}/%{vdsm_name}.conf
%endif
%{_sysconfdir}/dhcp/dhclient.d/sourceRoute.sh
%{_sysconfdir}/sudoers.d/50_vdsm
%{_sysconfdir}/cron.hourly/vdsm-logrotate
%{_sysconfdir}/cron.d/vdsm-libvirt-logrotate
%{_datadir}/%{vdsm_name}/logUtils.py*
%{_datadir}/%{vdsm_name}/dsaversion.py*
%{_libexecdir}/%{vdsm_name}/curl-img-wrap
%{_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
%{_datadir}/%{vdsm_name}/network/__init__.py*
%{_datadir}/%{vdsm_name}/network/api.py*
%{_datadir}/%{vdsm_name}/network/errors.py*
%{_datadir}/%{vdsm_name}/network/models.py*
%{_datadir}/%{vdsm_name}/network/sourceroute.py*
%{_datadir}/%{vdsm_name}/network/sourceroutethread.py*
%{_datadir}/%{vdsm_name}/network/tc.py*
%{_datadir}/%{vdsm_name}/network/configurators/__init__.py*
%{_datadir}/%{vdsm_name}/network/configurators/dhclient.py*
%{_datadir}/%{vdsm_name}/network/configurators/ifcfg.py*
%{_datadir}/%{vdsm_name}/network/configurators/libvirt.py*
%{_datadir}/%{vdsm_name}/network/configurators/iproute2.py*
%{_datadir}/%{vdsm_name}/storage/__init__.py*
%{_datadir}/%{vdsm_name}/storage/blockSD.py*
%{_datadir}/%{vdsm_name}/storage/blockVolume.py*
%{_datadir}/%{vdsm_name}/storage/curlImgWrap.py*
%{_datadir}/%{vdsm_name}/storage/devicemapper.py*
%{_datadir}/%{vdsm_name}/storage/dispatcher.py*
%{_datadir}/%{vdsm_name}/storage/domainMonitor.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/glusterSD.py*