Comment 2 for bug 2039111

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to distcloud (master)

Reviewed: https://review.opendev.org/c/starlingx/distcloud/+/898017
Committed: https://opendev.org/starlingx/distcloud/commit/041f52d4a183519d96781472aa208c00e301edfb
Submitter: "Zuul (22348)"
Branch: master

commit 041f52d4a183519d96781472aa208c00e301edfb
Author: Victor Romano <email address hidden>
Date: Wed Oct 11 20:12:57 2023 -0300

    Fix backup restore for locally installed subclouds

    When running "dcmanager subcloud-backup restore", there was a check
    for the presence of install values, preventing the restore of any
    subcloud that doesn't have said values in system controller db, like
    in a manual installation (without using --with-install).
    This commit changes this behavior and now it attempts to get
    the bootstrap_address with the following priority, returning an error
    if none of them are available:
    - Getting from restore_values
    - Getting from install_values
    - Getting from previous inventory file

    The restore_values should contain the bootstrap_address with the
    following format:

    bootstrap_address:
      subcloud1: 10.10.10.12
      subcloud2: 10.10.10.22
      subcloud3: 10.10.10.32
      <subcloud_name>: <subcloud_bootstrap_address>

    Test plan:
      All test cases were executed with a permutation of the following:
        - Providing a restore_values file with the bootstrap_address
        - Providing a restore_values file without the bootstrap_address
        - Providing the install_values
        - Don't provide neither restore_values or install_values
      Success cases:
      - PASS: Deploy a subcloud and take its backup. Manually reinstall
              the subcloud and run the "dcmanager subcloud-backup restore"
              command. Verify the subcloud was successfully restored.
      - PASS: Deploy a subcloud and take its backup. Run the
              "dcmanager subcloud-backup restore --with-install" command.
              Verify the subcloud was successfully restored.
      - PASS: Deploy two subclouds and add them in a group. Perform a group
              backup and after a group restore. Verify both subclouds were
              successfully restored.

      Failure cases:
      - PASS: Verify it's not possible to restore a subcloud that doesn't
              have the bootstrap_address in restore_values and doesn't
              have install_values in db or a previous inventory file in
              overrides folder.
      - PASS: Verify it's not possible to restore a subcloud that doesn't
              have install values with --with-install option. In a group
              operation, it's not possible to restore if any of the
              subclouds doesn't have install values.
      - PASS: Verify it's not possible to submit a restore request when
              the bootstrap_address is not defined correctly in
              restore_values, e.g. "bootstrap_address: 10.10.10.12"

    Closes-Bug: 2039111

    Change-Id: I17c561edde4670488c9e2951a2a5a18c114a0f8d
    Signed-off-by: Victor Romano <email address hidden>