Fix for snapshot-controller failure during restore

The change made in review [1] introduced the creation of the
snapshot resources in all installations during the bootstrap.

An issue was identified during the restore process (uses
bootstrap playbook) in a specific scenario: systems with
more than one host where the volume snapshot controller pod
was not running on controller-0 when the backup was performed.

During the restore process, within the snapshot-controller role,
it checks if the snapshot-controller pod is running, resulting
in a failure in the above scenario, since the assigned node
will not be ready, as only controller-0 is ready to run pods during
restore.

Therefore, the fix involves skipping the execution of the role
during restore. It's important to note that if the
snapshot-controller pod was created before the backup, it will
later be restored and will operate correctly after completing
the restore process regardless of the node that was attached.

[1]: https://review.opendev.org/c/starlingx/ansible-playbooks/+/904360

Test Plan:
 PASS: Successful backup and restore on an AIO-DX whose
       snapshot-controller pod was running on controller-0
       during backup
 PASS: Successful backup and restore on an AIO-DX whose
       snapshot-controller pod was running on controller-1
       during backup
 PASS: Successful backup and restore on a Standard (2+1) whose
       snapshot-controller pod was running on controller-1
       during backup
 PASS: AIO-SX | AIO-DX fresh install + Check if the CRDs
       and snapshot-controller were created during bootstrap

Closes-bug: 2060675

Change-Id: Ia2f69fafba4854236ea2d6c26932e99e63059ff8
Signed-off-by: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
This commit is contained in:
Gabriel de Araújo Cabral 2024-04-09 08:46:08 -03:00
parent 351aa195f9
commit 523ca7bcb2
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
---
#
# Copyright (c) 2019-2023 Wind River Systems, Inc.
# Copyright (c) 2019-2024 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -284,7 +284,7 @@
- name: Enable volume snapshot support
include_role:
name: k8s-storage-backends/snapshot-controller
when: enable_volume_snapshot_support|bool
when: enable_volume_snapshot_support|bool and mode != 'restore'
- name: Configure k8s-coredump-handler
block: