2020-03-04 16:02:16 +08:00
|
|
|
|
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
|
2021-07-06 11:12:10 +08:00
|
|
|
|
%{!?with_check: %global with_check 1}
|
2020-03-04 16:02:16 +08:00
|
|
|
|
|
2021-07-06 11:12:10 +08:00
|
|
|
|
%global package_version 0.6.1
|
2020-03-04 16:02:16 +08:00
|
|
|
|
%global package_name mom
|
|
|
|
|
|
|
|
|
|
|
|
Name: %{package_name}
|
2021-07-06 11:12:10 +08:00
|
|
|
|
Version: 0.6.1
|
|
|
|
|
|
Release: 1
|
2020-03-04 16:02:16 +08:00
|
|
|
|
Summary: Dynamically manage system resources on virtualization hosts
|
|
|
|
|
|
|
|
|
|
|
|
License: GPLv2
|
|
|
|
|
|
URL: http://www.ovirt.org
|
2021-07-06 11:12:10 +08:00
|
|
|
|
Source: https://resources.ovirt.org/pub/src/%{name}/%{package_name}-%{package_version}.tar.gz
|
2020-03-04 16:02:16 +08:00
|
|
|
|
BuildArch: noarch
|
2021-07-06 11:12:10 +08:00
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
|
BuildRequires: python3-nose
|
|
|
|
|
|
BuildRequires: python3-six
|
2020-03-04 16:02:16 +08:00
|
|
|
|
|
|
|
|
|
|
Requires(post): systemd
|
|
|
|
|
|
Requires(preun): systemd
|
|
|
|
|
|
Requires(postun): systemd
|
|
|
|
|
|
BuildRequires: systemd
|
|
|
|
|
|
|
|
|
|
|
|
# MOM makes use of libvirt by way of the python bindings to monitor and
|
|
|
|
|
|
# interact with virtual machines.
|
|
|
|
|
|
Requires: libvirt-daemon-driver-qemu
|
2021-07-06 11:12:10 +08:00
|
|
|
|
Requires: python3-libvirt
|
|
|
|
|
|
Requires: python3-six
|
2020-03-04 16:02:16 +08:00
|
|
|
|
Requires: procps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
|
MOM is a policy-driven tool that can be used to manage overcommitment on KVM
|
|
|
|
|
|
hosts. Using libvirt, MOM keeps track of active virtual machines on a host. At
|
|
|
|
|
|
a regular collection interval, data is gathered about the host and guests. Data
|
|
|
|
|
|
can come from multiple sources (eg. the /proc interface, libvirt API calls, a
|
|
|
|
|
|
client program connected to a guest, etc). Once collected, the data is
|
|
|
|
|
|
organized for use by the policy evaluation engine. When started, MOM accepts a
|
|
|
|
|
|
user-supplied overcommitment policy. This policy is regularly evaluated using
|
|
|
|
|
|
the latest collected data. In response to certain conditions, the policy may
|
|
|
|
|
|
trigger reconfiguration of the system’s overcommitment mechanisms. Currently
|
|
|
|
|
|
MOM supports control of memory ballooning and KSM but the architecture is
|
|
|
|
|
|
designed to accommodate new mechanisms such as cgroups.
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
|
%setup -q -n %{package_name}-%{package_version}
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
2021-07-06 11:12:10 +08:00
|
|
|
|
%configure \
|
|
|
|
|
|
PYTHON="/usr/bin/python3" \
|
|
|
|
|
|
--docdir="%{_pkgdocdir}"
|
2020-03-04 16:02:16 +08:00
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
|
make DESTDIR="%{buildroot}" install
|
|
|
|
|
|
|
|
|
|
|
|
install -dm 755 %{buildroot}%{_unitdir}
|
2021-07-06 11:12:10 +08:00
|
|
|
|
install contrib/momd.service %{buildroot}%{_unitdir}
|
2020-03-04 16:02:16 +08:00
|
|
|
|
install -d -m 0755 "%{buildroot}/%{_sysconfdir}"
|
|
|
|
|
|
install -m 0644 doc/mom-balloon+ksm.conf "%{buildroot}/%{_sysconfdir}/momd.conf"
|
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
|
%if 0%{with_check}
|
|
|
|
|
|
make check %{?_smp_mflags}
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
|
%systemd_post momd.service
|
|
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
|
%systemd_preun momd.service
|
|
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
|
|
%systemd_postun_with_restart momd.service
|
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/momd.conf
|
2021-07-06 11:12:10 +08:00
|
|
|
|
%license COPYING
|
|
|
|
|
|
%doc README
|
|
|
|
|
|
|
|
|
|
|
|
%dir %{_pkgdocdir}/examples
|
|
|
|
|
|
%{_pkgdocdir}/examples/*
|
|
|
|
|
|
# COPYING is handled by license macro, avoid to ship duplicates
|
|
|
|
|
|
%exclude %{_pkgdocdir}/COPYING
|
|
|
|
|
|
|
2020-03-04 16:02:16 +08:00
|
|
|
|
%{_unitdir}/momd.service
|
|
|
|
|
|
%{_sbindir}/momd
|
2021-07-06 11:12:10 +08:00
|
|
|
|
%{python3_sitelib}/mom/
|
2020-03-04 16:02:16 +08:00
|
|
|
|
|
|
|
|
|
|
%changelog
|
2021-07-06 11:12:10 +08:00
|
|
|
|
* Tue Jul 06 2021 wangdi <wangdi@kylinos.cn> - 0.6.1-1
|
|
|
|
|
|
- Bump version to 0.6.1
|
|
|
|
|
|
|
2020-03-04 16:02:16 +08:00
|
|
|
|
* Wed Mar 04 2020 Huihui Fu <huihui.fu@cs2c.com.cn> - 0.5.12-1
|
|
|
|
|
|
- Initial package
|