add explicit restart nova-compute in post_deployment stage

Closes-bug: #1557980

Change-Id: Iec77d268b2157de6951d52c09fb5bcc2628bc827
This commit is contained in:
Igor Gajsin 2016-03-10 13:45:02 +03:00
parent 03c91eb052
commit 00a7601d53
6 changed files with 100 additions and 11 deletions

View File

@ -0,0 +1,25 @@
# Copyright 2016 Mirantis, 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.
notice('MODULAR: fuel-plugin-vmware-dvs/restart-nova-compute')
$vcenter = hiera('vcenter_hash')
$vc_setting = parse_vcenter_settings($vcenter['computes'])
$defaults = {
'current_node' => hiera('fqdn'),
'role' => hiera('role'),
}
create_resources(vmware_dvs::ha_nova_restart, $vc_setting, $defaults)

View File

@ -0,0 +1,51 @@
# Copyright 2016 Mirantis, 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.
define vmware_dvs::ha_nova_restart(
$availability_zone_name,
$vc_cluster,
$vc_host,
$vc_user,
$vc_password,
$service_name,
$current_node,
$target_node,
$role,
$datastore_regex = undef,
$api_retry_count = 5,
$maximum_objects = 100,
$nova_compute_conf = '/etc/nova/nova-compute.conf',
$task_poll_interval = 5.0,
$use_linked_clone = true,
$wsdl_location = undef,
$service_enabled = false,
)
{
if $target_node =~ /controller/ and $role =~ /controller/ {
$res = "p_nova_compute_vmware_${availability_zone_name}-${service_name}"
exec {$res:
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => "crm resource restart ${res}",
}
}
if $target_node in $current_node {
exec { 'nova-compute-restart':
path => '/usr/bin:/usr/sbin:/bin:/sbin',
command => 'service nova-compute restart',
}
}
}

View File

@ -1,13 +1,3 @@
- id: vmware-dvs-property-hypervisor_type
version: 2.0.0
role: ['primary-controller']
required_for: [post_deployment_end]
requires: [disable_keystone_service_token]
type: shell
parameters:
cmd: bash add_hyperv_type.sh 2>&1 | tee -a /tmp/add_hyper_type.log
timeout: 240
- id: vmware-dvs-override-hiera
version: 2.0.0
groups: ['primary-controller','controller', 'compute-vmware']
@ -136,3 +126,26 @@
groups: ['primary-controller','controller','compute-vmware']
required_for: [deploy_end]
requires: []
# POST_DEPLOYMENT TASKS
- id: vmware-dvs-property-hypervisor_type
version: 2.0.0
role: ['primary-controller']
required_for: [post_deployment_end]
requires: [disable_keystone_service_token]
type: shell
parameters:
cmd: bash add_hyperv_type.sh 2>&1 | tee -a /tmp/add_hyper_type.log
timeout: 240
# explicit restart nova-compute #1557980
- id: vmware-dvs-restart-nova-compute
version: 2.0.0
role: [primary-controller, controller, compute-vmware]
requires: [post_deployment_start]
required_for: [post_deployment_end]
type: puppet
parameters:
puppet_manifest: puppet/manifests/restart-nova-compute.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720

View File

@ -3,7 +3,7 @@ name: fuel-plugin-vmware-dvs
# Human-readable name for your plugin
title: Neutron VMware DVS ML2 plugin
# Plugin version
version: '2.1.17'
version: '2.1.19'
# Description
description: Enable to use plugin vmware_dvs for Neutron
# Required fuel version