From e5d3d2269bb9b38bc5959895b4d302fb8f6f51a7 Mon Sep 17 00:00:00 2001 From: Luca Miccini Date: Wed, 25 Sep 2019 17:28:39 +0200 Subject: [PATCH] Add a configurable delay to Nova Evacuate calls Add a configurable delay to Nova Evacuate calls In case /var/lib/nova/instances resides on NFS we have seen migrations failing with 'Failed to get "write" lock - Is another process using the image' errors. This has been tracked down to grace/lease timeouts not having expired before attempting the migration/evacuate, so in this cases it might be desirable to delay the nova evacuate call to give the storage time to release the locks. Related resource-agents change: https://review.opendev.org/#/c/684777/ NB: cherry-pick not 100% clean due to missing I00d4f97cd24f7c36eeb0a29f9c91422cf7ded3ee (Add region support for instance HA). As there are no current plans to backport that, we chose to adapt this review instead Change-Id: I5ec6a5b0c66579e068e811f49aae10a5f406158a Resolves: rhbz#1740069 (cherry picked from commit 72487d804ef4c64d16889b1b474252f6963a18c2) --- manifests/profile/base/pacemaker/instance_ha.pp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/manifests/profile/base/pacemaker/instance_ha.pp b/manifests/profile/base/pacemaker/instance_ha.pp index 62546068a..ce8a2fa04 100644 --- a/manifests/profile/base/pacemaker/instance_ha.pp +++ b/manifests/profile/base/pacemaker/instance_ha.pp @@ -56,6 +56,10 @@ # Variable that defines the no_shared_storage for the nova evacuate resource # Defaults to hiera('tripleo::instanceha::no_shared_storage', true) # +# [*evacuate_delay*] +# (Optional) Integer, seconds to wait before starting the nova evacuate +# Defaults to hiera('tripleo::instanceha::evacuate_delay', 0) +# class tripleo::profile::base::pacemaker::instance_ha ( $step = Integer(hiera('step')), $pcs_tries = hiera('pcs_tries', 20), @@ -66,6 +70,7 @@ class tripleo::profile::base::pacemaker::instance_ha ( $user_domain = hiera('nova::keystone::authtoken::user_domain_name', 'Default'), $project_domain = hiera('nova::keystone::authtoken::project_domain_name', 'Default'), $no_shared_storage = hiera('tripleo::instanceha::no_shared_storage', true), + $evacuate_delay = hiera('tripleo::instanceha::evacuate_delay', 0), ) { if $step >= 2 { class { '::pacemaker::resource_defaults': @@ -111,10 +116,15 @@ class tripleo::profile::base::pacemaker::instance_ha ( } else { $iha_no_shared_storage = 'no_shared_storage=false' } + if $evacuate_delay > 0 { + $evacuate_param = " evacuate_delay=${evacuate_delay}" + } else { + $evacuate_param = '' + } pacemaker::resource::ocf { 'nova-evacuate': ocf_agent_name => 'openstack:NovaEvacuate', # lint:ignore:140chars - resource_params => "auth_url=${keystone_endpoint_url} username=${keystone_admin} password=${keystone_password} user_domain=${user_domain} project_domain=${project_domain} tenant_name=${keystone_admin} ${iha_no_shared_storage}", + resource_params => "auth_url=${keystone_endpoint_url} username=${keystone_admin} password=${keystone_password} user_domain=${user_domain} project_domain=${project_domain} tenant_name=${keystone_admin} ${iha_no_shared_storage}${evacuate_param}", # lint:endignore tries => $pcs_tries, location_rule => {