port to monitoring cookbook
This commit is contained in:
parent
1256938677
commit
5e84af845d
|
@ -10,6 +10,6 @@ version "1.0.7"
|
||||||
supports os
|
supports os
|
||||||
end
|
end
|
||||||
|
|
||||||
%w{ apt collectd-graphite database glance keystone mysql openssh rabbitmq selinux osops-utils monit sysctl }.each do |dep|
|
%w{ apt database glance keystone mysql openssh rabbitmq selinux osops-utils sysctl }.each do |dep|
|
||||||
depends dep
|
depends dep
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: api-ec2-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "nova-api-ec2" do
|
|
||||||
process_name "nova-api-ec2"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["api_ec2_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["api_ec2_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)
|
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
platform_options=node["nova"]["platform"]
|
platform_options=node["nova"]["platform"]
|
||||||
|
|
||||||
|
@ -49,6 +50,14 @@ service "nova-api-ec2" do
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
monitoring_procmon "nova-api-ec2" do
|
||||||
|
service_name = platform_options["api_ec2_service"]
|
||||||
|
|
||||||
|
process_name "nova-api_ec2"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
|
|
||||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||||
keystone = get_settings_by_role("keystone","keystone")
|
keystone = get_settings_by_role("keystone","keystone")
|
||||||
|
@ -137,6 +146,3 @@ keystone_register "Register Compute Endpoint" do
|
||||||
endpoint_publicurl ec2_public_endpoint["uri"]
|
endpoint_publicurl ec2_public_endpoint["uri"]
|
||||||
action :create_endpoint
|
action :create_endpoint
|
||||||
end
|
end
|
||||||
|
|
||||||
# Include recipe(nova::api-ec2-monitoring)
|
|
||||||
include_recipe "nova::api-ec2-monitoring"
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: api-metadata-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "nova-api-metadata" do
|
|
||||||
process_name "nova-api-metadata"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["nova_api_metadata_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["nova_api_metadata_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -18,6 +18,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
platform_options = node["nova"]["platform"]
|
platform_options = node["nova"]["platform"]
|
||||||
|
|
||||||
|
@ -46,6 +47,14 @@ service "nova-api-metadata" do
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
monitoring_procmon "nova-api-metadata" do
|
||||||
|
service_name = platform_options["nova_api_metadata_service"]
|
||||||
|
|
||||||
|
process_name "nova-api-metadata"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
|
|
||||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||||
keystone = get_settings_by_role("keystone","keystone")
|
keystone = get_settings_by_role("keystone","keystone")
|
||||||
|
@ -64,6 +73,3 @@ template "/etc/nova/api-paste.ini" do
|
||||||
)
|
)
|
||||||
notifies :restart, resources(:service => "nova-api-metadata"), :delayed
|
notifies :restart, resources(:service => "nova-api-metadata"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
# Include recipe(nova::api-metadata-monitoring)
|
|
||||||
include_recipe "nova::api-metadata-monitoring"
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: api-os-compute-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "nova-api-os-compute" do
|
|
||||||
process_name "nova-api-os-compute"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["api_os_compute_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["api_os_compute_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)
|
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
# Set a secure keystone service password
|
# Set a secure keystone service password
|
||||||
node.set_unless['nova']['service_pass'] = secure_password
|
node.set_unless['nova']['service_pass'] = secure_password
|
||||||
|
@ -50,6 +51,14 @@ service "nova-api-os-compute" do
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
monitoring_procmon "nova-api-os-compute" do
|
||||||
|
service_name=platform_options["api_os_compute_service"]
|
||||||
|
|
||||||
|
process_name "nova-api-os-compute"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
|
|
||||||
keystone = get_settings_by_role("keystone", "keystone")
|
keystone = get_settings_by_role("keystone", "keystone")
|
||||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||||
|
@ -137,6 +146,3 @@ keystone_register "Register Compute Endpoint" do
|
||||||
endpoint_publicurl nova_api_endpoint["uri"]
|
endpoint_publicurl nova_api_endpoint["uri"]
|
||||||
action :create_endpoint
|
action :create_endpoint
|
||||||
end
|
end
|
||||||
|
|
||||||
# Include recipe(nova::api-os-compute-monitoring)
|
|
||||||
include_recipe "nova::api-os-compute-monitoring"
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: api-os-volume-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "nova-api-os-volume" do
|
|
||||||
process_name "nova-api-os-volume"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["api_os_volume_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["api_os_volume_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -18,6 +18,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
platform_options = node["nova"]["platform"]
|
platform_options = node["nova"]["platform"]
|
||||||
|
|
||||||
|
@ -46,6 +47,14 @@ service "nova-api-os-volume" do
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
monitoring_procmon "nova-api-os-volume" do
|
||||||
|
service_name=platform_options["api_os_volume_service"]
|
||||||
|
|
||||||
|
process_name "api-os-volume-service"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
|
|
||||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||||
keystone = get_settings_by_role("keystone","keystone")
|
keystone = get_settings_by_role("keystone","keystone")
|
||||||
|
@ -64,6 +73,3 @@ template "/etc/nova/api-paste.ini" do
|
||||||
)
|
)
|
||||||
notifies :restart, resources(:service => "nova-api-os-volume"), :delayed
|
notifies :restart, resources(:service => "nova-api-os-volume"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
# Include recipe(nova::api-os-volume-monitoring)
|
|
||||||
include_recipe "nova::api-os-volume-monitoring"
|
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: compute-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "nova-compute" do
|
|
||||||
process_name "nova-compute"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["nova_compute_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["nova_compute_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -20,6 +20,7 @@
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
include_recipe "nova::api-metadata"
|
include_recipe "nova::api-metadata"
|
||||||
include_recipe "nova::network"
|
include_recipe "nova::network"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
platform_options = node["nova"]["platform"]
|
platform_options = node["nova"]["platform"]
|
||||||
nova_compute_packages = platform_options["nova_compute_packages"]
|
nova_compute_packages = platform_options["nova_compute_packages"]
|
||||||
|
@ -52,12 +53,16 @@ service "nova-compute" do
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
monitoring_procmon "nova-compute" do
|
||||||
|
service_name=platform_options["nova_compute_service"]
|
||||||
|
|
||||||
|
process_name "nova-compute"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_naem} stop"
|
||||||
|
end
|
||||||
|
|
||||||
include_recipe "nova::libvirt"
|
include_recipe "nova::libvirt"
|
||||||
|
|
||||||
# Include recipe(nova::compute-monitoring)
|
|
||||||
include_recipe "nova::compute-monitoring"
|
|
||||||
|
|
||||||
|
|
||||||
# Sysctl tunables
|
# Sysctl tunables
|
||||||
sysctl_multi "nova" do
|
sysctl_multi "nova" do
|
||||||
instructions "net.ipv4.ip_forward" => "1"
|
instructions "net.ipv4.ip_forward" => "1"
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: libvirt-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN COLLECTD SECTION
|
|
||||||
# Allow for enable/disable of collectd
|
|
||||||
if get_settings_by_role("collectd-server", "roles") and node["roles"].include?("collectd-client")
|
|
||||||
include_recipe "collectd-graphite::collectd-client"
|
|
||||||
|
|
||||||
# Figure out which connection type to use for libvirt
|
|
||||||
nova = get_settings_by_role("single-compute", "nova")
|
|
||||||
if nova["libvirt"]["virt_type"] == "qemu"
|
|
||||||
virt_conn = "qemu:///system"
|
|
||||||
else
|
|
||||||
# TODO(shep): Not sure this is the right one
|
|
||||||
virt_conn = "kvm:///"
|
|
||||||
end
|
|
||||||
|
|
||||||
collectd_plugin "libvirt" do
|
|
||||||
template "collectd-plugin-libvirt.conf.erb"
|
|
||||||
cookbook "nova"
|
|
||||||
options(
|
|
||||||
"Connection"=>virt_conn,
|
|
||||||
"HostnameFormat"=>"name",
|
|
||||||
"RefreshInterval"=>60
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "libvirt-bin" do
|
|
||||||
process_name "libvirtd"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["libvirt_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["libvirt_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -2,6 +2,22 @@
|
||||||
# Cookbook Name:: openstack
|
# Cookbook Name:: openstack
|
||||||
# Recipe:: libvirt
|
# Recipe:: libvirt
|
||||||
#
|
#
|
||||||
|
# Copyright 2012, Rackspace Hosting, Inc.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
#
|
||||||
|
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
platform_options = node["nova"]["platform"]
|
platform_options = node["nova"]["platform"]
|
||||||
|
|
||||||
|
@ -28,6 +44,14 @@ service "libvirt-bin" do
|
||||||
action :enable
|
action :enable
|
||||||
end
|
end
|
||||||
|
|
||||||
|
monitoring_procmon "libvirt-bin" do
|
||||||
|
service_name=platform_options["libvirt_service"]
|
||||||
|
|
||||||
|
process_name "libvirtd"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
|
|
||||||
directory "/var/lib/nova/.ssh" do
|
directory "/var/lib/nova/.ssh" do
|
||||||
owner "nova"
|
owner "nova"
|
||||||
group "nova"
|
group "nova"
|
||||||
|
@ -98,5 +122,4 @@ template "/etc/default/libvirt-bin" do
|
||||||
notifies :restart, resources(:service => "libvirt-bin"), :immediately
|
notifies :restart, resources(:service => "libvirt-bin"), :immediately
|
||||||
end
|
end
|
||||||
|
|
||||||
# Include recipe(nova::libvirt-monitoring)
|
monitoring_metric "libvirt"
|
||||||
include_recipe "nova::libvirt-monitoring"
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: network-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "nova-network" do
|
|
||||||
process_name "nova-network"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["nova_network_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["nova_network_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -18,6 +18,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
platform_options = node["nova"]["platform"]
|
platform_options = node["nova"]["platform"]
|
||||||
|
|
||||||
|
@ -35,5 +36,10 @@ service "nova-network" do
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
# Include recipe(nova::network-monitoring)
|
monitoring_procmon "nova-network" do
|
||||||
include_recipe "nova::network-monitoring"
|
service_name=platform_options["nova_network_service"]
|
||||||
|
|
||||||
|
process_name "nova-network"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Cookbook Name:: nova
|
# Cookbook Name:: nova
|
||||||
# Recipe:: nova-db-monitoring
|
# Recipe:: nova-db-monitoring
|
||||||
#
|
#
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
# Copyright 2012, Rackspace Hosting, Inc.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
@ -17,17 +17,23 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
########################################
|
include_recipe "osops-utils"
|
||||||
# BEGIN MONIT SECTION
|
include_recipe "monitoring"
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "mysqld" do
|
mysql_info = get_settings_by_role("mysql-master", "mysql")
|
||||||
process_name "mysqld"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["mysql_service"] + " start"
|
monitoring_procmon "mysqld" do
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["mysql_service"] + " stop"
|
service_name = node["nova"]["platform"]["mysql_service"]
|
||||||
end
|
|
||||||
|
process_name "mysqld"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
|
|
||||||
|
monitoring_metric "mysql" do
|
||||||
|
host mysql_info["bind_address"]
|
||||||
|
user node["nova"]["db"]["username"]
|
||||||
|
password node["nova"]["db"]["password"]
|
||||||
|
port 3306
|
||||||
|
db "nova"
|
||||||
end
|
end
|
||||||
########################################
|
|
||||||
|
|
|
@ -1,80 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: nova-setup-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
# We'll intentionally split the monitoring recipe from the stock
|
|
||||||
# nova recipe, in case there are other monitoring systems besides
|
|
||||||
# collectd that people want to integrate.
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN COLLECTD SECTION
|
|
||||||
# Allow for enable/disable of collectd
|
|
||||||
if get_settings_by_role("collectd-server", "roles") and node["roles"].include?("collectd-client")
|
|
||||||
include_recipe "collectd-graphite::collectd-client"
|
|
||||||
|
|
||||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone","service-api")
|
|
||||||
keystone = get_settings_by_role("keystone", "keystone")
|
|
||||||
keystone_admin_user = keystone["admin_user"]
|
|
||||||
keystone_admin_password = keystone["users"][keystone_admin_user]["password"]
|
|
||||||
keystone_admin_tenant = keystone["users"][keystone_admin_user]["default_tenant"]
|
|
||||||
mysql_info = get_settings_by_role("mysql-master", "mysql")
|
|
||||||
|
|
||||||
# run through each role and find the db usernames and passwords
|
|
||||||
db_options = {}
|
|
||||||
rolemap = {
|
|
||||||
"keystone" => "keystone",
|
|
||||||
"glance-registry" => "glance",
|
|
||||||
"horizon-server" => "horizon",
|
|
||||||
"nova-setup" => "nova"
|
|
||||||
}
|
|
||||||
|
|
||||||
rolemap.each_pair do |role, key|
|
|
||||||
attrs = get_settings_by_role(role, key)
|
|
||||||
if attrs
|
|
||||||
db_options[attrs["db"]["name"]] = {
|
|
||||||
:host => mysql_info["bind_address"],
|
|
||||||
:user => attrs["db"]["username"],
|
|
||||||
:password => attrs["db"]["password"],
|
|
||||||
:master_stats => false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
collectd_plugin "mysql" do
|
|
||||||
template "collectd-plugin-mysql.conf.erb"
|
|
||||||
cookbook "nova"
|
|
||||||
options :databases => db_options
|
|
||||||
end
|
|
||||||
|
|
||||||
cookbook_file File.join(node['collectd']['plugin_dir'], "nova_plugin.py") do
|
|
||||||
source "nova_plugin.py"
|
|
||||||
owner "root"
|
|
||||||
group "root"
|
|
||||||
mode "0644"
|
|
||||||
end
|
|
||||||
|
|
||||||
collectd_python_plugin "nova_plugin" do
|
|
||||||
options(
|
|
||||||
"Username"=>keystone_admin_user,
|
|
||||||
"Password"=>keystone_admin_password,
|
|
||||||
"TenantName"=>keystone_admin_tenant,
|
|
||||||
"AuthURL"=>ks_service_endpoint["uri"]
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -19,12 +19,6 @@
|
||||||
|
|
||||||
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)
|
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)
|
||||||
|
|
||||||
# FIXME: we need a better identifier that we want to collect
|
|
||||||
# collectd/graphite info
|
|
||||||
if get_settings_by_role("collectd-server", "roles")
|
|
||||||
include_recipe "nova::nova-setup-monitoring"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Allow for using a well known db password
|
# Allow for using a well known db password
|
||||||
if node["developer_mode"]
|
if node["developer_mode"]
|
||||||
node.set_unless["nova"]["db"]["password"] = "nova"
|
node.set_unless["nova"]["db"]["password"] = "nova"
|
||||||
|
@ -34,6 +28,13 @@ end
|
||||||
|
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
include_recipe "mysql::client"
|
include_recipe "mysql::client"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
|
ks_service_endpoint = get_access_endpoint("keystone", "keystone","service-api")
|
||||||
|
keystone = get_settings_by_role("keystone", "keystone")
|
||||||
|
keystone_admin_user = keystone["admin_user"]
|
||||||
|
keystone_admin_password = keystone["users"][keystone_admin_user]["password"]
|
||||||
|
keystone_admin_tenant = keystone["users"][keystone_admin_user]["default_tenant"]
|
||||||
|
|
||||||
#creates db and user
|
#creates db and user
|
||||||
#function defined in osops-utils/libraries
|
#function defined in osops-utils/libraries
|
||||||
|
@ -63,3 +64,12 @@ if node.has_key?(:floating) and node["nova"]["network"]["floating"].has_key?(:ip
|
||||||
not_if "nova-manage floating list"
|
not_if "nova-manage floating list"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
monitoring_metric "nova-plugin" do
|
||||||
|
type "pyscript"
|
||||||
|
script "nova_plugin.py"
|
||||||
|
options("Username" => keystone_admin_user,
|
||||||
|
"Password" => keystone_admin_password,
|
||||||
|
"TenantName" => keystone_admin_tenant,
|
||||||
|
"AuthURL" => ks_service_endpoint["uri"])
|
||||||
|
end
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: scheduler-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "nova-scheduler" do
|
|
||||||
process_name "nova-scheduler"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["nova_scheduler_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["nova_scheduler_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -18,6 +18,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
platform_options = node["nova"]["platform"]
|
platform_options = node["nova"]["platform"]
|
||||||
|
|
||||||
|
@ -42,5 +43,10 @@ service "nova-scheduler" do
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
# Include recipe(nova::scheduler-monitoring)
|
monitoring_procmon "nova-scheduler" do
|
||||||
include_recipe "nova::scheduler-monitoring"
|
service_name=platform_options["nova_scheduler_service"]
|
||||||
|
|
||||||
|
process_name "nova-scheduler"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: consoleauth-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "nova-consoleauth" do
|
|
||||||
process_name "nova-consoleauth"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["nova_vncproxy_consoleauth_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["nova_vncproxy_consoleauth_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -18,6 +18,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
platform_options = node["nova"]["platform"]
|
platform_options = node["nova"]["platform"]
|
||||||
|
|
||||||
|
@ -51,6 +52,14 @@ when "ubuntu","debian"
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
monitoring_procmon "nova-vncproxy" do
|
||||||
|
service_name=platform_options["nova_vncproxy_service"]
|
||||||
|
|
||||||
|
process_name "nova-vncproxy"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
|
|
||||||
service "nova-consoleauth" do
|
service "nova-consoleauth" do
|
||||||
# TODO(breu): remove the platform specifier when fedora fixes their vncproxy package
|
# TODO(breu): remove the platform specifier when fedora fixes their vncproxy package
|
||||||
service_name platform_options["nova_vncproxy_consoleauth_service"]
|
service_name platform_options["nova_vncproxy_consoleauth_service"]
|
||||||
|
@ -59,6 +68,11 @@ when "ubuntu","debian"
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
# Include recipe(nova::vncproxy-monitoring)
|
monitoring_procmon "nova-consoleauth" do
|
||||||
include_recipe "nova::vncproxy-monitoring"
|
service_name=platform_options["nova_vncproxy_consoleauth_service"]
|
||||||
|
|
||||||
|
process_name "nova-consoleauth"
|
||||||
|
start_cmd "/usr/sbin/service #{service_name} start"
|
||||||
|
stop_cmd "/usr/sbin/service #{service_name} stop"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
#
|
|
||||||
# Cookbook Name:: nova
|
|
||||||
# Recipe:: volume-monitoring
|
|
||||||
#
|
|
||||||
# Copyright 2009, Rackspace Hosting, Inc.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# BEGIN MONIT SECTION
|
|
||||||
# Allow for enable/disable of monit
|
|
||||||
if node["enable_monit"]
|
|
||||||
include_recipe "monit::server"
|
|
||||||
platform_options = node["nova"]["platform"]
|
|
||||||
|
|
||||||
monit_procmon "nova-volume" do
|
|
||||||
process_name "nova-volume"
|
|
||||||
start_cmd "/usr/sbin/service " + platform_options["nova_volume_service"] + " start"
|
|
||||||
stop_cmd "/usr/sbin/service " + platform_options["nova_volume_service"] + " stop"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
########################################
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
include_recipe "nova::nova-common"
|
include_recipe "nova::nova-common"
|
||||||
include_recipe "nova::api-os-volume"
|
include_recipe "nova::api-os-volume"
|
||||||
|
include_recipe "monitoring"
|
||||||
|
|
||||||
platform_options = node["nova"]["platform"]
|
platform_options = node["nova"]["platform"]
|
||||||
|
|
||||||
|
@ -26,6 +27,17 @@ service "nova-volume" do
|
||||||
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
subscribes :restart, resources(:template => "/etc/nova/nova.conf"), :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO(rp): need the flag on whether or not to start nova-volume service
|
||||||
|
# this is already on backlog
|
||||||
|
# monitoring_procmon "nova-volume" do
|
||||||
|
# service_name=platform_options["nova_volume_service"]
|
||||||
|
|
||||||
|
# process_name "nova-volume"
|
||||||
|
# start_cmd "/usr/sbin/service #{service_naem} start"
|
||||||
|
# stop_cmd "/usr/sbin/service #{service_naem} stop"
|
||||||
|
# end
|
||||||
|
|
||||||
|
|
||||||
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
ks_admin_endpoint = get_access_endpoint("keystone", "keystone", "admin-api")
|
||||||
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
ks_service_endpoint = get_access_endpoint("keystone", "keystone", "service-api")
|
||||||
keystone = get_settings_by_role("keystone","keystone")
|
keystone = get_settings_by_role("keystone","keystone")
|
||||||
|
@ -58,6 +70,3 @@ keystone_register "Register Volume Endpoint" do
|
||||||
endpoint_publicurl volume_endpoint["uri"]
|
endpoint_publicurl volume_endpoint["uri"]
|
||||||
action :create_endpoint
|
action :create_endpoint
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO(shep): Commenting out until we add volume support"
|
|
||||||
# include_recipe "nova::volume-monitoring"
|
|
||||||
|
|
Loading…
Reference in New Issue