mon_host workaround, optional multi_host, nrep-external-master sub.

Merged lp:~aglenyoung/charms/precise/nova-compute/optional-multi_host.
This commit is contained in:
Adam Gandelman 2013-03-05 09:34:40 -08:00
commit 064de70e16
5 changed files with 33 additions and 5 deletions

View File

@ -38,6 +38,10 @@ options:
default: kvm
type: string
description: "Virtualization flavor. Supported: kvm, xen, uml, lxc. qemu"
multi-host:
default: "yes"
type: string
description: Whether to run nova-api and nova-network on the compute nodes.
# needed if using flatmanager
bridge-interface:
default: br100
@ -60,3 +64,13 @@ options:
default: None
type: string
description: Comma separated list of key=value config flags to be set in nova.conf.
nagios_context:
default: "juju"
type: string
description: |
Used by the nrpe-external-master subordinate charm.
A string that will be prepended to instance name to set the host name
in nagios. So for instance the hostname would be something like:
juju-myservice-0
If you're running multiple environments with the same services in them
this allows you to differentiate between them.

View File

@ -7,6 +7,7 @@ CONF_DIR="/etc/nova"
NOVA_CONF=$(config-get nova-config)
API_CONF="/etc/nova/api-paste.ini"
QUANTUM_CONF="/etc/quantum/quantum.conf"
MULTI_HOST=$(config-get multi-host)
if [ -f /etc/nova/nm.conf ]; then
NET_MANAGER=$(cat /etc/nova/nm.conf)
@ -28,7 +29,9 @@ case $NET_MANAGER in
esac
;;
"FlatManager"|"FlatDHCPManager")
SERVICES="$SERVICES nova-api nova-network"
if [[ "$MULTI_HOST" == "yes" ]] ; then
SERVICES="$SERVICES nova-api nova-network"
fi
;;
esac
@ -102,8 +105,10 @@ function configure_network_manager {
case $net_manager in
"FlatManager"|"FlatDHCPManager")
apt-get -y install nova-api nova-network
SERVICES="$SERVICES nova-api nova-network"
if [[ "$MULTI_HOST" == "yes" ]] ; then
apt-get -y install nova-api nova-network
SERVICES="$SERVICES nova-api nova-network"
fi
;;&
"FlatManager")
local bridge_ip=$(config-get bridge-ip)

View File

@ -9,6 +9,7 @@ else
fi
function install_hook {
[ -d exec.d ] && ( for f in exec.d/*/charm-pre-install; do [ -x $f ] && /bin/sh -c "$f";done )
local virt_type=$(config-get virt-type)
local compute_pkg=$(determine_compute_package "$virt_type")
apt-get -y install python-software-properties || exit 1
@ -20,6 +21,10 @@ function install_hook {
configure_libvirt
}
function upgrade_hook {
[ -d exec.d ] && ( for f in exec.d/*/charm-pre-install; do [ -x $f ] && /bin/sh -c "$f";done )
}
function config_changed() {
# Determine whether or not we should do an upgrade, based on whether or not
@ -203,7 +208,7 @@ function ceph_changed {
MONS=`relation-list`
mon_hosts=""
for mon in $MONS; do
mon_hosts="$mon_hosts `relation-get private-address $mon`:6789"
mon_hosts="$mon_hosts $(get_ip $(relation-get private-address $mon)):6789"
done
cat > /etc/ceph/ceph.conf << EOF
[global]
@ -234,6 +239,7 @@ EOF
case $ARG0 in
"install") install_hook ;;
"upgrade-charm") upgrade_hook ;;
"start"|"stop") exit 0 ;;
"config-changed") config_changed ;;
"amqp-relation-joined") amqp_joined ;;

View File

@ -8,6 +8,9 @@ description: |
provides:
cloud-compute:
interface: nova-compute
nrpe-external-master:
interface: nrpe-external-master
scope: container
requires:
shared-db:
interface: mysql-shared

View File

@ -1 +1 @@
80
81