restart services under pacemaker on controller nodes

Change-Id: I91fdbb9f3d0dab345cb9e29bc76fdbf5b10399f4
This commit is contained in:
Kanzhe Jiang 2015-12-18 14:07:26 -08:00
parent ce2a89b2af
commit f2f2b3f58b
4 changed files with 42 additions and 125 deletions

View File

@ -14,7 +14,7 @@
# under the License.
#
notice('MODULAR: bigswitch/common-repo.pp')
notice('MODULAR: bigswitch common-repo.pp')
class bcf::common-repo {

View File

@ -20,55 +20,6 @@ class bcf::p_only::compute {
# all of the exec statements use this path
$binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin"
$ifcfg_bond0 = "/etc/network/interfaces.d/ifcfg-bond0"
$sys_desc_lacp = "5c:16:c7:00:00:04"
$sys_desc_xor = "5c:16:c7:00:00:00"
if $bcf::bond {
# ensure bond-mode is 802.3ad
exec { "ensure ${bcf::bond_lacp} in $ifcfg_bond0":
command => "echo '${bcf::bond_lacp}' >> $ifcfg_bond0",
unless => "grep -qe '${bcf::bond_lacp}' -- $ifcfg_bond0",
path => "/bin:/usr/bin",
require => Exec["update bond-mode in $ifcfg_bond0"],
}
exec { "update bond-mode in $ifcfg_bond0":
command => "sed -i 's/bond-mode.*/${bcf::bond_lacp}/' $ifcfg_bond0",
path => "/bin:/usr/bin"
}
$sys_desc = $bcf::sys_desc_lacp
}
else {
$sys_desc = $bcf::sys_desc_xor
}
# lldp
$a = file('/etc/fuel/plugins/fuel-plugin-bigswitch-1.0/python_scripts/send_lldp','/dev/null')
if($a != '') {
file { "/bin/send_lldp":
content => $a,
ensure => file,
mode => 0777,
}
}
file { "/etc/init/send_lldp.conf":
ensure => file,
content => "
description \"BCF LLDP\"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
script
exec /bin/send_lldp --system-desc $sys_desc --system-name $(uname -n) -i 10 --network_interface $bcf::itfs
end script
",
}
service { "send_lldp":
ensure => running,
enable => true,
require => [File['/bin/send_lldp'], File['/etc/init/send_lldp.conf']],
}
# edit rc.local for cron job and default gw
file { "/etc/rc.local":
ensure => file,
@ -313,7 +264,7 @@ end script
section => 'DEFAULT',
key_val_separator => '=',
setting => 'novncproxy_base_url',
value => "${bcf::public_vip}:6080/vnc_auto.html",
value => "http://${bcf::public_vip}:6080/vnc_auto.html",
notify => Service['nova-compute']
}
}

View File

@ -28,6 +28,19 @@ class bcf::p_only::controller {
require => Package['python-pip']
}
exec { 'restart neutron-dhcp-agent':
command => 'crm resource restart p_neutron-dhcp-agent',
path => '/usr/local/bin/:/bin/:/usr/sbin',
}
exec { 'restart neutron-l3-agent':
command => 'crm resource restart p_neutron-l3-agent',
path => '/usr/local/bin/:/bin/:/usr/sbin',
}
exec { 'restart neutron-plugin-openvswitch-agent':
command => 'crm resource restart p_neutron-plugin-openvswitch-agent',
path => '/usr/local/bin/:/bin/:/usr/sbin',
}
# purge bcf controller public key
exec { 'purge bcf key':
command => "rm -rf /etc/neutron/plugins/ml2/host_certs/*",
@ -43,7 +56,8 @@ class bcf::p_only::controller {
key_val_separator => '=',
setting => 'report_interval',
value => '60',
notify => Service['neutron-server', 'neutron-plugin-openvswitch-agent', 'neutron-l3-agent', 'neutron-dhcp-agent'],
notify => [Exec['restart neutron-plugin-openvswitch-agent', 'restart neutron-l3-agent', 'restart neutron-dhcp-agent'], Service['neutron-server']],
# notify => Service['neutron-server'],
}
ini_setting { "neutron.conf agent_down_time":
ensure => present,
@ -52,7 +66,7 @@ class bcf::p_only::controller {
key_val_separator => '=',
setting => 'agent_down_time',
value => '150',
notify => Service['neutron-server', 'neutron-plugin-openvswitch-agent', 'neutron-l3-agent', 'neutron-dhcp-agent'],
notify => [Exec['restart neutron-plugin-openvswitch-agent', 'restart neutron-l3-agent', 'restart neutron-dhcp-agent'], Service['neutron-server']],
}
ini_setting { "neutron.conf service_plugins":
ensure => present,
@ -72,6 +86,15 @@ class bcf::p_only::controller {
value => '1',
notify => Service['neutron-server'],
}
ini_setting { "neutron.conf network_scheduler_driver":
ensure => present,
path => '/etc/neutron/neutron.conf',
section => 'DEFAULT',
key_val_separator => '=',
setting => 'network_scheduler_driver',
value => 'neutron.scheduler.dhcp_agent_scheduler.WeightScheduler',
notify => Service['neutron-server'],
}
ini_setting { "neutron.conf notification driver":
ensure => present,
path => '/etc/neutron/neutron.conf',
@ -125,7 +148,7 @@ class bcf::p_only::controller {
key_val_separator => '=',
setting => 'enable_metadata_proxy',
value => 'False',
notify => Service['neutron-l3-agent'],
notify => Exec['restart neutron-l3-agent'],
}
ini_setting { "l3 agent external network bridge":
ensure => present,
@ -134,7 +157,7 @@ class bcf::p_only::controller {
key_val_separator => '=',
setting => 'external_network_bridge',
value => '',
notify => Service['neutron-l3-agent'],
notify => Exec['restart neutron-l3-agent'],
}
ini_setting { "l3 agent handle_internal_only_routers":
ensure => present,
@ -143,7 +166,7 @@ class bcf::p_only::controller {
key_val_separator => '=',
setting => 'handle_internal_only_routers',
value => 'True',
notify => Service['neutron-l3-agent'],
notify => Exec['restart neutron-l3-agent'],
}
# config /etc/neutron/plugins/ml2/ml2_conf.ini
@ -289,27 +312,11 @@ class bcf::p_only::controller {
notify => Service['neutron-server'],
}
# heat-engine, neutron-server, neutron-dhcp-agent and neutron-metadata-agent
service { 'heat-engine':
ensure => running,
enable => true,
}
# neutron-server, keystone
service { 'neutron-server':
ensure => running,
enable => true,
}
service { 'neutron-plugin-openvswitch-agent':
ensure => running,
enable => true,
}
service { 'neutron-l3-agent':
ensure => running,
enable => true,
}
service { 'neutron-dhcp-agent':
ensure => running,
enable => true,
}
service { 'keystone':
ensure => running,
enable => true,

View File

@ -11,16 +11,16 @@
puppet_manifest: puppet/manifests/common-repo.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: primary-controller-lacp-bond
- id: lacp-bond
type: puppet
groups: [primary-controller, controller]
groups: [primary-controller, controller, compute, ceph-osd]
required_for: [openstack-controller, connectivity_tests]
requires: [netconfig]
parameters:
puppet_manifest: puppet/manifests/controller-network-config.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: primary-controller-cleanup
- id: controller-cleanup
type: puppet
role: [primary-controller]
required_for: [post_deployment_end]
@ -29,25 +29,15 @@
puppet_manifest: puppet/manifests/purge-os.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: openstack-primary-controller-bigswitch
type: puppet
role: [primary-controller]
required_for: [post_deployment_end]
requires: [primary-controller-cleanup]
parameters:
puppet_manifest: puppet/manifests/controller-config.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: openstack-controller-bigswitch
type: puppet
role: [controller]
role: [primary-controller, controller]
required_for: [post_deployment_end]
requires: [post_deployment_start]
requires: [controller-cleanup]
parameters:
puppet_manifest: puppet/manifests/controller-config.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
# Setup compute node
- id: compute-config
type: puppet
role: [compute]
@ -57,43 +47,12 @@
puppet_manifest: puppet/manifests/compute-config.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: ceph-config
type: puppet
role: [ceph-osd]
required_for: [post_deployment_end]
requires: [post_deployment_start]
parameters:
puppet_manifest: puppet/manifests/ceph-config.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
#- id: fuel-plugin-bigswitch-deployment-puppet
# type: puppet
# groups: [fuel-plugin-bigswitch]
# required_for: [deploy_end]
# requires: [deploy_start]
# parameters:
# puppet_manifest: "deploy.pp"
# puppet_modules: ""
# timeout: 3600
#
#- id: fuel-plugin-bigswitch-post-deployment-sh
# Reboot compute nodes, so they pick new network configuration
#- id: compute-reboot
# type: shell
# role: [fuel-plugin-bigswitch]
# role: [compute]
# required_for: [post_deployment_end]
# requires: [post_deployment_start]
# requires: [compute-config]
# parameters:
# cmd: echo post_deployment_task_executed > /tmp/post_deployment
# retries: 3
# interval: 20
# timeout: 180
#
#- id: fuel-plugin-bigswitch-pre-deployment-sh
# type: shell
# role: [fuel-plugin-bigswitch]
# required_for: [pre_deployment_end]
# requires: [pre_deployment_start]
# parameters:
# cmd: echo pre_deployment_task_executed > /tmp/pre_deployment
# retries: 3
# interval: 20
# timeout: 180
# cmd: /sbin/reboot;
# timeout: 720