Commit Graph

213 Commits

Author SHA1 Message Date
Fabiano Correa Mercer 91ae9c3db2 Fix ipv4/ipv6 scenario detection
Due to the alias in the /etc/dnsmasq.conf:
```
cname=controller,controller.internal
cname=controller-0,controller-0.internal
cname=controller-1,controller-1.internal
```

The DNS answers the value:
"controller.internal." for the IPv6 dig command:
"dig +short AAAA controller" even for an IPv4 scenario
What makes the code to set the IPv6 parameters instead
if the IPv4.
So it is necessary to check if the dig result has an
IPv6 address and not just the "controller.internal."

Tests dome:
IPv4 AIO-SX fresh install
IPv4 AIO-DX fresh install
IPv4 AIO-DX with mgmt in vlan fresh install
IPv6 AIO-DX with mgmt in vlan fresh install
IPv4 AIO-DX swact
IPv6 AIO-DX swact

Closes-Bug: #2059722

Change-Id: I92978263646fe6d07e96edd2054d42bed6d389b1
Signed-off-by: Fabiano Correa Mercer <fabiano.correamercer@windriver.com>
2024-04-01 16:40:54 -03:00
Zuul cc679681e2 Merge "Show installed software release in the subcloud" 2024-03-25 15:07:11 +00:00
Zuul 8111d098fc Merge "Copy USM scripts to software dir on fresh install" 2024-03-22 19:59:24 +00:00
Heitor Matsui 3d66eb4c49 Copy USM scripts to software dir on fresh install
This commit copies the USM scripts to a versioned script directory
under /opt/software during a fresh install, so that in the future,
when deploy precheck is supported for patches, the patches can use
the GA major release precheck if they don't contain a new precheck
script, and also for the scenario where an user wants to remove
all the patches from the system, reverting to the GA release.

Note: the file for subcloud install, miniboot.cfg, will be covered
      on another commit.

Test Plan
PASS: run "software deploy precheck" for current running release
PASS: run "software deploy precheck" for a patch that does not
      include a precheck script and that uses the GA script instead

Story: 2010676
Task: 49681

Change-Id: I1e6313789204107f56fce8da09f6b785994817ee
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2024-03-20 18:29:22 -03:00
Luis Eduardo Bonatti dcbeade4d9 Show installed software release in the subcloud
The command software list is not returning the correct software
release on subcloud, it is returning empty list instead.

This commit fix this issue by creating the USM metadata directories
under /opt/software for subclouds too.

Test Plan:
PASS: Software list returning proper data.

Story: 2010676
Task: 49746

Relates-to: e37f69765e
6c863b3828

Change-Id: I55554709f377b725db535bc32d316a9586996693
Signed-off-by: Luis Eduardo Bonatti <LuizEduardo.Bonatti@windriver.com>
2024-03-20 17:07:31 +00:00
Fabiano Correa Mercer c6c308e982 Fix IPv6 resolution during Upgrade
During an upgrade the controller.internal may not
be defined because the active controller is running
an old release, so the IPv6 DNS resolution fails
even if the scenario is IPv6.
An additional IPv6 DNS resolution to controller is
necessary to cover the upgrade scenario.

Tests done:

IPv6 AIO-SX fresh install
IPv6 AIO-DX fresh install
IPv4 AIO-DX upgrade from previous release
    without story 2010722 to new release
    that has the story 2010722 (not master)
IPv4 STANDARD upgrade from previous release
    without story 2010722 to new release
    that has the story 2010722 (not master)
IPv6 AIO-DX upgrade from previous release
    without story 2010722 to new release
    that has the story 2010722 (not master)
IPv6 DC lab upgrade from previous release
    without story 2010722 to new release
    that has the story 2010722 (not master)

Story: 2010722
Task: 49644

Depends-On: https://review.opendev.org/c/starlingx/config/+/909866

Change-Id: Ic4acc7432f351a65ba951d8ba8790b0ab90e32bc
Signed-off-by: Fabiano Correa Mercer <fabiano.correamercer@windriver.com>
2024-02-29 17:12:07 -03:00
Zuul 880df77a25 Merge "Add ipsec auth server pmon configuration" 2024-02-20 17:35:21 +00:00
Andy Ning 1f507e0e62 Add ipsec auth server pmon configuration
This update added ipsec auth server pmon configuration file in
mtce-control package. The pmon configuration file is only needed
on controller node, as ipsec-server is running on controllers only.

Test Plan:
PASS: In a deployed system, verify ipsec-server is running
PASS: kill the ipsec-server process, verify that it is started
      by pmon.

Story: 2010940
Task: 49484

Co-Authored-By: Andy Ning <andy.ning@windriver.com>

Change-Id: Iadb9ca6f086640d008880a21cfd97256b00ab7ab
Signed-off-by: Leonardo Mendes <Leonardo.MendesSantana@windriver.com>
2024-02-09 16:05:18 -03:00
Andy Ning 4af50a10bd Create a first controller flag during kickstart
This change updated kickstart to create a .first_controller flag.
This flag will be checked by controller_config to skip IPSec config
and enablement for the very first controller. IPSec is configured and
enabled by ansible bootstrap for the first controller.

Test Plan:
PASS: Install a AIO-DX system, verify the .first_controller file flag
      is created for the first controller during kickstart, but not for
      the other controller.
PASS: Verify that IPSec config and enablement is skipped for first
      controller and IPSec is configured and enabled for the second
      controller.

Story: 2010940
Task: 49547

Change-Id: Iea78885483a358dc3d8a296312c0a40c431b7ea5
Signed-off-by: Andy Ning <andy.ning@windriver.com>
2024-02-07 13:54:21 -05:00
Eric MacDonald 19346c232a Add sysinv query for host's mgmt_ip and hostname based on bootif mac
The newly introduced unauthenticated 'mgmt_ip' API in sysinv, as
referenced by the 'depends-on' link below, has been added to
initiate a query for the current host's management IP and hostname.

This information is needed by the kickstart to create a static
'ifcfg-<mgmt interface>' file so that the management interface
is automatically setup on the first boot following a fresh install.

The significance of this step lies in enabling a pre-configuration of
IPsec on the management network before host configuration takes place.

This update also
 - creates a dhcp ifcfg-pxeboot file to automatically update the
   management interface with a pxeboot dhcp address.
 - creates an initial /etc/resolv.conf file with the active
   controller's floating ip and the pxecontroller ip addresses
   which are also needed by the IPSec setup pre-configuration
   following the first reboot after node install.

Additionally, this update involves a refinement in terminology.
The variable previously named 'mgmt_dev' has been aptly renamed
'boot_dev' to more accurately reflect the nomenclature of the
interface in use.

Test Plan:

PASS: Verify AIO DX install of IPV4 and IPV6 with and without vlans
PASS: Verify IPV4 worker node install
PASS: Verify management interface 'ifcfg-<mgmt-if>' file is created
      - cases: with and without vlan
PASS: Verify pxeboot interface 'ifcfg-pxeboot' is created (ipv4 only)
PASS: Verify kickstart fails the install if it receives badly
      formatted sysinv mgmt_ip query or None.
PASS: Verify resolve.conf updated with nameserver <floating ip>
PASS: Verify resolve.conf updated with nameserver <pxecontroller ip>
PASS: Verify kickstart logging

Depends-On: https://review.opendev.org/c/starlingx/config/+/901981

Story: 2010940
Task: 49162
Change-Id: I429522305fcff66e5c78195f4bf3c5b82826c1d8
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
2024-02-06 18:30:08 +00:00
Eric MacDonald 5a3a5ce8ea Stop creating guestServer.conf /etc/pmon.d link
The maintenance guestServer daemon has been deprecated for quite
some time.

However, that deprecation process left the kickstarts creating a
dangling link to a missing guestServer.conf in the /etc/pmon.d
directory.

Pmon just ignores the missing process so there is no service impact.

This update cleans this up by removing the code in the kickstarts
that create the dangling link.

Test Plan:

PASS: Verify the guestServer.conf dangling link no longer exists
      in worker nodes.
PASS: Verify pmond.log makes no mention of the deprecated guestServer
      process.

Closes-Bug: 2051389
Change-Id: I89a62d939194c65c86e3cf71b238698eb2ee97ed
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
2024-01-30 14:42:03 +00:00
Mohammad Issa efe618fae3 IPv4 subcloud failure due to miniboot config
systemd unable to bring up OAM bonded VLAN IF due to miniboot cfg.

The autoconf and accept_ra sysctl parameters do not exist for IPv4.
The accept_redirects does, but in normal operation we only set
these for IPv6.

Testing:
- Build successful
- Successfully bring up IPv4 System Controller & Subcloud
- Verify that ifcfg-<ifname> under interfaces.d shows
  that the sysctl parameters are set to ipv6
- Verify these tests using a miniboot installed IPv4 subcloud

Closes-Bug: 2049683

Change-Id: Ib27f86f707796682a3db6641824f9fdbe2f53534
Signed-off-by: Mohammad Issa <mohammad.issa@windriver.com>
2024-01-22 16:00:56 +00:00
Jagatguru Prasad Mishra 7436ec965f Copy luks.conf to '/etc/pmon.d'
luks.conf contains the configurations used by pmon to monitor
luks-fs-mgr service.This change links /usr/share/starlingx/pmon.d
to /etc/pmon.d. Once this is done, pmon starts monitoring the
process, creates and clears an alarm, tries to restart the service,
degrades the host in case of multiple failures.

Test Plan:
PASS: build-pkgs -c -p platform-kickstarts
PASS: build-image
PASS: AIO-SX verify if luks.conf is present at /etc/pmon.d
PASS: AIO-DX verify if luks.conf is present at /etc/pmon.d
PASS: AIO-DX alarm should be created if pmon is unable to start the
      service
PASS: AIO-DX pmon.log should contain error messages if service is down.
PASS: Standard: Pmon monitoring should not be enable on compute and
      storage nodes. Ensure conf file is not present at '/etc/pmon.d'
      on compute and storage hosts. On controller hosts this file
      should be present at /etc/pmon.d'.
PASS: AIO-DX alarm should be cleared and host availability should be
      'available' once service starts running.
PASS: AIO-DX is service is unrecoverable, host is reported to host
      watchdog.

Story: 2010872
Task: 49250

Depends-On: https://review.opendev.org/c/starlingx/integ/+/903612

Change-Id: I4eeb4b2f79b1bb017a0fe2af34f35854c89dee82
Signed-off-by: Jagatguru Prasad Mishra <jagatguruprasad.mishra@windriver.com>
2023-12-14 23:01:13 -05:00
Heitor Matsui 6c863b3828 Move GA metadata to deployed status
This commit changes the GA metadata status on fresh install
to "deployed" given recent technical decision changes.

Test Plan:
PASS: build and install iso, verify the correct output with
      "software list"

Story: 2010676
Task: 49166

Change-Id: Idbab8655f9f2e4e080f389fa7823f5e6744c4c74
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2023-11-29 11:59:17 -03:00
Heitor Matsui e37f69765e Copy GA metadata file to USM location
This commits switches the GA metadata file copy from
/opt/patching/metadata to /opt/software/metadata.

Test Plan
PASS: build iso, install and verify that "software list"
      lists the GA release

Story: 2010676
Task: 49112

Change-Id: I75b8cd6ae41a9cf9b5af0225ebcaaf0d9e0ddb4e
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
2023-11-21 12:31:19 -03:00
Zuul 8d2883aa68 Merge "After executing PXE boot install, turn off IPv6 autoconf" 2023-11-14 20:20:46 +00:00
Andre Kantek 97052df958 After executing PXE boot install, turn off IPv6 autoconf
It was detected that the PXE boot the IPv6 autoconf is turned on
due to an error in the network config file for the PXE interface.
Instead of applying the config to the interface it is configuring
the loopback.

By leaving autoconf turned on the interface it can receive unwanted
address configuration that can create errors during the ansible
playbook execution that will follow.

Closes-Bug: 2043509

Change-Id: I48584dc6b92fca02205c4774c4624410b6a29ba8
Signed-off-by: Andre Kantek <andrefernandozanella.kantek@windriver.com>
2023-11-14 16:13:33 -03:00
Teresa Ho e616a4495d Use FQDN for MGMT network in kickstart
With the introduction of FQDN for MGMT network feature, the DNS lookup
of 'controller' resolves to 'controller.internal'.
The kickstart script uses the DNS lookup of controller to determine
whether the system is using a IPv6 or IPv4 which results in a string
instead of IP address or 0 return code. This causes a problem in
installing nodes in IPv4 when the management interface is configured
over vlan.

The fix is to use the FQDN controller.internal.

Test plan:
PASS: Install IPv4 AIO-DX with mgmt vlan
PASS: Install IPv6 AIO-DX with mgmt vlan

Story: 2010722
Task: 48682
Closes-Bug: 2042953

Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
Change-Id: I5377587c8bc8c62a62f03123cabef7366df3dd94
2023-11-09 16:12:13 +00:00
Kyle MacLeod e81d0bf4e7 Prestaged ISO: copy ostree_repo to versioned platform-backup
This commit applies to the prestaged ISO install. The kickstart.cfg is
updated to copy the prestaged ostree_repo into release-specific
/opt/platform-backup/<release> location.

A minor change is also included in miniboot.cfg to sync the patching
metadata for prepatched ISOs. This fills a potential hole in the
patching metadata sync behaviour identified during testing.
Normally the patching metadata is synchronized from the system
controller down to the subcloud. For the prestaged ISO case, this change
is necessary to ensure the patching metadata is seeded from the
prepatched ISO created via gen-prestaged-iso.sh.

Test Plan
PASS:
- Build prestaged ISO, including container images and a patch
    - Install subcloud using prestaged ISO
    - Verify contents of /opt/platform-backup/<release> are properly
      populated.
    - Verify subcloud is installed using prestaged data from
      /opt/platform-backup/<release>
    - Verify that included container images are installed
- Build prestaged ISO using a pre-patched ISO. Install subcloud, ensure
  that patching metadata is properly synchronized on installation.

Out of scope failure:
- A new bug to be raised for the following:
    - Verify that the included patch is installed on the subcloud
      - It appears that this has never worked in Debian. The --patch
        option makes sense for a Debian installation, since the patches
        are contained in ostree commits. To fully support this
        functionality we need to implement a new mechanism to do a
        sw-patch upload and apply at some point during the installation.
      - Support for the gen-prestaged-iso.sh --patch option will be
        added in a future commit

Closes-Bug: 2039282
Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
Change-Id: I973f4704eae09634a0c3fe2f7fbc31ac1835fcf8
2023-10-16 10:04:35 -04:00
Zuul f6ab5912b3 Merge "Wipe all LVs during kickstart" 2023-09-27 16:27:51 +00:00
Gustavo Ornaghi Antunes 00b313de49 Wipe all LVs during kickstart
Backup and Restore are not completing because the manifest is
not applied when trying drbd-cephmon turns primary,
It is occurring because the LVs are not being wiped before
being removed, so some garbage is impacting drbd-cephmon
turns primary and causes the manifest fails to not be applied.

To ensure that drbd-cephmon turns primary on first unlock,
LVs will be wiped before recreating them during kickstart
procedure.

Test Plan:
PASS: Backup and restore on AIO-DX
PASS: Install AIO-SX over the previous installation without
wiping the disks and checking the install.log to verify
if the disks are wiped during kickstart.
PASS: Install AIO-DX, reinstall Controller-1, and checking the
install.log to verify if the disks were wiped during kickstart.

Closes-Bug: #2031542

Change-Id: Ib00d77fbc9dfd62e9c94f418e29f2805f8a0c036
Signed-off-by: Gustavo Ornaghi Antunes <gustavo.ornaghiantunes@windriver.com>
2023-09-27 14:20:01 +00:00
Andre Kantek 7d88382c9e Remove machine-id generated from build from subcloud install
As it was done in the previous change for local installation
https://review.opendev.org/c/starlingx/metal/+/863322
This change removes the ISO embedded machine-id file to allow the
value regeneration after the first boot post install for subclouds
that use the redfish protocol when added in a system controller.

Test Plan
[PASS] install 2 subclouds from the system controller containing the
        patch and check the values in /etc/machine-id and
        /var/lib/dbus/machine-id to unique for each subcloud

Closes-Bug: 2037434

Change-Id: If7a631b5769cb499956a7e5ee33e3361a6230452
Signed-off-by: Andre Kantek <andrefernandozanella.kantek@windriver.com>
2023-09-26 12:06:39 -03:00
Zuul 67e2c4aaef Merge "Add intel multi-drivers-switch kernel parameter support to kickstarts" 2023-07-11 19:55:39 +00:00
Eric MacDonald 61bad300f7 Add intel multi-drivers-switch kernel parameter support to kickstarts
This update adds support to the Debian kickstarts to search the
install kernel command line for the multi-drivers-switch= option.
If that option is found, then the full option with the specified
version, ex: multi-drivers-switch=2.54 , will be added to the
disk boot kernel command line options.

Test Plan:

PASS: Verify Build and Install SX system
PASS: Unit test of code block function over an install
PASS: Verify if the multi-drivers-switch parameter exists on the
      the node install command line then the same option is
      propagated to the disk boot command line.
PASS: Verify the opposite of the above is true.

Closes-Bug: 2026893
Change-Id: I648b16dbc5aa2a0a7b8368c1b89a5d46418ab1e5
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
2023-07-11 19:35:36 +00:00
Kyle MacLeod 5f3c54297d Support CentOS previous release in subcloud remote install
This commit introduces support for installing CentOS-based previous
release (21.12) in Debian.

There are two main components in this commit:
1. Handle the label change for the backup partition:

Platform Backup in 21.12 vs 'platform_backup' in Debian
This is accomplished by ignoring the label/partlabel entirely when
searching for an existing backup partition. Instead, the partition
GUID is used to locate the partition. The GUID does not change
between distributions.

2. Use pre-bundled CentOS kickstarts for subcloud installs in Debian

Since modifications are required to the CentOS kickstart files for the
above, we copy the relevant pre-bundled centos kickstarts (for miniboot
and prestaged ISO only) into a centos-specific directory under the
Debian /var/www/pages/feed/rel-${platform_release}/kickstart directory
structure, in order to be available for the gen-bootloader-iso-centos.sh
utility. These files are included in the platform-kickstarts .deb
package.

NOTES on how the pre-bundled files are created:
- We cannot use the files under bsp-file/kickstarts/*.cfg, since they
  are not valid for 21.12 release (e.g. they refer to /var/www)
- Instead, files were taken from a valid 21.12 release and manually
  merged with the pre-bundled files generated from this repo

GOING FORWARD:
Only the bundled files at kickstart/files/centos/*.cfg will be
maintained. At a later time, we may choose to remove the partial
kickstarts under bsp-files/kickstarts/*.cfg, since they are not used
anywhere.

Test Plan

PASS:
- Build full ISO, verify that the
  /var/www/pages/feed/rel-23.09/kickstart/centos directory is populated
  with the pre-bundled kickstart files
- Verify previous-release CentOS subcloud install/deployment under
  Debian (requires patched 22.12 load)
- Verify current-release subcloud install under Debian

Story: 2010611
Task: 48268

Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
Change-Id: I1b7f76212e222dea7c6e586e4e9492f8a86a955e
2023-06-30 13:06:35 -04:00
Kyle MacLeod 0510b0c1a7 Support gpg-verify=false for subcloud remote ostree pull
This commit supports the developer use-case of a system controller
ostree repo configured with gpg-verify=false. In such cases, the
subcloud ostree repo instances must also be configured with
gpg-verify=false, or the ostree pull will fail.

We detect the boot parameter 'instgpg=0'. In which case we configure the
ostree repo with gpg-verify=false.  The instgpg=0 parameter is also
detected by LAT /install, which handles the LAT side of the ostree
repo configuration.

Test Plan:
PASS:
- Install subcloud with non-GPG signed ostree commits present on system
  controller. Ensure the ostree pull is successful on subcloud, with a
  successful install.
- Ensure normal subcloud installation is successful

Story: 2010611
Task: 48309

Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
Change-Id: I40a0823ed1fc868aa5d4fb7686f1648440664037
2023-06-28 16:51:54 -04:00
Zuul fb1ab7114e Merge "Refactor from-load pxe setup in to-load kickstart" 2023-06-16 19:03:11 +00:00
Zuul 3d74a094b8 Merge "Fix ip -6 address netmask and workaround for multi-drivers-switch" 2023-06-16 18:53:56 +00:00
Kyle MacLeod 9e94f1834a Fix ip -6 address netmask and workaround for multi-drivers-switch
This commit fixes the missing support for bootstrap_address_prefix
in the miniboot ip -6 address add command. We check for the provided
prefix value parsed from the boot arguments and make sure that it is
applied if present. Note that the bootstrap_address_prefix is a
mandatory install value, so it will be provided. However, we leave the
capability for it to be missing, in order to de-risk this commit.

Additionally, a workaround is included for full support of
multi-drivers-switch given in the boot arguments. When this argument is
given we parse out the kernel module version and use it to replace the
current kernel modules for ice/i40e/iavf with the modules of the given
version.

Test Plan
PASS:
- Replace  miniboot.cfg at /var/miniboot/kickstart-override/miniboot.cfg
  on target lab system requiring multi-drivers-switch=cvl-2.54:
    - Using subcloud install-value
      extra_boot_params: multi-drivers-switch=cvl-2.54,
      verify that the subcloud switches to the legacy kernel modules
      and the subcloud is able to properly configure its IP address and
      perform the ostree pull operation from the system controller.
- Install subcloud with no extra_boot_params, verify that the
  bootstrap_address_prefix is properly applied. Verify no regression.

Closes-Bug: 2023407

Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
Change-Id: I4f3d8e2f240f2aa061de30014cf39dfb9b42a035
2023-06-16 12:17:25 -04:00
Zuul e8bbc8c6d3 Merge "Create pmon config file for sssd to run on storage" 2023-06-14 14:05:19 +00:00
Andy Ning 8da5f0fe19 Create pmon config file for sssd to run on storage
Currently sssd is not configured and running on storage nodes so
ldap users can't login to storage nodes. This update creates sssd
pmon config file so that sssd is running on storage nodes.

Test Plan:
PASS: System with storage nodes deployment
PASS: In storage nodes, verify that the following config file exist:
      /etc/pmon.d/sssd.conf
PASS: In storage nodes, verify that sssd is running by
      systemctl status sssd
PASS: In storage nodes, verify ldap users are accessible by
      getent passwd

Closes-Bug: 2023399
Depends-On: https://review.opendev.org/c/starlingx/stx-puppet/+/885878
Change-Id: I2e85873c3ddd18bab68365a58b5a8617eb1b2766
Signed-off-by: Andy Ning <andy.ning@windriver.com>
2023-06-12 09:35:18 -04:00
Kyle MacLeod 5f34e2843d Translate extra_boot_params into disk boot kernel options
The extra_boot_params install value is presented as a single boot
parameter in the initial miniboot ISO boot. This kickstart change
translates the install value into proper disk boot kernel options, so
that the provided extra_boot_params are applied as boot options for the
main /boot parameters in grub and syslinux.

Although the extra_boot_params value must be a single string, multiple
extra boot parameters can be specified by separating individual args
by a comma. Example: extra_boot_params=arg1=1,arg2=2. This change splits
the args by comma and ensures that the kernel boot options are separate
for the main boot.

Test Plan
PASS:
- Verify that extra_boot_params is parsed into separate kernel options
- Verify that disk kernel options are applied when subcloud is installed
  (i.e., the final install boots with the configured extra options)
- Verify comma-separated input values are translated into proper
  kernel options:
    - extra_boot_params=arg1=1,arg2=2 -> kernel options: arg1=1 arg2=2
    - extra_boot_params=arg1=1 -> kernel options: arg1=1
    - extra_boot_params=arg1 -> kernel options: arg1

Partial-Bug: 2023407
Depends-On: https://review.opendev.org/c/starlingx/distcloud/+/885758

Change-Id: I8ed10f7ffe8af51ae7b77eaa398b824347a0a998
Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
2023-06-09 12:12:47 -04:00
Zuul a1acf1a0d1 Merge "Fix prestage ISO install abort if previous subcloud install exists" 2023-05-23 21:55:34 +00:00
Kyle MacLeod d807f6b65e 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 <kyle.macleod@windriver.com>
2023-05-23 10:51:54 -04:00
Kyle MacLeod 018d06ccec miniboot: Use release-specific prestage data, handle subcloud downgrade
This commit handles the relocation of ostree_repo prestaging data from
/opt/platform-backup to /opt/platform-backup/<release>. The miniboot.cfg
kickstart now looks for prestaged data in the release-specific location.

We also handle the backup partition name change across CentOS/Debian. In
the case of a downgrade the CentOS miniboot kickstart code is updated to
use the partition GUID rather than LABEL or PARTLABEL. The GUID is
constant across all releases and is therefore a more reliable indicator
of the backup partition.

Tech debt: Fix the arbitrary wait sleep calls used when configuring
VLAN addressing. Now uses the more efficient wait_for_interface
approach for the VLAN links.

Test Plan
PASS:
- Boot with prestaged data under /opt/platform-backup/<release>/
  Ensure boot/install successfully uses prestaged data.
- Boot into older release under prestaged /opt/platform-backup/21.12
    - Test moving from 22.12 -> 21.12 and 21.12 -> 22.12
    - Ensure backup partition is found using GUID approach.
    - Ensure boot/install successfully uses prestaged data.
- Boot into both current and older release with no prestaged data
    - Test moving from 22.12 -> 21.12 and 21.12 -> 22.12
    - Ensure boot/install is successful.
- Boot subcloud with bootstrap_vlan, ensure that the wait_for_interface
  calls properly wait until the link is up.

Story: 2010611
Task: 47943
Depends-On: https://review.opendev.org/c/starlingx/distcloud/+/880789

Change-Id: I381b60285e9bfc375f01f45b79174b71da7f0565
Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
2023-05-18 13:46:30 -04:00
junfeng-li d9d7111cd8 Refactor from-load pxe setup in to-load kickstart
Details: Since this is the first Debian to Debian upgrade,
we need to refactor some existing code that is used for
centOS upgrade.

This commit is

	1. clean up CentOS related code
	2. copy to-load pxeboot-update.sh to /etc/ during the import
	   instead of /usr/sbin/
	3. install to-load pxeboot-update.sh in /etc/ instead of
	   /usr/sbin/ during iso installation
	4. update kickstart Upgrade Support accordingly to set up
    	   from-load feed

Test Plan:

PASS: built the iso for upgrade
PASS: upgraded from 22.12 to 23.09 in DX
PASS: downgrade from 23.09 to 22.12 in DX

Depends-on: https://review.opendev.org/c/starlingx/tools/+/881882

Task: 47805
Story: 2010651
Signed-off-by: Junfeng (Shawn) Li <junfeng.li@windriver.com>
Change-Id: Ia67f5f3e66f5b33c3d7fb8d93a15547d59eaa71e
2023-05-16 15:42:33 +00:00
Kyle MacLeod 8be0edb971 Support nexthop_gateway in IPv6
Re-add support for nexthop_gateway in IPv6 configurations in Debian.

Ensure the translated nexthop_gateway boot parameter is applied to IPv6
network configurations.

These changes are applied to both the pre-ostree-pull network
configuration (via 'ip' command), and the /etc/network/interfaces.d
ifupdown interface configuration.

Test Plan
PASS:
- Test IPv6 install using only nexthop_gateway value
    - With and without bootstrap_vlan
    - Ensure that the default route is created, via the given
      nexthop_gateway
    - Validate successful ostree repo pull
    - Ensure that the default route is created via the
    - /etc/network/interfaces.d upon reboot into the ostree repo
    - Validate that communications are established to subcloud, ready
      for ansible bootstrap
- Test IPv6 install using no nexthop_gateway value
    - With and without bootstrap_vlan
    - Verify that default route is created, with no gateway
- Test IPv4 install using only nexthop_gateway value
    - With and without bootstrap_vlan
    - Ensure that the default route is created, via the given
      nexthop_gateway
    - Full install plus bootstrap, as above
    - Tested in libvirt
- Test IPv4 install using no nexthop_gateway value
    - With and without bootstrap_vlan
    - Verify that default route is created, with no gateway
    - Full install plus bootstrap, as above
    - Tested in libvirt

Closes-Bug: 2017007

Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
Change-Id: Iee71f753983fa77ad396a6a90e2f6cec189cbaa8
Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
2023-04-20 13:27:34 -04:00
Kyle MacLeod 5bd181cdcf miniboot: fix incorrect vlan interface applied for default route
This commit fixes a but where the ip route add default is referencing
the management device name instead of the interface name (containing
vlan tag).

The issue is only seen when the OAM network is on a VLAN and
is a separate network (requires nexthop_gateway setting in
install values).

The fix is to apply the root on the vlan interface, not the top-level
network device interface.

Test Plan
PASS:
- Verify installation on system with OAM network on separate VLAN using
  nexthop_gateway
- Verify installation on system with vlan but no nexthop_gateway

Closes-Bug: 2013372
Change-Id: Ic3febbd0cb77dd21435f23859e6d228e6ab95a8c
Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
2023-04-05 17:04:08 -04:00
Luis Sampaio 8003735fb3 kickstart update for patched iso
This commit copies the patch xml metadata
if the patches directory exists in a pxeboot
installation and copies the xml content to the
patch repository at /opt/patching.

* Currently this only works for USB Install.

Test:
Pass: Install via pxeboot and sw-patch query works

Story: 2009969
Task: 46467
Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
Change-Id: I667525c6343b6bd97866953b2373654e6c2d29ac
2023-03-13 10:35:32 -07:00
Zuul 6eb996f419 Merge "Update platform-kickstarts debian package ver based on git" 2023-02-24 04:04:25 +00:00
Eric MacDonald ff6e4d9b41 Revert "Unlock root account"
This reverts commit 4eaba3a4a9.

Reason for revert: Emergency Mode debug complete. Need to re-lock root account

Change-Id: If396b99ceaf0199a246a61df906961a346a50eb1
2023-02-23 18:29:22 +00:00
Al Bailey a975004cb6 Update platform-kickstarts debian package ver based on git
Update debian package versions to use git commits for:
 - platform-kickstarts

Old version was: 5
New version is: 167

The Debian packaging has been changed to reflect all the
git commits under the directory, and not just the commits
to the metadata folder.

This ensures that any new code submissions under those
directories will increment the versions.

Test Plan:
  PASS: build-pkgs -p platform-kickstarts

Story: 2010550
Task: 47400

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Id5fb0c329840c89a8559125cbac4f77315132d1c
2023-02-22 20:06:43 +00:00
Eric MacDonald 4eaba3a4a9 Unlock root account
A case of Emergency Mode has been seen.
Need to unlock root account to enable debug.

Test Plan:

Build load and verify root login

Story: 2010533
Task: 47392
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
Change-Id: I818014f59ea28df8dc4c3f6b61432ba45145ca1a
2023-02-16 14:53:18 -05:00
Robert Church 3eef0bd7ee Add hwsettle support to pxeboot-update.sh and kickstarts
Add support for adding the hwsettle boot line parameter based on the
value provided to the installer. This will institute an init delay to
allow multipath constituent devices to become available prior to the the
start of coalescing.

Test Plan:
PASS - AIO-SX: HPE multipath install/bootstrap/unlock
PASS - AIO-SX: Qemu virtual multipath install/bootstrap/unlock
PASS - AIO-DX: Qemu virtual multipath install/bootstrap/unlock
PASS - AIO-DX+: Qemu virtual multipath install/bootstrap/unlock
PASS - 2+2 (controller storage): Qemu virtual multipath install/
bootstrap/unlock
PASS - 2+2+2 (dedicated storage): Qemu virtual multipath install/
bootstrap/unlock
PASS - Add OSD ceph storage configuration (AIO-SX)
PASS - Expand CGTS volume group using extra disk (Partition) (AIO-SX)
PASS - Expand CGTS volume group using extra disk (disk) (AIO-SX)
PASS - Add nova local volume group using extra disk (AIO-SX)
PASS - App pod that alocates and writes into a PVC (AIO-SX)
PASS - Local disk Commands (Disk API) - AIO-SX/DX
- host-disk-list
- host-disk-show
- host-disk-partition-list
- host-disk-partition-show
- host-pv-list
- host-pv-show
- host-stor-list
- host-stor-show
- host-lvg-list
- host-lvg-show
- host-pv-add
PASS - Create nova-local volume group
PASS - Local disk Commands on AIO-DX after swact

Regression:
PASS - AIO-SX: Non-multipath install/bootstrap/unlock (NVME)
PASS - AIO-DX: Non-multipath install/bootstrap/unlock (SSD)
PASS - 2+2: Non-multipath install/bootstrap/unlock (SSD)
PASS - 2+2+2 : Non-multipath install/bootstrap/unlock (SSD and HD)
PASS - Distributed cloud: Non-multipath install/bootstrap/unlock

Change-Id: I38586cd98d0635a16490e7b987617b8d7ec5e20e
Depends-On: https://review.opendev.org/c/starlingx/tools/+/860590
Story: 2010046
Task: 47268
Signed-off-by: Robert Church <robert.church@windriver.com>
2023-02-15 15:56:31 +00:00
Adriano Oliveira a446585145 Refactor kickstarts to integrate multipath support
Refactor kickstart.cfg and miniboot.cfg device management to support
to support multipath disks. This includes:
- Improving function names for clarity
- Improving function docs (params, returns, examples)
- Add get_part_prefix() to provide a common function used to dynamically
  build the partition device names
- Add discovery of multipath disks as an install media option if no
  instdev is provided.
- Add support for by-id/wwn-* multipath persistent device names. This is
  in addition to by-path/* HDD/SSD/NVMe persistent device names which
  enables consistent disk usage, across reboots, irrespective of kernel
  device node enumeration inconsistencies.

Test Plan:
PASS - AIO-SX: HPE multipath install/bootstrap/unlock
PASS - AIO-SX: Qemu virtual multipath install/bootstrap/unlock
PASS - AIO-DX: Qemu virtual multipath install/bootstrap/unlock
PASS - AIO-DX+: Qemu virtual multipath install/bootstrap/unlock
PASS - 2+2 (controller storage): Qemu virtual multipath install/
       bootstrap/unlock
PASS - 2+2+2 (dedicated storage): Qemu virtual multipath install/
       bootstrap/unlock
PASS - Add OSD ceph storage configuration (AIO-SX)
PASS - Expand cgts volume group using extra disk (Partition) (AIO-SX)
PASS - Expand cgts volume group using extra disk (disk) (AIO-SX)
PASS - Add nova local volume group using extra disk (AIO-SX)
PASS - App pod that allocates and writes into a PVC (AIO-SX)
PASS - Local disk commands (Disk API) - AIO-SX/DX
- host-disk-list
- host-disk-show
- host-disk-partition-list
- host-disk-partition-show
- host-pv-list
- host-pv-show
- host-stor-list
- host-stor-show
- host-lvg-list
- host-lvg-show
- host-pv-add
PASS - Create nova-local volume group
PASS - Local disk commands on AIO-DX after swact

Regression:
PASS - AIO-SX: Non-multipath install/bootstrap/unlock (NVME)
PASS - AIO-DX: Non-multipath install/bootstrap/unlock (SSD)
PASS - 2+2: Non-multipath install/bootstrap/unlock (SSD)
PASS - 2+2+2 : Non-multipath install/bootstrap/unlock (SSD and HD)
PASS - Distributed cloud: Non-multipath install/bootstrap/unlock

Change-Id: I8b7ab349d9991810d4faad9c3f7e3be625d6ed5c
Depends-On: https://review.opendev.org/c/starlingx/tools/+/860590
Story: 2010046
Task: 46567
Co-Authored-By: Matheus Guilhermino <matheus.machadoguilhermino@windriver.com>
Co-Authored-By: Robert Church <robert.church@windriver.com>
Signed-off-by: Adriano Oliveira <adriano.oliveira@windriver.com>
Signed-off-by: Robert Church <robert.church@windriver.com>
2023-02-14 15:09:10 -03:00
Zuul acbd301a1c Merge "Update pxe boot directory in kickstart for 21.12" 2023-01-25 19:44:32 +00:00
Shrikumar Sharma ea1b8629e6 Fix for detection of existing file system in the prestage process
During prestage with a prestage iso, the existing filesystem must
not be overwritten if an installation with an install_guid exists,
when the force_install parameter is not specified.

However, when logical volumes are used, the check for a valid
installation does not succeed, resulting in the installer
overwriting the existing installation.

This commit fixes this issue by inspecting the volume for an
installation. This commit also ensures that if an invalid storage
device is specified for root device, then a failure is reported
and the system breaks into a bash shell.

Test Plan:

PASS: Verify that the installer does not overwrite an existing
installation with an install_guid.

PASS: Verify that the installer reports an error and breaks into
a bash shell if an invalid storage device is specified for root
device.

Closes-Bug: 2002999

Change-Id: I1d4ef10ce741b98455c65467367448e05f37fd64
Signed-off-by: Shrikumar Sharma <shrikumar.sharma@windriver.com>
2023-01-17 17:14:22 +00:00
Zuul 2d51929684 Merge "Fix bug in recent worker_reserved.conf handling" 2022-12-15 20:13:25 +00:00
emacdona 97ccd3d962 Fix bug in recent worker_reserved.conf handling
The new TEMPLATE_FILE and TARGET_FILE is out of
scope for work installs.

Test Plan:

PASS: Verify worker only install

Closes-Bug: 1999561
Signed-off-by: emacdona <eric.macdonald@windriver.com>
Change-Id: Id6ce9e773a208637a32d355e6a0bfb3745437eaa
2022-12-15 12:15:48 -05:00
Kyle MacLeod 35a2f1c296 Validate prestaged ostree_repo via checksum
For installs using prestage data (prestaging or prestage ISO),
an md5 directory-based checksum is now included at the same
directory level as ostree_repo (via related commits).

This commit adds a validation check for any prestaged
/opt/platform-backup/ostree_repo.

The validation check consists of the following:
- If a checksum file exists, use it for validation
- Otherwise, print a warning and fall back to using ostree fsck
    - The ostree fsck command takes much longer to complete.

If the validation check fails, the prestage data is removed, and the
remote install falls back to doing a fresh ostree pull from the system
controller.

If the validation fails for a local prestage ISO install,
the installation will fail during boot. This is unlikely;
it would only happen if the USB is somehow corrupt.

Test Plan

PASS: Remote installs
- Boot subcloud using prestage ISO. Perform remote install.
  Verify the checksum is validated as part of a successful install
  and bootstrap.
- Boot subcloud using prestage ISO. Manually corrupt the
  /opt/platform-backup/ostree_repo. Perform remote install.
  Verify the following:
  1) the checksum validation fails,
  2) the corrupt /opt/platform-backup/ostree_repo directory is removed
  3) the installation continues via remote ostree pull.

PASS: Local Install
- Boot subcloud using prestage ISO. Perform local install.
  Verify the checksum is validated as part of a successful install
  and bootstrap.

PASS: Pre-corrupted ISO
- Boot subcloud using a prestage ISO with a pre-corrupted ostree_repo
  Verify the boot fails due to the checksum validation failure.

Depends-On: https://review.opendev.org/c/starlingx/utilities/+/867179
Depends-On: https://review.opendev.org/c/starlingx/ansible-playbooks/+/867178
Closes-Bug: 1999306

Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
Change-Id: I1fb69b76de4b7fa5bc49cb4b182297b3bb94ba78
2022-12-15 11:13:04 -05:00