DC prestaged.iso overwrites existing images even when force parameter is not specified

Bug #2020526 reported by Kyle MacLeod
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Kyle MacLeod

Bug Description

Brief Description

DC Debian - Prestaged.iso overwrites existing images even when we don't provice force parameter

Note:

    It does not impact the local install functionality, however it impacts its robustness.
    Test Steps:
        Create prestaged.iso without force parameter

            ./gen-prestaged-iso.sh --input /opt/dc-vault/loads/22.12/bootimage.iso --param boot_device=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1 --param rootfs_device=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1 --images container-image1.tar.gz --output /opt/backups/prestaged.iso

            2022-12-20 06-14-16: all required iso utilities present
            /var/home/sysadmin/12-16/updateiso_build_emLwNe
            2022-12-20 06-14-16: mounting /opt/dc-vault/loads/22.12/bootimage.iso to /var/home/sysadmin/12-16/stx-iso-utils_mnt_eJbWw5
            INFO: Calculating new checksum for ostree_repo at /var/home/sysadmin/12-16/updateiso_build_emLwNe
            INFO: ostree_repo checksum: 8d86a2e91690e84a87f589147d25d47a
            2022-12-20 06-14-35: unmounting /var/home/sysadmin/12-16/stx-iso-utils_mnt_eJbWw5
            INFO: Generating prestage.iso from params: boot_device=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1 rootfs_device=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1
            INFO: Setting instdev=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1 from boot_device param
            INFO: Setting instdev=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1 from boot_device param
            INFO: Parameters: boot_device=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1 rootfs_device=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1
            INFO: Setting Kickstart patch from the kickstart directory
            INFO: COMMON_ARGS: initrd=/initrd instdate=@1671516882 instw=60 instiso=instboot biosplusefi=1 instnet=0 ks=file:///kickstart/kickstart.cfg rdinit=/install instname=debian instbr=starlingx instab=0 insturl=file://NOT_SET prestage ip= BLM=2506 FSZ=32 BSZ=512 RSZ=20480 VSZ=20480 instl=/ostree_repo instdev=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1 inst_ostree_root=/dev/mapper/cgts--vg-root--lv inst_ostree_var=/dev/mapper/cgts--vg-var--lv defaultkernel=vmlinuz*[!t]-amd64 boot_device=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1 rootfs_device=/dev/disk/by-path/pci-0000:b4:00.0-nvme-1
            Warning: creating filesystem that does not conform to ISO-9660.
            isohybrid: Warning: more than 1024 cylinders: 4935
            isohybrid: Not all BIOSes will be able to boot this device
            INFO: Prestage ISO created successfully

        Install prestaged.iso on a subcloud with an existing image
    The install should halt with a message saying that there is an existing image
    Error: (No existing installation found)

        2022-12-20 06:15:31.022 kickstart ks-early info: controller Found rootfs /dev/disk/by-path/pci-0000:b4:00.0-nvme-1 on: /dev/disk/by-path/pci-0000:b4:00.0-nvme-1->/dev/nvme0n1.
        2022-12-20 06:15:31.039 kickstart ks-early info: controller Searching for existing installation...
        2022-12-20 06:15:31.040 kickstart ks-early info: controller Searching on /dev/nvme0n1p1
        2022-12-20 06:15:31.090 kickstart ks-early info: controller Searching on /dev/nvme0n1p2
        2022-12-20 06:15:31.110 kickstart ks-early info: controller Searching on /dev/nvme0n1p3
        2022-12-20 06:15:31.131 kickstart ks-early info: controller Searching on /dev/nvme0n1p4
        mount: /mnt/temp_mount: unknown filesystem type 'LVM2_member'.
        2022-12-20 06:15:31.138 kickstart ks-early warn: controller Unable to mount /dev/nvme0n1p4
        2022-12-20 06:15:31.142 kickstart ks-early info: controller Installing Prestaged content. No existing installation found.
        2022-12-20 06:15:31.163 kickstart ks-early info: controller Partition id = 1
        2022-12-20 06:15:31.164 kickstart ks-early warn: controller Deleting platform backup at partition 1 on /dev/nvme0n1
        2022-12-20 06:15:31.207 kickstart ks-early info: controller Deleted partition 1 on /dev/nvme0n1
        Installing to: /dev/nvme0n1

    Last Time passed: Build from Nov, 30th

Severity

<Major: System/Feature is usable but degraded>

Steps to Reproduce

Create prestaged.iso without force parameter
Install prestaged.iso on a subcloud with an existing image

Expected Behavior

The install should halt with a message saying that we have an existing image

Actual Behavior

The install with prestaged.iso without force parameter overwrites the existing image

Reproducibility

100% reproducible

System Configuration

DC

Load info (eg: 2022-03-10_20-00-07)

SW_VERSION="22.12"
BUILD_TARGET="Host Installer"
BUILD_TYPE="Formal"
BUILD_ID="2022-12-19_02-22-00"

Last Pass

build from Nov, 30th

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

Reviewed: https://review.opendev.org/c/starlingx/metal/+/883734
Committed: https://opendev.org/starlingx/metal/commit/d807f6b65e689055f1328fd56c0d3daca0cc603e
Submitter: "Zuul (22348)"
Branch: master

commit d807f6b65e689055f1328fd56c0d3daca0cc603e
Author: Kyle MacLeod <email address hidden>
Date: Fri May 19 21:24:45 2023 -0400

    Fix prestage ISO install abort if previous subcloud install exists

    This commit fixes the detection of www/pages/feed/rel-xx.x/install_uuid
    via device '/dev/cgts-vg/var-lv'. There was a bug which was always
    mounting the same device, rather than the proper device_list.

    The code is also slightly refactored for simplification and clarity.

    Test Plan
    PASS:
    - Generate ISO using gen-prestage-iso.sh without --force-install option
        - Verify installation failure (drop to boot prompt) if previous
          subcloud installation exists
        - Verify successful subcloud installation if no previous
          subcloud installation exists
    - Generate ISO using gen-prestage-iso.sh with --force-install option
        - Verify successful installation regardless if previous subcloud
          installation exists or not

    Closes-Bug: 2020526
    Change-Id: Ib83d72fa07335ffa29d365da7813b226c4ef310b
    Signed-off-by: Kyle MacLeod <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Changed in starlingx:
assignee: nobody → Kyle MacLeod (kmacleod)
importance: Undecided → Medium
tags: added: stx.me
tags: added: stx.9.0 stx.metal
removed: stx.me
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.