Accepting request 546490 from home:yan_gao:branches:network:ha-clustering:Factory:Test

- NodeUtilization RA is now shipped by resource-agents package (bsc#1070347)
  * Drop bug-1015842_pacemaker-NodeUtilization-RA.patch

- libpe_status: remove support for default-resource-failure-stickiness
- libpe_status: remove support for resource-failure-stickiness
- various: remove support for pre-Pacemaker-1.0 CIB XML
- libpe_status,tools: remove support for legacy ticket state entries
- various: remove isolation wrapper support
- systemd unit files: enable TasksMax=infinity (bsc#1028138, bsc#1066710)
  * Drop obsolete bug-1028138_pacemaker-pacemaker.service-TasksMax.patch
- crmd: default record-pending to TRUE
- tools: enable new crm_resource --cleanup/--refresh behavior
- Upstream version cs: 53a3fe14b15b087bbde9ccb524d11d0a413cc6e9

- Update to version 1.1.18
- libpe_status: always use default key location with bundles
- attrd,stonithd: more efficient regular expression parsing
- libpe_status: avoid potential NULL dereference
- tools: use proper variable in message from crm_resource -g
- tools: use uber-parent for crm_resource -a/-A
- tools: use g_main_loop_is_running() properly
- libpe_status: monitors are rescheduled, not reloaded
- crmd: determine restart/private digests correctly
- systemd: add TasksMax comment to pacemaker_remote unit (bsc#1028138, bsc#1066710)
- tools: make regression test insensitive to line number changes
- pengine,tools,libpe_status: avoid unnecessary use of pe_find_current
- pacemaker.service: Recommend not to limit tasks (bsc#1028138, bsc#1066710)
- tools: set the correct OCF_RESOURCE_INSTANCE env when crm_resource --force-* executes RA
- typo: overriden -> overridden
- portability: the difference of time_t values is given by difftime()

OBS-URL: https://build.opensuse.org/request/show/546490
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=279
This commit is contained in:
Yan Gao 2017-11-29 16:52:08 +00:00 committed by Git OBS Bridge
parent c51d4e2a58
commit 5498ebebbb
7 changed files with 112 additions and 284 deletions

View File

@ -8,10 +8,10 @@
To update to a new release, change "revision" to the desired
git commit hash and bump "version" if necessary
<param name="version">1.1.17</param>
<param name="version">1.1.18</param>
-->
<param name="versionformat">1.1.17+git%cd.%h</param>
<param name="revision">36d2962a8613322fc43d727d95720d61a47d0138</param>
<param name="versionformat">1.1.18+git%cd.%h</param>
<param name="revision">53a3fe14b15b087bbde9ccb524d11d0a413cc6e9</param>
</service>
<service name="recompress" mode="disabled">

View File

@ -1,259 +0,0 @@
commit 501bfa9359923b5c9b1fd3f349d93c497940d0cd
Author: Kristoffer Grönlund <krig@koru.se>
Date: Thu Feb 2 09:06:00 2017 +0100
Medium: NodeUtilization: Add NodeUtilization agent
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.
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 \
attribute \
- remote
+ remote \
+ NodeUtilization
isolationtech_SCRIPTS = docker-wrapper
diff --git a/extra/resources/NodeUtilization b/extra/resources/NodeUtilization
new file mode 100755
index 00000000..61969e6f
--- /dev/null
+++ b/heartbeat/NodeUtilization
@@ -0,0 +1,226 @@
+#!/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
+# it under the terms of version 2 of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Further, this software is distributed without any warranty that it is
+# free of the rightful claim of any third person regarding infringement
+# or the like. Any license provided herein, whether implied or
+# otherwise, applies only to this software file. Patent licenses, if
+# any, provided herein do not apply to combinations of this program with
+# other software, or any other product whatsoever.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+#
+#######################################################################
+# Initialization:
+
+: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
+. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
+
+#######################################################################
+
+NodeUtilization_meta_data() {
+ cat <<END
+<?xml version="1.0"?>
+<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
+<resource-agent name="NodeUtilization">
+<version>1.0</version>
+
+<longdesc lang="en">
+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.
+</longdesc>
+<shortdesc lang="en">Node Utilization</shortdesc>
+
+<parameters>
+<parameter name="dynamic" unique="0" required="0">
+<longdesc lang="en">
+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.
+</longdesc>
+<shortdesc lang="en">Dynamically update parameters in monitor</shortdesc>
+<content type="boolean" default="true" />
+</parameter>
+
+<parameter name="utilization_cpu" unique="0" required="0">
+<longdesc lang="en">Enable setting node CPU utilization limit.</longdesc>
+<shortdesc lang="en">Set node CPU utilization limit.</shortdesc>
+<content type="boolean" default="true" />
+</parameter>
+
+<parameter name="utilization_cpu_reservation" unique="0" required="0">
+<longdesc lang="en">Subtract this value when setting the CPU utilization parameter.</longdesc>
+<shortdesc lang="en">CPU reservation.</shortdesc>
+<content type="integer" default="1" />
+</parameter>
+
+<parameter name="utilization_host_memory" unique="0" required="0">
+<longdesc lang="en">Enable setting available host memory.</longdesc>
+<shortdesc lang="en">Set available host memory.</shortdesc>
+<content type="boolean" default="true" />
+</parameter>
+
+<parameter name="utilization_host_memory_reservation" unique="0" required="0">
+<longdesc lang="en">Subtract this value when setting host memory utilization, in MB.</longdesc>
+<shortdesc lang="en">Host memory reservation, in MB.</shortdesc>
+<content type="integer" default="512" />
+</parameter>
+
+<parameter name="utilization_hv_memory" unique="0" required="0">
+<longdesc lang="en">Enable setting available hypervisor memory.</longdesc>
+<shortdesc lang="en">Set available hypervisor memory.</shortdesc>
+<content type="boolean" default="true" />
+</parameter>
+
+<parameter name="utilization_hv_memory_reservation" unique="0" required="0">
+<longdesc lang="en">Subtract this value when setting hypervisor memory utilization, in MB.</longdesc>
+<shortdesc lang="en">Hypervisor memory reservation, in MB.</shortdesc>
+<content type="integer" default="512" />
+</parameter>
+</parameters>
+
+<actions>
+<action name="start" timeout="90" />
+<action name="stop" timeout="100" />
+<action name="monitor" timeout="20s" interval="60s"/>
+<action name="meta-data" timeout="5" />
+<action name="validate-all" timeout="30" />
+</actions>
+</resource-agent>
+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="$(ocf_local_nodename)"
+
+ if ocf_is_true "$OCF_RESKEY_utilization_cpu"; then
+ sys_cpu=$(( $(grep -c processor /proc/cpuinfo) - $OCF_RESKEY_utilization_cpu_reservation ))
+ uti_cpu=$(crm_attribute -Q -t nodes -U "$host_name" -z -n cpu 2>/dev/null)
+
+ 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 the cpu utilization attribute for $host_name using crm_attribute."
+ return 1
+ fi
+ fi
+ fi
+
+ if ocf_is_true "$OCF_RESKEY_utilization_host_memory"; then
+ sys_mem=$(( $(awk '/MemTotal/{printf("%d\n",$2/1024);exit(0)}' /proc/meminfo) - $OCF_RESKEY_utilization_host_memory_reservation ))
+ uti_mem=$(crm_attribute -Q -t nodes -U "$host_name" -z -n host_memory 2>/dev/null)
+
+ 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 the host_memory utilization attribute for $host_name using crm_attribute."
+ return 1
+ fi
+ fi
+ fi
+
+ 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)
+
+ [ $hv_mem -lt 0 ] && hv_mem=0
+
+ 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 <<END
+usage: $0 {start|stop|monitor|validate-all|meta-data}
+
+Expects to have a fully populated OCF RA-compliant environment set.
+END
+}
+
+NodeUtilization_start() {
+ ha_pseudo_resource $statefile start
+ if ! ocf_is_true "$OCF_RESKEY_dynamic"; then
+ if ! set_utilization; then
+ exit $OCF_ERR_GENERIC
+ fi
+ fi
+ exit $OCF_SUCCESS
+}
+
+NodeUtilization_stop() {
+ ha_pseudo_resource $statefile stop
+ exit $OCF_SUCCESS
+}
+
+NodeUtilization_monitor() {
+ local rc
+ ha_pseudo_resource $statefile monitor
+ rc=$?
+
+ case $rc in
+ $OCF_SUCCESS)
+ if ocf_is_true "$OCF_RESKEY_dynamic"; then
+ if ! set_utilization; then
+ exit $OCF_ERR_GENERIC
+ fi
+ fi
+ ;;
+ *) exit $rc;;
+ esac
+}
+
+NodeUtilization_validate() {
+ exit $OCF_SUCCESS
+}
+
+statefile=$OCF_RESOURCE_TYPE.$(echo $OCF_RESOURCE_INSTANCE | sed -e 's/^.*://')
+
+: ${OCF_RESKEY_pidfile:="$HA_VARRUN/NodeUtilization-${OCF_RESOURCE_INSTANCE}"}
+: ${OCF_RESKEY_dynamic:="true"}
+: ${OCF_RESKEY_utilization_cpu:="true"}
+: ${OCF_RESKEY_utilization_cpu_reservation="1"}
+: ${OCF_RESKEY_utilization_hv_memory:="true"}
+: ${OCF_RESKEY_utilization_hv_memory_reservation="512"}
+: ${OCF_RESKEY_utilization_host_memory:="true"}
+: ${OCF_RESKEY_utilization_host_memory_reservation="512"}
+
+OCF_REQUIRED_PARAMS=""
+OCF_REQUIRED_BINARIES=""
+ocf_rarun $*

View File

@ -1,12 +0,0 @@
Index: pacemaker/mcp/pacemaker.service.in
===================================================================
--- pacemaker.orig/mcp/pacemaker.service.in
+++ pacemaker/mcp/pacemaker.service.in
@@ -26,6 +26,7 @@ NotifyAccess=main
EnvironmentFile=-@CONFIGDIR@/pacemaker
EnvironmentFile=-@CONFIGDIR@/sbd
SuccessExitStatus=100
+TasksMax=4915
ExecStart=@sbindir@/pacemakerd -f

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1c22366abd7296c24bc1bfb331a7a854a5d189a32afe326f43317be006ca69c1
size 4230405

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:44a2ae8b8b5352ade22f7390b229d7444b1dcda78dc8a0043504d240e09fe473
size 4141830

View File

@ -1,3 +1,105 @@
-------------------------------------------------------------------
Wed Nov 29 12:31:43 UTC 2017 - ygao@suse.com
- NodeUtilization RA is now shipped by resource-agents package (bsc#1070347)
* Drop bug-1015842_pacemaker-NodeUtilization-RA.patch
-------------------------------------------------------------------
Wed Nov 29 12:05:00 UTC 2017 - ygao@suse.com
- libpe_status: remove support for default-resource-failure-stickiness
- libpe_status: remove support for resource-failure-stickiness
- various: remove support for pre-Pacemaker-1.0 CIB XML
- libpe_status,tools: remove support for legacy ticket state entries
- various: remove isolation wrapper support
- systemd unit files: enable TasksMax=infinity (bsc#1028138, bsc#1066710)
* Drop obsolete bug-1028138_pacemaker-pacemaker.service-TasksMax.patch
- crmd: default record-pending to TRUE
- tools: enable new crm_resource --cleanup/--refresh behavior
- Upstream version cs: 53a3fe14b15b087bbde9ccb524d11d0a413cc6e9
-------------------------------------------------------------------
Mon Nov 20 16:20:53 UTC 2017 - ygao@suse.co
- Update to version 1.1.18
- libpe_status: always use default key location with bundles
- attrd,stonithd: more efficient regular expression parsing
- libpe_status: avoid potential NULL dereference
- tools: use proper variable in message from crm_resource -g
- tools: use uber-parent for crm_resource -a/-A
- tools: use g_main_loop_is_running() properly
- libpe_status: monitors are rescheduled, not reloaded
- crmd: determine restart/private digests correctly
- systemd: add TasksMax comment to pacemaker_remote unit (bsc#1028138, bsc#1066710)
- tools: make regression test insensitive to line number changes
- pengine,tools,libpe_status: avoid unnecessary use of pe_find_current
- pacemaker.service: Recommend not to limit tasks (bsc#1028138, bsc#1066710)
- tools: set the correct OCF_RESOURCE_INSTANCE env when crm_resource --force-* executes RA
- typo: overriden -> overridden
- portability: the difference of time_t values is given by difftime()
- pengine: avoid not-really-possible use-of-NULL
- PE: Have bundles log to stderr so that 'journalctl -M' works (rkt)
- tools: don't expect reply to failed send
- pengine: use newer Pacemaker Remote terminology
- pengine: memory leak when writing graph to file
- tools: don't reinvent the glib wheel
- tools: implement clean-up dry-run correctly
- pengine: avoid potential use-of-NULL
- Update regression test outputs
- PE: Improved logging of reasons for stop/restart actions
- PE: Allow all resources to stop prior to probes completing
- PE: Correctly defer processing of resources inside containers
- crm_resource: Ensure we wait for all messages before exiting
- crm_resource: Have cleanup operate only on failures
- PE: Have bundles log to stderr so that 'docker logs' works
- PE: Resources are allowed to stop before their state is known everywhere
- PE: Use the node we already have and know isnt NULL
- PE: Flag resources that are acting as remote nodes
- crmd: Scale all cib operation timeouts
- PE: Bare metal remotes _can_ run resources now and must be probed
- PE: Bundles only need to wait for other containers on the same node to be probed
- crmd: Scale timeouts with the number of remotes too
- PE: There is no need for port mapping directives when net=host is specified
- PE: Do not always expire failed operations of nested remotes
- PE: Consolidate REMOTE_CONTAINER_HACK logic
- PE: Exclude resources and nodes from the symmetric_default constraint in some circumstances
- crm_resource: Don't cleanup on nodes not meeting the discovery conditions
- PE: Restore the ability to send the transition graph via the disk if it gets too big
- crm_resource: Prevent disconnection from crmd during cleanup
- PE: Do not probe connection resources until the container is active
- PE: Detailed resource information should include connection resource state
- Tools: Allow crm_resource to operate on anonymous clones in unknown states
- tools: Clean up everywhere if we don't know anything about the resource
- crm_resource: See what cleanup would have done for a saved configuration
- PE: Only pass requests for promote/demote flags onto the bundle's child
- Upstream version cs: 2b07d5c5a908998891c3317faa30328c108d3a91 (Pacemaker-1.1.18)
-------------------------------------------------------------------
Thu Nov 2 15:15:06 UTC 2017 - ygao@suse.com
- pengine: if ignoring failure, also ignore migration-threshold
- libcrmcommon,liblrmd,lrmd: improve messages for failed remote sends
- libcrmcommon,lrmd: meaningful error codes when sending remote messages
- libcrmcommon: lower watchdog messages when default
- tools: set meta_timeout env when crm_resource --force-* executes RA
- fencing: don't print event twice with stonith_admin --verbose
- fencing: memory leak in stonith_admin --env
- fencing: improve stonith_admin help
- crmd: hard error if remote start fails due to missing key
- libcrmcommon,liblrmd: report meaningful async connection errors
- libcrmcommon: return meaningful error codes to connection callbacks
- libcrmcommon: async connection callback must get negative error codes
- libcrmcommon,liblrmd: improve remote connection messages
- pacemaker_remote: warn if TLS key can't be read at start-up
- lrmd: tweak TLS listener messages
- pengine: don't probe offline or unclean guest nodes
- agents: ifspeed - Try to detect interface name from ip address.
- pengine: don't keep unique instances on same node
- pengine: improve messages when assigning resources to nodes
- Upstream version cs: 23be51236edc34477a99d6979bc0e2cc1e1a7684
-------------------------------------------------------------------
Tue Oct 24 10:29:38 UTC 2017 - ygao@suse.com

View File

@ -25,7 +25,7 @@
## Where to install Pacemaker documentation
%global pcmk_docdir %{_docdir}/%{name}
%global commit 1.1.17+20171023.36d2962a8
%global commit 1.1.18+20171128.53a3fe14b
## Corosync version
%define cs_version 2
@ -66,7 +66,7 @@
%endif
Name: pacemaker
Version: 1.1.17
Version: 1.1.18
Release: 0
Summary: Scalable High-Availability cluster resource manager
# AGPL-3.0 licensed extra/clustermon.sh is not present in the binary
@ -87,8 +87,6 @@ Patch6: pacemaker-Wno-format-signedness.patch
Patch7: bug-943295_pacemaker-lrmd-log-notice.patch
Patch8: bug-977201_pacemaker-controld-self-fencing.patch
Patch9: bug-995365_pacemaker-cts-restart-systemd-journald.patch
Patch10: bug-1028138_pacemaker-pacemaker.service-TasksMax.patch
Patch11: bug-1015842_pacemaker-NodeUtilization-RA.patch
# Required for core functionality
BuildRequires: autoconf
BuildRequires: automake
@ -304,8 +302,6 @@ manager for Corosync, CMAN and/or Linux-HA.
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%build
@ -401,6 +397,8 @@ ln -s service %{buildroot}%{_sbindir}/rccrm_mon
mv %{buildroot}%{_sbindir}/crm_report %{buildroot}%{_sbindir}/crm_report.pacemaker
install -m 755 %{SOURCE1} %{buildroot}%{_sbindir}/crm_report
ln -s ../heartbeat/NodeUtilization %{buildroot}%{_libexecdir}/ocf/resource.d/pacemaker/
%fdupes -s %{buildroot}
%check
@ -519,7 +517,6 @@ fi
%{_libexecdir}/ocf/resource.d/pacemaker/controld
%{_libexecdir}/ocf/resource.d/pacemaker/o2cb
%{_libexecdir}/ocf/resource.d/pacemaker/remote
%{_libexecdir}/ocf/resource.d/.isolation
%if "%{?cs_version}" != "UNKNOWN"
%if 0%{?cs_version} < 2