From 8d36b9e670e53570dc876597fb8d160dba9e2b7d Mon Sep 17 00:00:00 2001 From: Dheeraj Gautam Date: Sun, 7 Aug 2016 14:09:13 -0700 Subject: [PATCH] SM-Mitaka/Liberty: restart nova-compute only if compute is there Partial-Bug: #1610726 Currently nova-compute is being restart for all roles even if compute is not there. This causes non-computes nodes to be registered as compute nodes. This possibly causes failures to the launch of more and more VMs. currently sanity run is report many VMs to be ACTIVE. TESTING: Ran sanity (still running), 60 test cases passed, 44 reported failed for multi-node setup (HA) Mutli-Interface Setup: 25 passed, 8 failed. Change-Id: I187e1e873dfdeb5ae7e17490d74faf9d3eb8dd20 --- .../contrail/manifests/lib/post_openstack.pp | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/contrail/environment/modules/contrail/manifests/lib/post_openstack.pp b/contrail/environment/modules/contrail/manifests/lib/post_openstack.pp index 63412d99..da396c79 100644 --- a/contrail/environment/modules/contrail/manifests/lib/post_openstack.pp +++ b/contrail/environment/modules/contrail/manifests/lib/post_openstack.pp @@ -7,6 +7,7 @@ $contrail_logoutput = false, $keystone_ip = $::contrail::params::keystone_ip, $keystone_ip_to_use = $::contrail::params::keystone_ip_to_use, + $host_roles = $::contrail::params::host_roles, ) { if ($host_control_ip in $openstack_ip_list) { #Make ha-mon start later @@ -64,15 +65,28 @@ if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { $openstack_restart_command = "service openstack-nova-api restart && service openstack-nova-conductor restart && service openstack-nova-scheduler restart" + $nova_restart_cmd = "service nova-compute restart" } else { - $openstack_restart_command = "service supervisor-openstack restart ; service nova-compute restart" + $openstack_restart_command = "service supervisor-openstack restart" + $nova_restart_cmd = "service nova-compute restart" } - exec { 'supervisor-openstack-restart': - command => $openstack_restart_command, - provider => shell, - logoutput => $contrail_logoutput, + if 'openstack' in $host_roles { + exec { 'supervisor-openstack-restart': + command => $openstack_restart_command, + provider => shell, + logoutput => $contrail_logoutput, + } } + + if 'compute' in $host_roles { + exec { 'nova-compute-restart': + command => $nova_restart_cmd, + provider => shell, + logoutput => $contrail_logoutput, + } + } + } } #end of post-openstack