subcloud backup create failed to create custom backup file name

Bug #1992103 reported by Hugo Nicodemos Brito
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Hugo Nicodemos Brito

Bug Description

Brief Description
-----------------
dcmanager subcloud-backup create failed to create custom backup file name prefix using --backup-values.

cat backup_values.yaml
platform_backup_filename_prefix: abc
docker_local_registry_backup_filename_prefix: ABC

dcmanager subcloud-backup create --subcloud subcloud --sysadmin-password PASS --local-only --backup-values backup_values.yaml

subcloud:

$ ls -lrt /opt/platform-backup/backups/22.12
total 6128
-rw-r--r-- 1 root root 6272573 Sep 26 23:26 subcloud_platform_backup.tgz
Verified the same scenario using ansible-playbook and it worked:

 cat subclouds.yml
all:
  hosts:
    subcloud:
      ansible_host: IP
  vars:
    ansible_ssh_user: ADMIN_USER

 cat subcloud-backup-overrides.yaml
# Backup configuration
local: true
central_backup_dir: /opt/dc-vault/backups
backup_user_local_registry: false
ansible_ssh_pass: PWD
ansible_become_pass: PWD
platform_backup_filename_prefix: xyz

sudo ansible-playbook /usr/share/ansible/stx-ansible/playbooks/create_subcloud_backup.yml -i subclouds.yml -e "subcloud_bnr_overrides=/home/sysadmin/subcloud-backup-overrides.yaml"

after backup

ls -lrt /opt/platform-backup/backups/22.12
total 6128
-rw-r--r-- 1 root root 6274095 Sep 26 23:30 xyz_2022_09_26_23_30_05.tgz

Severity
--------
<Minor: System/Feature is usable with minor issue>

Steps to Reproduce
------------------
Command: dcmanager subcloud-backup create --subcloud SUBCLOUD --sysadmin-password PASSWORD --local-only --backup-values backup_values.yaml

Expected Behavior
------------------
Create the backup file with the prefix set in platform_backup_filename_prefix.

Actual Behavior
----------------
File created with the default prefix.

Reproducibility
---------------
<Reproducible>
100% reproducible

System Configuration
--------------------
Distributed Cloud System

Branch/Pull Time/Commit
-----------------------
master

Last Pass
---------
NA

Timestamp/Logs
--------------
NA

Test Activity
-------------
NA

Workaround
----------
Use ansible playbook: ansible-playbook /usr/share/ansible/stx-ansible/playbooks/create_subcloud_backup.yml

description: updated
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to distcloud-client (master)
Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to distcloud (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/distcloud/+/860727

Changed in starlingx:
assignee: nobody → Hugo Nicodemos Brito (hbrito)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to distcloud (master)

Reviewed: https://review.opendev.org/c/starlingx/distcloud/+/860727
Committed: https://opendev.org/starlingx/distcloud/commit/914b73b282187d7a1ba09e46954e26c9ee7eac91
Submitter: "Zuul (22348)"
Branch: master

commit 914b73b282187d7a1ba09e46954e26c9ee7eac91
Author: Hugo Brito <email address hidden>
Date: Fri Oct 7 14:07:09 2022 -0300

    Create overrides from backup_values file

    When a backup was created with dcmanager subcloud-backup
    and using --backup_values <file> the file content was not
    being written in backup overrides. Now the dcmanager already
    receives all contents of the file from the CLI and writes
    to the overrides file.

    Test Plan:
    1. Add a subcloud using dcmanager subcloud add command.
    2. Create backup_values.yaml
    - platform_backup_filename_prefix: abc
    3. Create a backup using dcmanager subcloud-backup
    without --backup_values <file>.
    - backup file created with default name.
    4. Create a backup using dcmanager subcloud-backup
    --backup_values backup_values.yaml.
    - backup file created with 'abc' prefix.

    Partial-Bug: 1992103

    Signed-off-by: Hugo Brito <email address hidden>
    Change-Id: I5d7d82f6bf1114dafaade04e76a9673ad1ef1795

Changed in starlingx:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to distcloud-client (master)

Reviewed: https://review.opendev.org/c/starlingx/distcloud-client/+/860725
Committed: https://opendev.org/starlingx/distcloud-client/commit/f1a7991e3dd9a5c49b75b4b5575f19993981253c
Submitter: "Zuul (22348)"
Branch: master

commit f1a7991e3dd9a5c49b75b4b5575f19993981253c
Author: Hugo Brito <email address hidden>
Date: Fri Oct 7 13:59:33 2022 -0300

    Parse backup_values YAML file

    Instead of sending the path of the backup_values file
    to the dcmanager, this commit parses the file and only
    sends the content.

    Test Plan:
    1. Add a subcloud using dcmanager subcloud add command.
    2. Create backup_values.yaml
    - platform_backup_filename_prefix: abc
    3. Create a backup using dcmanager subcloud-backup
    without --backup_values <file>.
    - backup file created with default name.
    4. Create a backup using dcmanager subcloud-backup
    --backup_values backup_values.yaml.
    - backup file created with 'abc' prefix.

    Depends-On: https://review.opendev.org/c/starlingx/distcloud/+/860727
    Closes-Bug: 1992103

    Signed-off-by: Hugo Brito <email address hidden>
    Change-Id: I2146136403bc928ab67ab549db823dc71322fdcd

Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.8.0 stx.distcloud stx.update
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.