[openstack-neutron] Added pacemaker OCF resources

Ihar Hrachyshka ihrachyshka at fedoraproject.org
Wed Nov 12 12:29:52 UTC 2014


commit 67a401fdd1a80c633215a0d24f0ade4bebd9ae7a
Author: Ihar Hrachyshka <ihrachys at redhat.com>
Date:   Tue Nov 11 21:20:19 2014 +0100

    Added pacemaker OCF resources

 NetnsCleanup.ocf_ra        |  154 ++++++++++++++++++++++++++++++++++
 NeutronScale.ocf_ra        |  200 ++++++++++++++++++++++++++++++++++++++++++++
 OVSCleanup.ocf_ra          |  154 ++++++++++++++++++++++++++++++++++
 neutron-netns-cleanup.init |   70 +++++++++++++++
 neutron-ovs-cleanup.init   |   67 +++++++++++++++
 openstack-neutron.spec     |   29 ++++++-
 6 files changed, 670 insertions(+), 4 deletions(-)
---
diff --git a/NetnsCleanup.ocf_ra b/NetnsCleanup.ocf_ra
new file mode 100644
index 0000000..747f931
--- /dev/null
+++ b/NetnsCleanup.ocf_ra
@@ -0,0 +1,154 @@
+#!/bin/sh
+#
+#	Neutron Netns Cleanup OCF RA.
+#       Handles the netns cleanup at start / stop of the agent service
+#       group
+#
+# Copyright (c) 2014 Red Hat
+#
+# This is a one-shot OCF resource agent with the next properties:
+#
+# * It wraps the init.d script to make an OCF-RA
+# * It maps the start, stop, monitor to start, stop , status, and provides
+#   the specific OCF ones.
+# * It cleans unused resources during start (system or agents startup)
+# * It cleans everything on stop (agents migration to other hosts)
+# * Once started, it will respond with status = OK
+# * Once stopped, it will respond with status = DEAD
+#
+# 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_NEUTRON_DIR=${OCF_ROOT}/lib/neutron}
+. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
+
+
+WRAPPED_INITD_SCRIPT=${OCF_NEUTRON_DIR}/neutron-netns-cleanup
+
+#######################################################################
+
+meta_data() {
+	cat <<END
+<?xml version="1.0"?>
+<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
+<resource-agent name="NetnsCleanup" version="0.9">
+<version>1.0</version>
+
+<longdesc lang="en">
+This resource agent does nothing during execution, only executes 
+a cleanup during start, and a force cleanup during stop of
+the netns resources generated by neutron agents.
+
+</longdesc>
+<shortdesc lang="en">neutron netns cleanup resource agent</shortdesc>
+
+<parameters>
+</parameters>
+
+<actions>
+<action name="start"        timeout="40" />
+<action name="stop"         timeout="300" />
+<action name="monitor"      timeout="20" interval="10" depth="0" />
+<action name="reload"       timeout="20" />
+<action name="migrate_to"   timeout="20" />
+<action name="migrate_from" timeout="20" />
+<action name="meta-data"    timeout="5" />
+<action name="validate-all"   timeout="20" />
+</actions>
+</resource-agent>
+END
+}
+
+#######################################################################
+
+
+netns_cleanup_usage() {
+	cat <<END
+usage: $0 {start|stop|monitor|migrate_to|migrate_from|validate-all|meta-data}
+
+Expects to have a fully populated OCF RA-compliant environment set.
+END
+}
+
+netns_cleanup_start() {
+    netns_cleanup_monitor
+    if [ $? =  $OCF_SUCCESS ]; then
+	return $OCF_SUCCESS
+    fi
+    $WRAPPED_INITD_SCRIPT start && return $OCF_SUCCESS
+    return $OCF_ERR_GENERIC
+}
+
+netns_cleanup_stop() {
+    netns_cleanup_monitor
+    if [ $? =  $OCF_SUCCESS ]; then
+        $WRAPPED_INITD_SCRIPT stop && return $OCF_SUCCESS
+        return $OCF_ERR_GENERIC
+    fi
+    return $OCF_SUCCESS
+}
+
+netns_cleanup_monitor() {
+	# Monitor _MUST!_ differentiate correctly between running
+	# (SUCCESS), failed (ERROR) or _cleanly_ stopped (NOT RUNNING).
+	# That is THREE states, not just yes/no.
+
+        $WRAPPED_INITD_SCRIPT status && return $OCF_SUCCESS
+	
+        return $OCF_NOT_RUNNING
+}
+
+netns_cleanup_validate() {
+    
+    return $OCF_SUCCESS
+}
+
+case $__OCF_ACTION in
+meta-data)	meta_data
+		exit $OCF_SUCCESS
+		;;
+start)		netns_cleanup_start;;
+stop)		netns_cleanup_stop;;
+monitor)	netns_cleanup_monitor;;
+migrate_to)	ocf_log info "Migrating ${OCF_RESOURCE_INSTANCE} to ${OCF_RESKEY_CRM_meta_migrate_target}."
+	        netns_cleanup_stop
+		;;
+migrate_from)	ocf_log info "Migrating ${OCF_RESOURCE_INSTANCE} from ${OCF_RESKEY_CRM_meta_migrate_source}."
+	        netns_cleanup_start
+		;;
+reload)		ocf_log info "Reloading ${OCF_RESOURCE_INSTANCE} ..."
+		;;
+validate-all)	netns_cleanup_validate;;
+usage|help)	netns_cleanup_usage
+		exit $OCF_SUCCESS
+		;;
+*)		netns_cleanup_usage
+		exit $OCF_ERR_UNIMPLEMENTED
+		;;
+esac
+rc=$?
+ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
+exit $rc
+
diff --git a/NeutronScale.ocf_ra b/NeutronScale.ocf_ra
new file mode 100755
index 0000000..bf93f45
--- /dev/null
+++ b/NeutronScale.ocf_ra
@@ -0,0 +1,200 @@
+#!/bin/bash
+#
+#	Neutron Scale OCF RA.
+#       Handles the dynamic config part of the agent service
+#       group (host entries)
+#
+# Copyright (c) 2014 Red Hat
+#
+# This is a one-shot OCF resource agent with the next properties:
+#
+#
+# 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_NEUTRON_DIR=${OCF_ROOT}/lib/neutron}
+. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
+
+OCF_RESKEY_hostbasename_default=neutron-n
+
+: ${OCF_RESKEY_hostbasename=${OCF_RESKEY_hostbasename_default}}
+
+#######################################################################
+
+meta_data() {
+	cat <<END
+<?xml version="1.0"?>
+<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
+<resource-agent name="neutron-scale" version="0.9">
+<version>1.0</version>
+
+<longdesc lang="en">
+This resource agent sets host parameter in neutron config files to allow
+neutron agents to scale
+
+</longdesc>
+<shortdesc lang="en">neutron host base name resource agent</shortdesc>
+
+<parameters>
+ <parameter name="hostbasename" unique="1" required="0">
+  <longdesc lang="en">
+   neutron host base name
+  </longdesc>
+  <shortdesc lang="en">neutron host base name</shortdesc>
+  <content type="string" default="neutron-n"/>
+ </parameter>
+</parameters>
+
+<actions>
+<action name="start"        timeout="40" />
+<action name="stop"         timeout="300" />
+<action name="monitor"      timeout="20" interval="10" depth="0" />
+<action name="reload"       timeout="20" />
+<action name="migrate_to"   timeout="20" />
+<action name="migrate_from" timeout="20" />
+<action name="meta-data"    timeout="5" />
+<action name="validate-all"   timeout="20" />
+</actions>
+</resource-agent>
+END
+}
+
+#######################################################################
+
+neutronconfigfiles="dhcp_agent.ini fwaas_driver.ini l3_agent.ini lbaas_agent.ini metadata_agent.ini neutron.conf plugins/openvswitch/ovs_neutron_plugin.ini"
+
+neutron_scale_usage() {
+	cat <<END
+usage: $0 {start|stop|monitor|migrate_to|migrate_from|validate-all|meta-data}
+
+Expects to have a fully populated OCF RA-compliant environment set.
+END
+}
+
+neutron_scale_validate() {
+	if [ ! -d /etc/neutron ]; then
+		ocf_log err "neutron-scale can only run on neutron nodes"
+		return $OCF_ERR_INSTALLED
+	fi
+	if [ ! -x $(which openstack-config) ]; then
+		ocf_log err "neutron-scale requires openstack-config"
+		return $OCF_ERR_INSTALLED
+	fi
+	if [ -z ${OCF_RESKEY_CRM_meta_clone_max} ]; then
+		ocf_log err "neutron-scale agent can only be used as globally unique clone resource: meta_clone_max missing"
+		return $OCF_ERR_CONFIGURED
+	fi
+	if [ -z ${OCF_RESKEY_CRM_meta_clone} ]; then
+		ocf_log err "neutron-scale agent can only be used as globally unique clone resource meta_clone missing"
+		return $OCF_ERR_CONFIGURED
+	fi
+	return $OCF_SUCCESS
+}
+
+neutron_scale_start() {
+	hostid=${OCF_RESKEY_hostbasename}-${OCF_RESKEY_CRM_meta_clone}
+	for i in $neutronconfigfiles; do
+		if [ -f "/etc/neutron/$i" ]; then
+			openstack-config --set /etc/neutron/$i DEFAULT host $hostid
+			if [ $? != 0 ]; then
+				ocf_log err "neutron-scale: unable to set host info to $hostid for /etc/neutron/$i"
+				return OCF_ERR_GENERIC
+			else
+				ocf_log info "neutron-scale: host $hostid set for /etc/neutron/$i"
+			fi
+		else
+			ocf_log info "/etc/neutron/$i not installed. skipping"
+		fi
+	done
+	touch ${HA_RSCTMP}/neutron-scale
+	return $OCF_SUCCESS
+}
+
+neutron_scale_stop() {
+	for i in $neutronconfigfiles; do
+		if [ -f "/etc/neutron/$i" ]; then
+			openstack-config --del /etc/neutron/$i DEFAULT host
+			if [ $? != 0 ]; then
+				ocf_log err "neutron-scale: unable to delete host info for /etc/neutron/$i"
+				return OCF_ERR_GENERIC
+			else
+				ocf_log info "neutron-scale: host delete for /etc/neutron/$i"
+			fi
+		else
+			ocf_log info "/etc/neutron/$i not installed. skipping"
+		fi
+	done
+	rm -f ${HA_RSCTMP}/neutron-scale
+	return $OCF_SUCCESS
+}
+
+neutron_scale_monitor() {
+	if [ ! -f ${HA_RSCTMP}/neutron-scale ]; then
+		return $OCF_NOT_RUNNING
+	fi
+	return $OCF_SUCCESS
+}
+
+case $__OCF_ACTION in
+	meta-data)
+		meta_data
+		exit $OCF_SUCCESS
+		;;
+	validate-all)
+		neutron_scale_validate
+		;;
+	start)
+		neutron_scale_validate && neutron_scale_start
+		;;
+	stop)
+		neutron_scale_validate && neutron_scale_stop
+		;;
+	monitor)
+		neutron_scale_monitor
+		;;
+	reload)
+		exit $OCF_SUCCESS
+		;;
+	migrate_to)
+		ocf_log info "Migrating ${OCF_RESOURCE_INSTANCE} to ${OCF_RESKEY_CRM_meta_migrate_target}."
+		exit $OCF_SUCCESS
+		;;
+	migrate_from)
+		ocf_log info "Migrating ${OCF_RESOURCE_INSTANCE} from ${OCF_RESKEY_CRM_meta_migrate_source}."
+		neutron_scale_start
+		;;
+	usage|help)
+		neutron_scale_usage
+		exit $OCF_SUCCESS
+		;;
+	*)
+		neutron_scale_usage
+		exit $OCF_ERR_UNIMPLEMENTED
+		;;
+esac
+rc=$?
+ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
+exit $rc
+
diff --git a/OVSCleanup.ocf_ra b/OVSCleanup.ocf_ra
new file mode 100644
index 0000000..7b4b8a4
--- /dev/null
+++ b/OVSCleanup.ocf_ra
@@ -0,0 +1,154 @@
+#!/bin/sh
+#
+#	Neutron OVS Cleanup OCF RA.
+#       Handles the ovs cleanup at start / stop of the agent service
+#       group
+#
+# Copyright (c) 2014 Red Hat
+#
+# This is a one-shot OCF resource agent with the next properties:
+#
+# * It wraps the init.d script to make an OCF-RA
+# * It maps the start, stop, monitor to start, stop , status, and provides
+#   the specific OCF ones.
+# * It cleans unused resources during start (system or agents startup)
+# * It cleans everything on stop (agents migration to other hosts)
+# * Once started, it will respond with status = OK
+# * Once stopped, it will respond with status = DEAD
+#
+# 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_NEUTRON_DIR=${OCF_ROOT}/lib/neutron}
+. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
+
+
+WRAPPED_INITD_SCRIPT=${OCF_NEUTRON_DIR}/neutron-ovs-cleanup
+
+#######################################################################
+
+meta_data() {
+	cat <<END
+<?xml version="1.0"?>
+<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
+<resource-agent name="OVSCleanup" version="0.9">
+<version>1.0</version>
+
+<longdesc lang="en">
+This resource agent does nothing during execution, only executes 
+a cleanup during start, and a force cleanup during stop of
+the openvswitch resources generated by neutron agents.
+
+</longdesc>
+<shortdesc lang="en">neutron OVS cleanup resource agent</shortdesc>
+
+<parameters>
+</parameters>
+
+<actions>
+<action name="start"        timeout="40" />
+<action name="stop"         timeout="300" />
+<action name="monitor"      timeout="20" interval="10" depth="0" />
+<action name="reload"       timeout="20" />
+<action name="migrate_to"   timeout="20" />
+<action name="migrate_from" timeout="20" />
+<action name="meta-data"    timeout="5" />
+<action name="validate-all"   timeout="20" />
+</actions>
+</resource-agent>
+END
+}
+
+#######################################################################
+
+
+ovs_cleanup_usage() {
+	cat <<END
+usage: $0 {start|stop|monitor|migrate_to|migrate_from|validate-all|meta-data}
+
+Expects to have a fully populated OCF RA-compliant environment set.
+END
+}
+
+ovs_cleanup_start() {
+    ovs_cleanup_monitor
+    if [ $? =  $OCF_SUCCESS ]; then
+	return $OCF_SUCCESS
+    fi
+    $WRAPPED_INITD_SCRIPT start && return $OCF_SUCCESS
+    return $OCF_ERR_GENERIC
+}
+
+ovs_cleanup_stop() {
+    ovs_cleanup_monitor
+    if [ $? =  $OCF_SUCCESS ]; then
+        $WRAPPED_INITD_SCRIPT stop && return $OCF_SUCCESS
+        return $OCF_ERR_GENERIC
+    fi
+    return $OCF_SUCCESS
+}
+
+ovs_cleanup_monitor() {
+	# Monitor _MUST!_ differentiate correctly between running
+	# (SUCCESS), failed (ERROR) or _cleanly_ stopped (NOT RUNNING).
+	# That is THREE states, not just yes/no.
+
+        $WRAPPED_INITD_SCRIPT status && return $OCF_SUCCESS
+	
+        return $OCF_NOT_RUNNING
+}
+
+ovs_cleanup_validate() {
+    
+    return $OCF_SUCCESS
+}
+
+case $__OCF_ACTION in
+meta-data)	meta_data
+		exit $OCF_SUCCESS
+		;;
+start)		ovs_cleanup_start;;
+stop)		ovs_cleanup_stop;;
+monitor)	ovs_cleanup_monitor;;
+migrate_to)	ocf_log info "Migrating ${OCF_RESOURCE_INSTANCE} to ${OCF_RESKEY_CRM_meta_migrate_target}."
+	        ovs_cleanup_stop
+		;;
+migrate_from)	ocf_log info "Migrating ${OCF_RESOURCE_INSTANCE} from ${OCF_RESKEY_CRM_meta_migrate_source}."
+	        ovs_cleanup_start
+		;;
+reload)		ocf_log info "Reloading ${OCF_RESOURCE_INSTANCE} ..."
+		;;
+validate-all)	ovs_cleanup_validate;;
+usage|help)	ovs_cleanup_usage
+		exit $OCF_SUCCESS
+		;;
+*)		ovs_cleanup_usage
+		exit $OCF_ERR_UNIMPLEMENTED
+		;;
+esac
+rc=$?
+ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
+exit $rc
+
diff --git a/neutron-netns-cleanup.init b/neutron-netns-cleanup.init
new file mode 100644
index 0000000..9cf50c9
--- /dev/null
+++ b/neutron-netns-cleanup.init
@@ -0,0 +1,70 @@
+#!/bin/bash
+#
+# neutron-netns-cleanup  OpenStack Neutron netns cleanup utility
+#
+# chkconfig:   - 97 02
+# description: OpenStack Neutron netns cleanup utility
+#
+# This is a one-shot init.d script with the next properties:
+#
+# * It accepts 3 verbs: start, stop, status
+# * It cleans unused resources during start (system or agents startup)
+# * It cleans everything on stop (agents migration to other hosts)
+# * Once started, it will respond with status = OK
+# * Once stopped, it will respond with status = DEAD
+#
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+proj=neutron
+prog=$proj-netns-cleanup
+exec="/usr/bin/$prog"
+configs=(
+    "/usr/share/$proj/$proj-dist.conf" \
+    "/etc/$proj/$proj.conf" \
+    "/etc/$proj/dhcp_agent.ini"
+)
+configs_str=${configs[@]/#/--config-file }
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+clean() {
+    cleanopts="$@"
+    [ -x $exec ] || exit 5
+    for config in ${configs[@]}; do
+        [ -f $config ] || exit 6
+    done
+    runuser -s /bin/bash neutron -c "$exec $cleanopts --log-file /var/log/$proj/netns-cleanup.log $configs_str &>/dev/null"
+    if [ "x$1" == "x--force" ]; then
+	 killall neutron-ns-metadata-proxy 2>/dev/null  || all_dead=1
+    fi
+    return $?
+}
+
+retval=0
+
+case "$1" in
+    start)
+        clean
+        retval=$?
+        [ $retval -eq 0 ] && touch $lockfile
+        ;;
+    stop)
+        clean --force
+        retval=$?
+        [ $retval -eq 0 ] && rm -f $lockfile
+        ;;
+    status)
+        [ ! -f $lockfile ] && retval=3
+        ;;
+    restart|reload|force-reload|status|condrestart|try-restart)
+        # Do nothing
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $retval
diff --git a/neutron-ovs-cleanup.init b/neutron-ovs-cleanup.init
new file mode 100644
index 0000000..9b6906f
--- /dev/null
+++ b/neutron-ovs-cleanup.init
@@ -0,0 +1,67 @@
+#!/bin/bash
+#
+# neutron-ovs-cleanup  OpenStack Open vSwitch cleanup utility
+#
+# chkconfig:   - 97 02
+# description: Purge Open vSwitch of the Neutron devices
+#
+# This is a one-shot init.d script with the next properties:
+#
+# * It accepts 3 verbs: start, stop, status
+# * It cleans unused resources during start (system or agents startup)
+# * It cleans everything on stop (agents migration to other hosts)
+# * Once started, it will respond with status = OK
+# * Once stopped, it will respond with status = DEAD
+#
+### END INIT INFO
+
+. /etc/rc.d/init.d/functions
+
+proj=neutron
+prog=$proj-ovs-cleanup
+exec="/usr/bin/$prog"
+pidfile="/var/run/$proj/$prog.pid"
+configs=(
+    "/usr/share/$proj/$proj-dist.conf" \
+    "/etc/$proj/$proj.conf" \
+    "/etc/$proj/plugins/openvswitch/ovs_neutron_plugin.ini" \
+)
+configs_str=${configs[@]/#/--config-file }
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+clean() {
+    [ -x $exec ] || exit 5
+    for config in ${configs[@]}; do
+        [ -f $config ] || exit 6
+    done
+    runuser -s /bin/bash neutron -c "$exec --log-file /var/log/$proj/ovs-cleanup.log $configs_str &>/dev/null"
+    return $?
+}
+
+retval=0
+
+case "$1" in
+    start)
+        clean
+        retval=$?
+        [ $retval -eq 0 ] && touch $lockfile
+        ;;
+    stop)
+        clean
+        retval=$?
+        [ $retval -eq 0 ] && rm -f $lockfile
+        ;;
+    status)
+        [ ! -f $lockfile ] && retval=3
+        ;;
+    restart|reload|force-reload|condrestart|try-restart)
+        # Do nothing
+        ;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+        exit 2
+esac
+exit $retval
diff --git a/openstack-neutron.spec b/openstack-neutron.spec
index cb4371d..99453db 100644
--- a/openstack-neutron.spec
+++ b/openstack-neutron.spec
@@ -2,7 +2,7 @@
 
 Name:		openstack-neutron
 Version:	2014.2
-Release:	7%{?dist}
+Release:	8%{?dist}
 Provides:	openstack-quantum = %{version}-%{release}
 Obsoletes:	openstack-quantum < 2013.2-0.4.b3
 Summary:	OpenStack Networking Service
@@ -30,8 +30,13 @@ Source22:	neutron-metering-agent.service
 Source23:	neutron-sriov-nic-agent.service
 Source24:	neutron-cisco-cfg-agent.service
 Source25:	neutron-netns-cleanup.service
+Source26:	neutron-netns-cleanup.init
+Source27:	neutron-ovs-cleanup.init
+Source28:	NetnsCleanup.ocf_ra
+Source29:	OVSCleanup.ocf_ra
+Source30:	NeutronScale.ocf_ra
 
-Source30:	neutron-dist.conf
+Source40:	neutron-dist.conf
 #
 # patches_base=+1
 #
@@ -546,7 +551,7 @@ while read name eq value; do
   else
     sed -ri "0,/^(#)? *$name *=/{s!^(#)? *$name *=.*!# $name = $value!}" etc/neutron.conf
   fi
-done < %{SOURCE30}
+done < %{SOURCE40}
 
 %install
 %{__python} setup.py install -O1 --skip-build --root %{buildroot}
@@ -594,6 +599,13 @@ install -p -D -m 644 %{SOURCE23} %{buildroot}%{_unitdir}/neutron-sriov-nic-agent
 install -p -D -m 644 %{SOURCE24} %{buildroot}%{_unitdir}/neutron-cisco-cfg-agent.service
 install -p -D -m 644 %{SOURCE25} %{buildroot}%{_unitdir}/neutron-netns-cleanup.service
 
+# Install scripts for pacemaker support
+install -p -D -m 755 %{SOURCE26} %{buildroot}%{_prefix}/lib/ocf/lib/neutron/neutron-netns-cleanup
+install -p -D -m 755 %{SOURCE27} %{buildroot}%{_prefix}/lib/ocf/lib/neutron/neutron-ovs-cleanup
+install -p -D -m 755 %{SOURCE28} %{buildroot}%{_prefix}/lib/ocf/resource.d/neutron/NetnsCleanup
+install -p -D -m 755 %{SOURCE29} %{buildroot}%{_prefix}/lib/ocf/resource.d/neutron/OVSCleanup
+install -p -D -m 755 %{SOURCE30} %{buildroot}%{_prefix}/lib/ocf/resource.d/neutron/NeutronScale
+
 # Setup directories
 install -d -m 755 %{buildroot}%{_datadir}/neutron
 install -d -m 755 %{buildroot}%{_sharedstatedir}/neutron
@@ -601,7 +613,7 @@ install -d -m 755 %{buildroot}%{_localstatedir}/log/neutron
 install -d -m 755 %{buildroot}%{_localstatedir}/run/neutron
 
 # Install dist conf
-install -p -D -m 640 %{SOURCE30} %{buildroot}%{_datadir}/neutron/neutron-dist.conf
+install -p -D -m 640 %{SOURCE40} %{buildroot}%{_datadir}/neutron/neutron-dist.conf
 
 # Install version info file
 cat > %{buildroot}%{_sysconfdir}/neutron/release <<EOF
@@ -734,6 +746,12 @@ exit 0
 %{_bindir}/neutron-server
 %{_bindir}/neutron-usage-audit
 
+%{_prefix}/lib/ocf/lib/neutron/neutron-netns-cleanup
+%{_prefix}/lib/ocf/lib/neutron/neutron-ovs-cleanup
+%{_prefix}/lib/ocf/resource.d/neutron/NetnsCleanup
+%{_prefix}/lib/ocf/resource.d/neutron/OVSCleanup
+%{_prefix}/lib/ocf/resource.d/neutron/NeutronScale
+
 %{_unitdir}/neutron-dhcp-agent.service
 %{_unitdir}/neutron-l3-agent.service
 %{_unitdir}/neutron-lbaas-agent.service
@@ -958,6 +976,9 @@ exit 0
 
 
 %changelog
+* Tue Nov 11 2014 Ihar Hrachyshka <ihrachys at redhat.com> 2014.2-8
+- Added pacemaker OCF resources
+
 * Tue Nov 11 2014 Ihar Hrachyshka <ihrachys at redhat.com> 2014.2-7
 - don't kill children of agents, rhbz#1063427
 


More information about the scm-commits mailing list