Merge lp:~jseutter/charms/precise/nova-cloud-controller/ha-support-with-health into lp:~openstack-charmers/charms/precise/nova-cloud-controller/ha-support

Proposed by Jerry Seutter
Status: Merged
Merged at revision: 67
Proposed branch: lp:~jseutter/charms/precise/nova-cloud-controller/ha-support-with-health
Merge into: lp:~openstack-charmers/charms/precise/nova-cloud-controller/ha-support
Diff against target: 80 lines (+42/-1)
6 files modified
hooks/nova-cloud-controller-relations (+11/-0)
revision (+1/-1)
scripts/add_to_cluster (+2/-0)
scripts/health_checks.d/service_ports_live (+13/-0)
scripts/health_checks.d/service_running (+13/-0)
scripts/remove_from_cluster (+2/-0)
To merge this branch: bzr merge lp:~jseutter/charms/precise/nova-cloud-controller/ha-support-with-health
Reviewer Review Type Date Requested Status
Chad Smith Pending
Adam Gandelman Pending
Review via email: mp+154528@code.launchpad.net

Description of the change

This branch adds add_to_cluster, remove_from_cluster and health_scripts.d to the nova-cloud-controller charm.

The health scripts check the following things:
- The crm multicast port is open
- The nova-api-ec2, nova-api-os-compute, nova-cert, nova-conductor, nova-objectstore and nova-scheduler services are running

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/nova-cloud-controller-relations'
2--- hooks/nova-cloud-controller-relations 2013-03-15 19:08:40 +0000
3+++ hooks/nova-cloud-controller-relations 2013-03-20 21:51:19 +0000
4@@ -76,6 +76,17 @@
5
6 determine_services
7 service_ctl all restart
8+
9+ # Save our scriptrc env variables for health checks
10+ declare -a env_vars=(
11+ "OPENSTACK_PORT_MCASTPORT=$(config-get ha-mcastport)"
12+ 'OPENSTACK_SERVICE_API_EC2=nova-api-ec2'
13+ 'OPENSTACK_SERVICE_API_OS_COMPUTE=nova-api-os-compute'
14+ 'OPENSTACK_SERVICE_CERT=nova-cert'
15+ 'OPENSTACK_SERVICE_CONDUCTOR=nova-conductor'
16+ 'OPENSTACK_SERVICE_OBJECTSTORE=nova-objectstore'
17+ 'OPENSTACK_SERVICE_SCHEDULER=nova-scheduler')
18+ save_script_rc ${env_vars[@]}
19 configure_https
20 }
21
22
23=== modified file 'revision'
24--- revision 2013-03-15 19:08:40 +0000
25+++ revision 2013-03-20 21:51:19 +0000
26@@ -1,1 +1,1 @@
27-238
28+239
29
30=== added directory 'scripts'
31=== added file 'scripts/add_to_cluster'
32--- scripts/add_to_cluster 1970-01-01 00:00:00 +0000
33+++ scripts/add_to_cluster 2013-03-20 21:51:19 +0000
34@@ -0,0 +1,2 @@
35+#!/bin/bash
36+crm node online
37
38=== added directory 'scripts/health_checks.d'
39=== added file 'scripts/health_checks.d/service_ports_live'
40--- scripts/health_checks.d/service_ports_live 1970-01-01 00:00:00 +0000
41+++ scripts/health_checks.d/service_ports_live 2013-03-20 21:51:19 +0000
42@@ -0,0 +1,13 @@
43+#!/bin/bash
44+# Validate that service ports are active
45+HEALTH_DIR=`dirname $0`
46+SCRIPTS_DIR=`dirname $HEALTH_DIR`
47+. $SCRIPTS_DIR/scriptrc
48+set -e
49+
50+# Grab any OPENSTACK_PORT* environment variables
51+openstack_ports=`env| awk -F '=' '(/OPENSTACK_PORT/){print $2}'`
52+for port in $openstack_ports
53+do
54+ netstat -ln | grep -q ":$port "
55+done
56
57=== added file 'scripts/health_checks.d/service_running'
58--- scripts/health_checks.d/service_running 1970-01-01 00:00:00 +0000
59+++ scripts/health_checks.d/service_running 2013-03-20 21:51:19 +0000
60@@ -0,0 +1,13 @@
61+#!/bin/bash
62+# Validate that service is running
63+HEALTH_DIR=`dirname $0`
64+SCRIPTS_DIR=`dirname $HEALTH_DIR`
65+. $SCRIPTS_DIR/scriptrc
66+set -e
67+
68+# Grab any OPENSTACK_SERVICE* environment variables
69+openstack_service_names=`env| awk -F '=' '(/OPENSTACK_SERVICE/){print $2}'`
70+for service_name in $openstack_service_names
71+do
72+ service $service_name status 2>/dev/null | grep -q running
73+done
74
75=== added file 'scripts/remove_from_cluster'
76--- scripts/remove_from_cluster 1970-01-01 00:00:00 +0000
77+++ scripts/remove_from_cluster 2013-03-20 21:51:19 +0000
78@@ -0,0 +1,2 @@
79+#!/bin/bash
80+crm node standby

Subscribers

People subscribed via source and target branches