diff --git a/_service b/_service index 71f396f..b6ec5f4 100644 --- a/_service +++ b/_service @@ -8,10 +8,10 @@ To update to a new release, change "revision" to the desired git commit hash and bump "version" if necessary - 1.1.15 + 1.1.16 --> - 1.1.15+git%cd.%h - b6f251a13fadca0cb74702b0c007a55275c8ea09 + 1.1.16+git%cd.%h + a7825f4f0a8db272d1ce0b1f93e8044cbcaa5144 diff --git a/pacemaker-NodeUtilization-RA.patch b/bug-1015842_pacemaker-NodeUtilization-RA.patch similarity index 54% rename from pacemaker-NodeUtilization-RA.patch rename to bug-1015842_pacemaker-NodeUtilization-RA.patch index c7eebd6..94bc464 100644 --- a/pacemaker-NodeUtilization-RA.patch +++ b/bug-1015842_pacemaker-NodeUtilization-RA.patch @@ -1,13 +1,17 @@ -commit 41ae609accd114bc5d4a05a74a80d3213d217373 -Author: Dejan Muhamedagic -Date: Fri Nov 25 13:11:15 2011 +0100 +From ab4df57e195486ee651f56793470d421233a0896 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= +Date: Thu, 2 Feb 2017 09:06:00 +0100 +Subject: [PATCH] Medium: NodeUtilization: Add NodeUtilization agent - Medium: RA: add NodeUtilization RA +--- + extra/resources/Makefile.am | 1 + + extra/resources/NodeUtilization | 224 ++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 225 insertions(+) + create mode 100644 extra/resources/NodeUtilization -Index: pacemaker-1.1.15+git20161018.722276c/extra/resources/Makefile.am -=================================================================== ---- pacemaker-1.1.15+git20161018.722276c.orig/extra/resources/Makefile.am -+++ pacemaker-1.1.15+git20161018.722276c/extra/resources/Makefile.am +diff --git a/extra/resources/Makefile.am b/extra/resources/Makefile.am +--- a/extra/resources/Makefile.am ++++ b/extra/resources/Makefile.am @@ -38,7 +38,8 @@ ocf_SCRIPTS = ClusterMon \ SysInfo \ SystemHealth \ @@ -18,17 +22,19 @@ Index: pacemaker-1.1.15+git20161018.722276c/extra/resources/Makefile.am isolationtech_SCRIPTS = docker-wrapper -Index: pacemaker-1.1.15+git20161018.722276c/extra/resources/NodeUtilization -=================================================================== +diff --git a/extra/resources/NodeUtilization b/extra/resources/NodeUtilization +new file mode 100644 +index 0000000..da5fb56 --- /dev/null -+++ pacemaker-1.1.15+git20161018.722276c/extra/resources/NodeUtilization -@@ -0,0 +1,230 @@ ++++ b/extra/resources/NodeUtilization +@@ -0,0 +1,224 @@ +#!/bin/sh +# +# +# NodeUtilization OCF Resource Agent +# +# Copyright (c) 2011 SUSE LINUX, John Shi ++# Copyright (c) 2016 SUSE LINUX, Kristoffer Gronlund +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify @@ -53,13 +59,12 @@ Index: pacemaker-1.1.15+git20161018.722276c/extra/resources/NodeUtilization +####################################################################### +# Initialization: + -+: ${OCF_FUNCTIONS=${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs} -+. ${OCF_FUNCTIONS} -+: ${__OCF_ACTION=$1} ++: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat} ++. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs + +####################################################################### + -+meta_data() { ++NodeUtilization_meta_data() { + cat < + @@ -67,56 +72,59 @@ Index: pacemaker-1.1.15+git20161018.722276c/extra/resources/NodeUtilization +1.0 + + -+This is an NodeUtilization Resource Agent. -+This agent detects system parameters and put them into CIB by crm_attribute, -+and it runs on every node as clone resource. ++The Node Utilization agent detects system parameters like available CPU, host ++memory and hypervisor memory availability, and adds them into the CIB for each ++node using crm_attribute. Run the agent as a clone resource to have it populate ++these parameters on each node. ++Note: Setting hv_memory only works with Xen at the moment, using the xl or xm ++command line tools. + -+NodeUtilization resource agent ++Node Utilization + + + + -+If set, some of the HA parameters will be reset if there are -+difference between HA parameters and system parameters when HA monitor. -+Otherwise, the HA parameters will be set once when the resource instance starts. ++If set, parameters will be updated if there are differences between the HA ++parameters and the system values when running the monitor action. ++If not set, the parameters will be set once when the resource instance starts. + -+Set HA parameters when start or monitor ++Dynamically update parameters in monitor + + + + -+Enable setting cpu utilization. -+Enable setting cpu utilization. ++Enable setting node CPU utilization limit. ++Set node CPU utilization limit. + + + + -+CPU reserved for non-HA related usage. -+CPU reserved for non-HA related usage. ++Subtract this value when setting the CPU utilization parameter. ++CPU reservation. + + + + -+Enable setting memory utilization of host. -+Enable setting memory utilization of host. ++Enable setting available host memory. ++Set available host memory. + + + + -+Memory reserved for other services inside host, in MB. -+Memory reserved for other services inside host, in MB. ++Subtract this value when setting host memory utilization, in MB. ++Host memory reservation, in MB. + + + + -+Enable setting the memory utilization of hypervisor. -+Enable setting the memory utilization of hypervisor. ++Enable setting available hypervisor memory. ++Set available hypervisor memory. + + + + -+Memory reserved for the hypervisor, in MB. -+Memory reserved for the hypervisor, in MB. ++Subtract this value when setting hypervisor memory utilization, in MB. ++Hypervisor memory reservation, in MB. + + + @@ -132,8 +140,22 @@ Index: pacemaker-1.1.15+git20161018.722276c/extra/resources/NodeUtilization +END +} + ++Host_Total_Memory() { ++ local xentool ++ ++ xentool=$(which xl 2> /dev/null || which xm 2> /dev/null) ++ ++ if [ -x $xentool ]; then ++ $xentool info | awk '/total_memory/{printf("%d\n",$3);exit(0)}' ++ else ++ ocf_log warn "Can only set hv_memory for Xen hypervisor" ++ echo "0" ++ fi ++} ++ ++ +set_utilization() { -+ host_name="$(hostname)" ++ host_name="$(ocf_local_nodename)" + + if ocf_is_true "$OCF_RESKEY_utilization_cpu"; then + sys_cpu=$(( $(grep -c processor /proc/cpuinfo) - $OCF_RESKEY_utilization_cpu_reservation )) @@ -141,7 +163,7 @@ Index: pacemaker-1.1.15+git20161018.722276c/extra/resources/NodeUtilization + + if [ "$sys_cpu" != "$uti_cpu" ]; then + if ! crm_attribute -t nodes -U "$host_name" -z -n cpu -v $sys_cpu; then -+ ocf_log err "Failed to set cpu of utilization by crm_attribute." ++ ocf_log err "Failed to set the cpu utilization attribute for $host_name using crm_attribute." + return 1 + fi + fi @@ -153,29 +175,27 @@ Index: pacemaker-1.1.15+git20161018.722276c/extra/resources/NodeUtilization + + if [ "$sys_mem" != "$uti_mem" ]; then + if ! crm_attribute -t nodes -U "$host_name" -z -n host_memory -v $sys_mem; then -+ ocf_log err "Failed to set host_memory of utilization by crm_attribute." ++ ocf_log err "Failed to set the host_memory utilization attribute for $host_name using crm_attribute." + return 1 + fi + fi + fi + -+ if [ -x /usr/sbin/xm ]; then -+ if ocf_is_true "$OCF_RESKEY_utilization_hv_memory"; then -+ hv_mem=$(( $(xm info | awk '/total_memory/{printf("%d\n",$3);exit(0)}') - $OCF_RESKEY_utilization_hv_memory_reservation )) -+ uti_mem=$(crm_attribute -Q -t nodes -U "$host_name" -z -n hv_memory 2>/dev/null) ++ if ocf_is_true "$OCF_RESKEY_utilization_hv_memory"; then ++ hv_mem=$(( $(Host_Total_Memory) - OCF_RESKEY_utilization_hv_memory_reservation )) ++ uti_mem=$(crm_attribute -Q -t nodes -U "$host_name" -z -n hv_memory 2>/dev/null) + -+ if [ "$hv_mem" != "$uti_mem" ]; then -+ if ! crm_attribute -t nodes -U "$host_name" -z -n hv_memory -v $hv_mem; then -+ ocf_log err "Failed to set hv_memory of utilization by crm_attribute." -+ return 1 -+ fi ++ if [ "$hv_mem" != "$uti_mem" ]; then ++ if ! crm_attribute -t nodes -U "$host_name" -z -n hv_memory -v $hv_mem; then ++ ocf_log err "Failed to set the hv_memory utilization attribute for $host_name using crm_attribute." ++ return 1 + fi + fi + fi +} + +NodeUtilization_usage() { -+ cat <]]) - --if test "x${enable_systemd}" != xno; then -- if test $HAVE_dbus = 0; then -- if test "x${enable_systemd}" = xyes; then -- AC_MSG_FAILURE([cannot enable systemd without DBus]) -- else -- enable_systemd=no -- fi -- fi -- if test "x${enable_systemd}" = xtry; then -- AC_MSG_CHECKING([for systemd version query result via dbus-send]) -- ret=$({ dbus-send --system --print-reply \ -- --dest=org.freedesktop.systemd1 \ -- /org/freedesktop/systemd1 \ -- org.freedesktop.DBus.Properties.Get \ -- string:org.freedesktop.systemd1.Manager \ -- string:Version 2>/dev/null \ -- || echo "this borked"; } | tail -n1) -- # sanitize output a bit (interested just in value, not type), -- # ret is intentionally unenquoted so as to normalize whitespace -- ret=$(echo ${ret} | cut -d' ' -f2-) -- AC_MSG_RESULT([${ret}]) -- if test "x${ret}" != xborked \ -- || systemctl --version 2>/dev/null | grep -q systemd; then -- enable_systemd=yes -- else -- enable_systemd=no -- fi -- fi --fi -- --AC_MSG_CHECKING([whether to enable support for managing resources via systemd]) --AC_MSG_RESULT([${enable_systemd}]) --if test "x${enable_systemd}" = xyes; then -- HAVE_systemd=1 -- PCMK_FEATURES="$PCMK_FEATURES systemd" -- -- AC_MSG_CHECKING([for systemd path for system unit files]) -- systemdunitdir="${systemdunitdir:}" -- PKG_CHECK_VAR([systemdunitdir], [systemd], -- [systemdsystemunitdir], [],[ -- systemdunitdir=no -- ]) -- AC_MSG_RESULT([${systemdunitdir}]) -- if test "x${systemdunitdir}" = xno; then -- AC_MSG_FAILURE([cannot enable systemd when systemdunitdir unresolved]) -- fi --fi -- --AC_DEFINE_UNQUOTED(SUPPORT_SYSTEMD, $HAVE_systemd, Support systemd based system services) --AM_CONDITIONAL(BUILD_SYSTEMD, test $HAVE_systemd = 1) --AC_SUBST(SUPPORT_SYSTEMD) -- - if test "x${enable_upstart}" != xno; then - if test $HAVE_dbus = 0; then - if test "x${enable_upstart}" = xyes; then -@@ -1303,6 +1251,42 @@ AC_DEFINE_UNQUOTED(SUPPORT_UPSTART, $HAV - AM_CONDITIONAL(BUILD_UPSTART, test $HAVE_upstart = 1) - AC_SUBST(SUPPORT_UPSTART) - -+if test "x${enable_systemd}" != xno; then -+ if test $HAVE_dbus = 0; then -+ if test "x${enable_systemd}" = xyes; then -+ AC_MSG_FAILURE([cannot enable systemd without DBus]) -+ else -+ enable_systemd=no -+ fi -+ else -+ AC_MSG_CHECKING([for systemd path for system unit files]) -+ PKG_CHECK_VAR([systemdunitdir], [systemd], [systemdsystemunitdir], [ -+ AC_MSG_RESULT([${systemdunitdir}]) -+ ],[ -+ AC_MSG_RESULT([not found]) -+ systemdunitdir=no -+ ]) -+ if test "x${systemdunitdir}" = xno; then -+ if test "x${enable_systemd}" = xyes; then -+ AC_MSG_FAILURE([cannot enable systemd when systemdunitdir unresolved]) -+ fi -+ enable_systemd=no -+ else -+ enable_systemd=yes -+ fi -+ fi -+fi -+ -+AC_MSG_CHECKING([whether to enable support for managing resources via systemd]) -+AC_MSG_RESULT([${enable_systemd}]) -+if test "x${enable_systemd}" = xyes; then -+ HAVE_systemd=1 -+ PCMK_FEATURES="$PCMK_FEATURES systemd" -+fi -+ -+AC_DEFINE_UNQUOTED(SUPPORT_SYSTEMD, $HAVE_systemd, Support systemd based system services) -+AM_CONDITIONAL(BUILD_SYSTEMD, test $HAVE_systemd = 1) -+AC_SUBST(SUPPORT_SYSTEMD) - - case $SUPPORT_NAGIOS in - 1|yes|true|try) diff --git a/pacemaker-lrmd.h-include-libxml.patch b/pacemaker-lrmd.h-include-libxml.patch new file mode 100644 index 0000000..eff9da9 --- /dev/null +++ b/pacemaker-lrmd.h-include-libxml.patch @@ -0,0 +1,29 @@ +commit 6a9c3c80245f6fd84433e0c1c65c63b4f576350e +Author: Gao,Yan +Date: Tue Mar 7 00:23:03 2017 +0100 + + Build: lrmd: Include libxml/tree.h in lrmd.h + + 65d0b80 introduced "xmlNode *versioned_params" in lrmd_event_data_t but + without including libxml/tree.h in lrmd.h. + + Sbd failed to build against it: + + In file included from /usr/include/pacemaker/crm/common/util.h:33:0, + from sbd-inquisitor.c:19: + /usr/include/pacemaker/crm/lrmd.h:241:5: error: unknown type name ‘xmlNode’ + xmlNode *versioned_params; + ^ + +diff --git a/include/crm/lrmd.h b/include/crm/lrmd.h +index 446b39c..6f829f7 100644 +--- a/include/crm/lrmd.h ++++ b/include/crm/lrmd.h +@@ -23,6 +23,7 @@ + * \ingroup lrmd + */ + #include ++#include + #include + + #ifndef LRMD__H diff --git a/pacemaker.changes b/pacemaker.changes index 6e2f109..51ea242 100644 --- a/pacemaker.changes +++ b/pacemaker.changes @@ -1,3 +1,113 @@ +------------------------------------------------------------------- +Tue Mar 7 00:01:15 UTC 2017 - ygao@suse.com + +- Build: lrmd: Include libxml/tree.h in lrmd.h + * pacemaker-lrmd.h-include-libxml.patch + +------------------------------------------------------------------- +Mon Mar 6 22:58:46 UTC 2017 - ygao@suse.com + +- libfencing,fencing: properly remap "action" in configuration +- libservices: ensure recurring actions table is created before using +- libservices: improve error messages when creating operation +- libservices: properly detect in-flight systemd/upstart ops when kicking +- libservices: properly cancel in-flight systemd/upstart op +- libservices: handle in-flight case first when cancelling an operation +- libservices: prevent use-after-free when freeing an operation +- libservices: ensure completed ops aren't on blocked ops list +- libcrmcommon: assert if can't generate operation key +- libcrmcommon: improve remote connection polling messages +- crmd: clear failure only for requested node +- crmd: improve message when clearing failures +- pengine,libpe_status: make failcount clearing messages more helpful +- pengine,libpe_status: don't clear same fail-count twice +- cib: properly mark variable as volatile +- libcib: avoid memory leak in query_node_uuid() +- tools: avoid NULL dereference in crm_resource debug message +- cib,libcrmcommon,lrmd: handle IP addresses better in messages +- tools: crm_attribute should prefer node name from environment +- libcrmcommon: Correctly delete XML comments according to their positions (bsc#1024037) +- libcrmcommon: Correctly compare XML comments to prevent crmd from getting into infinite election loop (bsc#1024037) +- crmd,libcrmcluster: minor log message improvements +- tools: avoid deprecated function in notifyServicelogEvent +- libcrmcommon,pengine,tools: pass local node name to resource agents +- use callback instead of sync call +- libcib: make querying node uuid more efficient +- tools: allow regular expression with crm_attribute +- attrd: support regular expressions in legacy attrd +- attrd: support Pacemaker Remote node attributes in legacy attrd +- use status scope to start node in standby mode +- attrd: ignore unsupported requests in legacy attrd +- attrd,crmd: implement peer remove requests in legacy attrd +- crmd: don't clear remote node transient attributes unnecessarily +- crm_mon: protect against non-standard or failing asctime +- libservices(sync): partially prevent killing foreign process +- libservices (sync): ensure no zombie is left behind +- cib: improve re-sync handling +- tools: implement crm_failcount command-line options correctly +- tools: use correct regular expression for fail counts in crm_resource +- cib: never disable legacy mode with corosync 1 stacks +- cib: improve warning when legacy diff fails +- libcrmcommon: ensure filename is not NULL before opening +- crmd: be more resilient when checking an LRM command's "from" +- crmd: improve crmd's LRM-related log messages +- tools: properly ignore version with crm_diff --no-version (bsc#888726) +- Ability to start node in standby +- Upstream version cs: a7825f4f0a8db272d1ce0b1f93e8044cbcaa5144 + +------------------------------------------------------------------- +Mon Mar 6 13:04:16 UTC 2017 - ygao@suse.com + +- libservices: properly watch writable DBus handles +- tools: don't reference hidden parameter in crm_resource help text +- Alert: Set SNMP_PERSISTENT_DIR directory for the snmp-trap tool. +- dbus: Prevent lrmd from hanging on dbus calls (bsc#1015264) +- spec: add %check to run a subset of tests on rpmbuild +- crmd: update cache status for guest node whose host is fenced +- pengine: consider guest node unclean if its host is unclean +- pengine: create a pseudo-fence for guest node recovery +- pengine: guest node fencing doesn't require stonith enabled +- pengine: remove unnecessary assert +- mcp: Correction of the difference in access permission setting. +- stonith_admin: Addition of the list-targets option. +- stonith: Check for missing params in new device and dup +- libservices: treat systemd service reloading as OK +- crmd: increase severity when fencing didn't happen (bsc#1011240) +- rng: Create resources-2.7.rng to update template class validation +- libcrmcommon: Don't report error if the output file isn't syncable +- crmd: bump feature set +- pengine: disable migration for versioned resources +- add versioned parameters support +- Upstream version cs: 2817a2081e9e70e7412f0d0a253495611afab55e + +------------------------------------------------------------------- +Mon Mar 6 12:58:37 UTC 2017 - ygao@suse.com + +- wd: Fix to not compare NULL when environment variable is not set +- mcp,pacemaker_remote: order after time-sync + +- configure: fix fouled parameter expansion + * Drop obsolete pacemaker-configure-systemd-detection.patch + +- xml: rng: Keep score-attribute{,-mangle} in the existing RelaxNG schema files for graceful upgrades +- Upstream version cs: 94ff4df51a55cc30d01843ea11b3292bac755432 (Pacemaker-1.1.16) + +------------------------------------------------------------------- +Mon Mar 6 12:57:23 UTC 2017 - ygao@suse.com + +- RA: NodeUtilization - Use xl if available (bsc#1015842) + * bug-1015842_pacemaker-NodeUtilization-RA.patch + +------------------------------------------------------------------- +Mon Mar 6 12:53:50 UTC 2017 - ygao@suse.com + +- spec: Prevent overwriting existing sysconfig files by conditionally running %fillup_only (bsc#1022807) + +------------------------------------------------------------------- +Mon Mar 6 12:52:25 UTC 2017 - ygao@suse.com + +- spec: cts brings an RA that needs python-systemd + ------------------------------------------------------------------- Wed Feb 22 15:39:36 UTC 2017 - dimstar@opensuse.org diff --git a/pacemaker.spec b/pacemaker.spec index 475363d..196f44a 100644 --- a/pacemaker.spec +++ b/pacemaker.spec @@ -47,20 +47,21 @@ %bcond_with doc Name: pacemaker -Version: 1.1.15+git20161104.b6f251a +Version: 1.1.16+git20170302.a7825f4 Release: 0 Summary: Scalable High-Availability cluster resource manager -# AGPL-3.0 licensed extra/clustermon.sh is not present in the binary License: GPL-2.0 and GPL-2.0+ and LGPL-2.1+ Group: Productivity/Clustering/HA +# AGPL-3.0 licensed extra/clustermon.sh is not present in the binary Url: http://www.clusterlabs.org -# eg. https://github.com/ClusterLabs/pacemaker/archive/8ae45302394b039fb098e150f156df29fc0cb576/pacemaker-8ae4530.tar.gz +# Hint: use "spectool -s 0 pacemaker.spec" (rpmdevtools) to check the final URL: +# https://github.com/ClusterLabs/pacemaker/archive/e91769e5a39f5cb2f7b097d3c612368f0530535e/pacemaker-e91769e.tar.gz Source0: %{name}-%{version}.tar.bz2 Source1: crm_report.in Source100: pacemaker.rpmlintrc Patch1: bug-806256_pacemaker-log-level-notice.patch Patch2: bug-728579_pacemaker-stonith-dev-id.patch -Patch3: pacemaker-NodeUtilization-RA.patch +Patch3: bug-1015842_pacemaker-NodeUtilization-RA.patch Patch4: pacemaker-cibsecret-tool-temp-disabled.patch Patch5: pacemaker-nagios-plugin-dir.patch Patch6: bug-812269_pacemaker-fencing-device-register-messages.patch @@ -68,7 +69,7 @@ Patch7: pacemaker-Wno-format-signedness.patch Patch8: bug-943295_pacemaker-lrmd-log-notice.patch Patch9: bug-977201_pacemaker-controld-self-fencing.patch Patch10: bug-995365_pacemaker-cts-restart-systemd-journald.patch -Patch11: pacemaker-configure-systemd-detection.patch +Patch11: pacemaker-lrmd.h-include-libxml.patch # Required for core functionality BuildRequires: autoconf BuildRequires: automake @@ -89,7 +90,8 @@ BuildRequires: sed BuildRequires: pkgconfig(bzip2) BuildRequires: pkgconfig(corosync) BuildRequires: pkgconfig(dbus-1) -BuildRequires: pkgconfig(glib-2.0) +## version lower bound for: G_GNUC_INTERNAL +BuildRequires: pkgconfig(glib-2.0) >= 2.6 BuildRequires: pkgconfig(gnutls) BuildRequires: pkgconfig(libexslt) # Pacemaker requires a minimum libqb functionality @@ -248,11 +250,13 @@ manager for Corosync, CMAN and/or Linux-HA. The libpacemaker-devel package contains headers and shared libraries for developing tools for Pacemaker. +# NOTE: can be noarch if lrmd_test is moved to another subpackage %package cts Summary: Test framework for cluster-related technologies Group: Productivity/Clustering/HA Requires: libpacemaker3 = %{version}-%{release} Requires: python >= 2.6 +Requires: python-systemd %description cts Test framework for cluster-related technologies like Pacemaker @@ -385,9 +389,15 @@ install -m 755 %{SOURCE1} %{buildroot}%{_sbindir}/crm_report %service_add_pre crm_mon.service %post cli -%fillup_only pacemaker +if [ ! -e %{_sysconfdir}/sysconfig/pacemaker ]; then + %fillup_only -n pacemaker +fi + %service_add_post crm_mon.service -%fillup_only crm_mon + +if [ ! -e %{_sysconfdir}/sysconfig/crm_mon ]; then + %fillup_only -n crm_mon +fi %preun cli %service_del_preun crm_mon.service