From 0d958de077251936a945dc71546ee53f924ad345 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Tue, 18 Dec 2018 11:17:36 -0500 Subject: [PATCH] Standby controller in reboot loop after modifying the partition size The root cause of this issue is that when the newly standby controller is coming up, the partition manifest calls "sm-unmanage / sm-manage" for drbd-cinder service. However at this time /var/run/sm.db is not available yet which causes "sm-unmanage / sm-manage" to fail. This commit adds a check in the partition puppet file that only if the system is up "sm-unmanage" and "sm-manage" will be called. Change-Id: I1869f024579350265684f2ee3bb5e3e74e6427cb Closes-bug: 1809009 Signed-off-by: Wei Zhou --- .../platform/templates/partitions.manage.erb | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/puppet-manifests/src/modules/platform/templates/partitions.manage.erb b/puppet-manifests/src/modules/platform/templates/partitions.manage.erb index d633db2ed4..3013b2954a 100644 --- a/puppet-manifests/src/modules/platform/templates/partitions.manage.erb +++ b/puppet-manifests/src/modules/platform/templates/partitions.manage.erb @@ -1,10 +1,14 @@ /bin/true # puppet requires this for correct template parsing <% if @shutdown_drbd_resource and (@is_controller_active.to_s == 'false' or @system_mode == 'simplex') -%> -sm-unmanage service <%= @shutdown_drbd_resource %> +if [ -f /var/run/goenabled ]; then + sm-unmanage service <%= @shutdown_drbd_resource %> +fi <% if @shutdown_drbd_resource == 'drbd-cinder' and @system_mode == 'simplex' -%> -sm-unmanage service cinder-lvm +if [ -f /var/run/goenabled ]; then + sm-unmanage service cinder-lvm +fi targetctl clear || exit 5 lvchange -an cinder-volumes || exit 10 vgchange -an cinder-volumes || exit 20 @@ -28,7 +32,6 @@ done if [[ DRBD_UNCONFIGURED_DELAY -eq DRBD_UNCONFIGURED_TIMEOUT ]]; then exit 40 fi - <% end -%> manage-partitions <%= @action %> '<%= @config %>' @@ -41,9 +44,15 @@ drbdadm primary drbd-cinder || exit 50 vgchange -ay cinder-volumes || exit 60 lvchange -ay cinder-volumes || exit 70 targetctl restore || exit 75 -sm-manage service <%= @shutdown_drbd_resource %> -sm-manage service cinder-lvm + +if [ -f /var/run/goenabled ]; then + sm-manage service <%= @shutdown_drbd_resource %> + sm-manage service cinder-lvm +fi <% end -%> -sm-manage service <%= @shutdown_drbd_resource %> +if [ -f /var/run/goenabled ]; then + sm-manage service <%= @shutdown_drbd_resource %> +fi + <% end -%>