949 Commits

Author SHA1 Message Date
Davlet Panech
414f61b9df Fix github mirroring for this repo
Updating the rsa ssh host key based on:
https://github.blog/2023-03-23-we-updated-our-rsa-ssh-host-key/

Note: In the future, StarlingX should have a zuul job and
secret setup for all repos so we do not need to do this
for every repo.

Needed to rename the secret, because zuul fails if like-named
secrets have diffent values in different branches of the same
repo.

Partial-Bug: #2015246
Change-Id: I0d13874c1d3018164d6afcd2e2ff551b4c7618b1
Signed-off-by: Davlet Panech <davlet.panech@windriver.com>
2023-04-28 12:38:51 -04:00
Zuul
5babe39c78 Merge "Create Redfish Secure Boot Controller tool" 2023-04-27 19:39:20 +00:00
Samuel Pei
99fd1b15b3 Create Redfish Secure Boot Controller tool
The process of enabling/disabling Secure Boot and uploading a
certificate on a server is complicated and time consuming.

This update introduces a Redfish Secure Boot Controller (rsbc)
Tool to automate the process of querying/enabling/disabling
Secure Boot on a server as well as uploading the secure boot
certificate to the host.

The tool also supports a service option which allows the user
to query which Redfish services are supported on the server(s).

Story: 2010533
Task: 47811

Test Plan:

PASS: Verify SB query against server that supports SB
PASS: Verify SB query against server that does not support SB
PASS: Verify SB enable/disable against server that supports SB
PASS: Verify SB upload against server that supports SB
PASS: Verify Redfish service on server that supports SB
PASS: Verify Redfish service on server that supports VM
PASS: Verify Redfish service on multiple servers
PASS: Verify end-to-end SB enable, upload and server secure boot.
PASS: Verify end to end SB enable, upload and server SB w/ ipv4, un, and pw
PASS: Verify service and SB query against a server using ipv6, un, and pw

Failure Path:

PASS: Verify handling of passing an invalid certificate
PASS: Verify handling of invalid command line input
PASS: Verify handling of incorrectly formatted input file
PASS: Verify SB enable/disable against server that does not supports SB
PASS: Verify handling when server is not reachable
PASS: Verify handling when server is unpingable

Signed-off-by: Samuel Pei <samuel.pei@windriver.com>
Change-Id: I1606112493d0313fa3d86034172c5cf965c557d4
2023-04-27 18:49:04 +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
Zuul
f7e1be7d78 Merge "Copy patch metadata so to display patch info" 2023-04-13 14:44:12 +00:00
Bin Qian
4ec6fb2ffe Copy patch metadata so to display patch info
This is to copy patch metadata to patch metadata and feed
directory to properly setup patch info for N+1 release in
load-import.

TCs:
     Passed: Import pre-patched load to verify the patch info is
             visible with sw-patch query command before upgrade.
     Passed: Patch info is visible on controller-1 after it is upgraded.
     Passed: Patch info is visible on controller-0 after it is upgraded.

Closes-Bug: 2015110

Signed-off-by: Bin Qian <bin.qian@windriver.com>
Change-Id: I6cb330e7665bc170bf8206342643cfdefcb95ed1
2023-04-11 22:37:42 +00:00
Matheus Guilhermino
a0e270b51b Add mpath support to wipedisk script
The wipedisk script was not able to find the boot device
when using multipath disks. This is due to the fact that
multipath devices are not listed under /dev/disk/by-path/.

To add support to multipath devices, the script should look
for the boot device under /dev/disk/by-id/ as well.

Test Plan
PASS: Successfully run wipedisk on a AIO-SX with multipath
PASS: Successfully run wipedisk on a AIO-SX w/o multipath

Closes-bug: 2013391

Signed-off-by: Matheus Guilhermino <matheus.machadoguilhermino@windriver.com>
Change-Id: I3af76cd44f22795784a9184daf75c66fc1b9874f
2023-04-10 17:10:22 -03: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
Al Bailey
37c5910a62 Update mtce debian package ver based on git
Update debian package versions to use git commits for:
 - mtce         (old 9, new 30)
 - mtce-common  (old 1, new 9)
 - mtce-compute (old 3, new 4)
 - mtce-control (old 7, new 10)
 - mtce-storage (old 3, new 4)

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 mtce
  PASS: build-pkgs -p mtce-common
  PASS: build-pkgs -p mtce-compute
  PASS: build-pkgs -p mtce-control
  PASS: build-pkgs -p mtce-storage

Story: 2010550
Task: 47401
Task: 47402
Task: 47403
Task: 47404
Task: 47405

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I4846804320b0ad3ec10799a468a9ee3bf7973587
2023-03-02 14:50:35 +00:00
Zuul
6eb996f419 Merge "Update platform-kickstarts debian package ver based on git" 2023-02-24 04:04:25 +00:00
Zuul
9e2150a8bc Merge "Update pxe-network-installer debian package ver based on git" 2023-02-24 04:04:20 +00:00
Zuul
534f0990cc Merge "Update platform-upgrades debian package ver based on git" 2023-02-24 03:58:56 +00:00
Eric MacDonald
ff6e4d9b41 Revert "Unlock root account"
This reverts commit 4eaba3a4a9be66ad428950546b326cb15920c67c.

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
Al Bailey
cd5f8df470 Update pxe-network-installer debian package ver based on git
Update debian package versions to use git commits for:
 - pxe-network-installer

Old version was: 8
New version is: 23

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 pxe-network-installer

Story: 2010550
Task: 47399

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I80f65e991872697c048d5833943f9e63d3572a05
2023-02-22 19:58:57 +00:00
Al Bailey
d3f64443f3 Update platform-upgrades debian package ver based on git
Update debian package versions to use git commits for:
 - platform-upgrades

bsp-files/upgrades contains the platform-upgrades package.

Old version was: 1
New version is: 7

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-upgrades

Story: 2010550
Task: 47398

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ib441b4ead97749dbf109f973752b7de774f1b21b
2023-02-22 19:54:13 +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
Zuul
17c2912bd6 Merge "Refactor kickstarts to integrate multipath support" 2023-02-15 15:39:28 +00:00
Kyale, Eliud
502662a8a7 Cleanup mtcAgent error logging during startup
- reduced log level in http util to warning
- use inservice test handler to ensure state change notification
  is sent to vim
- reduce retry count from 3 to 1 for add_handler state_change
  vim notification

Test plan:
PASS - AIO-SX: ansible controller startup (race condition)
PASS - AIO-DX: ansible controller startup
PASS - AIO-DX: SWACT
PASS - AIO-DX: power off restart
PASS - AIO-DX: full ISO install
PASS - AIO-DX: Lock Host
PASS - AIO-DX: Unlock Host
PASS - AIO-DX: Fail Host ( by rebooting unlocked-enabled standby controller)

Story: 2010533
Task: 47338

Signed-off-by: Kyale, Eliud <Eliud.Kyale@windriver.com>
Change-Id: I7576e2642d33c69a4b355be863bd7183fbb81f45
2023-02-14 14:18:02 -05: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
Christopher Souza
56ab793bc5 Change hostwd emergency log to write to /dev/kmsg
The hostwd emergency logs was written to /dev/console,
the change was to add the prefix "hoswd:" to the log message
and write to /dev/kmsg.

Test Plan:

Pass: AIO-SX and AIO DX full deployment.
Pass: kill pmond and wait for the emergency log to be written.
Pass: check if the emergency log was written to /dev/kmsg.
Pass: Verify logging for quorum report missing failure.
Pass: Verify logging for quorum process failure.
Pass: Verify emergency log crash dump logging to mesg and
      console logging for each of the 2 cases above with
      stressng overloading the server (CPU, FS and Memory);
      stress-ng --vm-bytes 4000000000 --vm-keep -m 30 -i 30 -c 30

Story: 2010533
Task: 47216

Co-authored-by: Eric MacDonald <eric.macdonald@windriver.com>
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
Co-authored-by: Christopher Souza <Christopher.DeOliveiraSouza@windriver.com>
Signed-off-by: Christopher Souza <Christopher.DeOliveiraSouza@windriver.com>
Change-Id: I0da82f964dd096840259c4d0ed4e5f558debdf22
2023-02-01 23:41:14 +00:00
Zuul
acbd301a1c Merge "Update pxe boot directory in kickstart for 21.12" vr/stx.8.0 __v.stx.test2 2023-01-25 19:44:32 +00:00
Zuul
424fdee3dc Merge "Fix 21.12 feed directory for 22.12 upgrade" 2023-01-20 16:06:44 +00:00
Junfeng (Shawn) Li
d3a7f90c0b Fix 21.12 feed directory for 22.12 upgrade
Details: The 21.12 feed directory is in /www/pages/feed/rel-21.12/.
The import.sh script in 22.12 iso is looking for the feed directory
in /var/www/pages/feed/rel-21.12/.

This commit is to make sure the import.sh is looking at
the right feed directory in different CentOS release

Test Plan:

PASS: ran the upgrade from 21.12 and feed directory is set up
PASS: ran the upgrade from 22.06 and feed directory is set up

Task: 46918
Story: 2009303
Signed-off-by: Junfeng (Shawn) Li <junfeng.li@windriver.com>
Change-Id: I30ea6403c336daa618c9b650ba94cfa1f94533f8
2023-01-18 09:20:18 -05: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
68452f367b Merge "Avoid logging in fork_sysreq_reboot failsafe thread" 2023-01-10 16:53:51 +00:00
Eric MacDonald
67c4f1b148 Avoid logging in fork_sysreq_reboot failsafe thread
Continuing to log in the fork_sysreq_reboot failsafe thread
is seen to cause mtcAgent and mtcClient log file corruption
with binary data.

As an avoidance measure this update changes the offending
information logs to normally disabled debug logs.

Test Plan:

PASS: Verify build, install and provision system with debian iso
      - AIO SX (hw), Standard 2+1 (vbox)
PASS: Verify mtcAgent and mtcClient log files do not get
      binary data (corruption) injected over a self reboot.
PASS: Verify lock and unlock of AIO SX host
PASS: Verify lock and unlock of system node from active controller
PASS: Verify host reboot command
PASS: Verify critical process failure reboot handling

Closes-Bug: 2001719
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
Change-Id: Ib49ee427d2a6363ce21ec7488b1f739986828219
2023-01-10 11:38:12 -05:00
Eric MacDonald
a3cba57a1f Adapt Host Watchdog to use kdump-tools
The Debian package for kdump changed from kdump to kdump-tools

Test Plan:

PASS: Verify build and install AIO DX system
PASS: Verify host watchdog detects kdump as active in debian

Closes-Bug: 2001692
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
Change-Id: Ie1ac29d3d29f3d9c843789cdedf85081fe790616
2023-01-04 12:57:19 -05:00
Zuul
85ea002112 Merge "Remove console=ttyS0,115200 from system node install menus" 2023-01-04 17:11:40 +00:00
Al Bailey
5f85f2066a Update tox.ini to work with tox 4
This change will allow this repo to pass zuul now
that this has merged:
https://review.opendev.org/c/zuul/zuul-jobs/+/866943

Tox 4 deprecated whitelist_externals.
Replace whitelist_externals with allowlist_externals

Partial-Bug: #2000399

Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: Ib2aea53615a378ce47d2a2b23ec2e1946c312eed
2022-12-26 23:26:54 +00:00
Eric MacDonald
3fee973f9e Remove console=ttyS0,115200 from system node install menus
This update removes the 'console=ttyS0,115200' grub command
line arguement from the debian system node install menus.

Then allow system inventory to add a customer specified
console setting at node provisioning time by way of
xxxAPPEND_OPTIONSxxx variable replacement.

Test Plan:

PASS: Verify all system node install grub menus get 'ttySx*'
      value from system inventory. (dm config)
PASS: Verify all system node install grub menus default
      to "ttyS0,115200" if missing for a node's provisioning
      in system inventory. (vbox config)

Partial Bug: 2000093
Depends-On: https://review.opendev.org/c/starlingx/config/+/868353

Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
Change-Id: I866f29233d2f2e637725a98b445ac6d24333ea30
2022-12-21 11:07:45 -05: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
emacdona
af7defe48f Add error checking to worker_reserved.conf handling
This update add error checking and error handling to
worker_reserved.conf update handling.

Test Plan:

PASS: Verify kickstart logging around worker_reserved
      update for each of the install cases below.
PASS: Verify subcloud install
PASS: Verify All In One controller install
PASS: Verify worker only install
PASS: Verify standard Controller install

Closes-Bug: 1999561
Signed-off-by: emacdona <eric.macdonald@windriver.com>
Change-Id: I7ccdd9cc02908fcb0fe0a403c2b2141bd44b692a
2022-12-14 12:01:47 +00:00
Zuul
f96df1e18b Merge "Remove minimal PV support on AIO/workers" 2022-12-09 23:17:01 +00:00
Charles Short
52e7b9d979 debian: Manage /etc/platform/worker_resource.conf
Install the /etc/platform/worker_resource.conf based
on personaility type. The worker_resource.conf should
be installed on AIO/worker and worker types. But not
on controller only or storage types.

Test Plan
PASSED Build worker-utils package
PASSED Build ISO
PASSED Start a controller and check to make
       sure that the /etc/platform/worker_reserved.conf
       is not present.
PASSED Start a worker and check to make
       sure that the /etc/platform/worker_reserved.conf
       is present.
PASSED Install AIO and unlock host.
PASSED Install Standard installation and unlock host.

Story: 2009968
Task: 46980

Depends-On: https://review.opendev.org/c/starlingx/utilities/+/866496

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: I32f0a841e55bb2d45b005407f99ed6430b60bf48
2022-12-07 13:05:46 -05:00
Zuul
e1ecb6a005 Merge "Lock root account" 2022-12-07 05:09:50 +00:00
Shrikumar Sharma
b29e8c7345 Preserve persistent backup when invalid persistent_size provided
Miniboot wipes the backup-partition when the persistent size
is set to a value less than the existing size. The expectation is
that the install should fail and the contents of platform-backup
should be preserved.

This fix solves the issue by failing the installation during the
ks-early phase, where the provided persistent size value in the
kernel commandline can be read, and no disk operations have been
performed.

Test Plan:
PASS: Verify that installation with valid parameters passes.

PASS: Verify that reinstall fails if persistent_size less
      than the current persistent_size is provided.

PASS: Verify that contents of /opt/platform-backup are preserved
      when persistent_size less than the current size is
      provided.

PASS: Verify that reinstall fails if persistent_size greater
      than the size of the rootfs device is provided.

PASS: Verify that the contents of /opt/platform-backup are
      preserved when persistent-size greater than size of rootfs
      device is provided.

Closes-Bug: 1998932

Signed-off-by: Shrikumar Sharma <shrikumar.sharma@windriver.com>
Change-Id: I51351cb14cdcfa63b4b5839d935589d997b5403a
2022-12-06 17:57:21 +00:00
Eric MacDonald
dcc78cfdb9 Lock root account
This update stops setting the root password and locks the root account

Test Plan:

PASS: Verify root account can't be logged into with 'root' as password.
PASS: Verify can set root password with 'sudo passwd root'

Story: 2009968
Task: 46997
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
Change-Id: I5ae53c2e457ffba3cdaea7bb45ff82bb60945083
2022-12-06 12:53:13 +00:00
Zuul
07640af5df Merge "Perform remote ostree pull during local-based ostree install" 2022-12-05 00:46:58 +00:00
Robert Church
6132aa7317 Remove minimal PV support on AIO/workers
To support long running patch-able systems that don't require a
reinstall, the entire root disk will be allocated to the cgts-vg volume
group as part of installation.

This update simply removes the use of MINIMUM_PLATFORM_PV_SIZE and
ensures that the 'platform_pv' uses all available space.

NOTE: A followup commit will be provided to clean up the large, small,
      tiny disk references and provide an accurate log checking for and
      displaying minimal disk size based on default logical volume
      sizes.

Test Plan:
PASS - Install AIO-SX, bootstrap, unlock
PASS - Install 2+2+2, bootstrap, unlock

Change-Id: I3a50f2305b781de1cf9b80c5aed62b03bebc4790
Story: 2010444
Task: 46981
Signed-off-by: Robert Church <robert.church@windriver.com>
2022-12-03 12:36:45 -06:00
Kyle MacLeod
f15661bcf6 Allow e2fsck exit codes of 0,1
From the e2fsck man pages, the exit codes of 0, 1, 2 should
not be treated as failures.  We should never see exit code 2 though,
since it only occurs when e2fsck is run against a mounted filesystem.

The solution is to extend the check to only fail on exit code > 1.

Test Plan
PASS: Verify e2fsck exit code handling during subcloud install
      with resized partition

Closes-Bug: 1998611

Change-Id: Ie22fd77e3d2e2d631ba467b818bdc77c77f0d8b8
Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
2022-12-02 11:18:32 -05:00
Kyle MacLeod
d634510319 Perform remote ostree pull during local-based ostree install
For Redfish-based subcloud installs which use a local ostree repo as the
basis of their install, we perform a secondary ostree pull from the
system controller. This will pull any ostree commits which have been
applied (via patch) since the local ostree repo was created.

Note that this also requires syncing of the patch metadata via
/opt/patching. This step is done via the install ansible playbook.

Test Plan:

PASS:
- Simulate a local ostree-based install during a sushy subcloud add in
  libvirt. Verify that a remote ostree pull retrieves any patch commits
  from the system controller. This is done by manipulating ostree repo
  contents on the system controller during the miniboot.cfg kicktart.

PASS:
- Prestage a subcloud from a non-patched system controller.
  Prestaged ostree_repo is stored on platform-backup partition.
  Patch the system controller. Add the prestaged subcloud.
  Verify that the subcloud boots and that the patched ostree commit
  is transferred to the subcloud during the miniboot.cfg kickstart.

Partial-Bug: 1998256

Signed-off-by: Kyle MacLeod <kyle.macleod@windriver.com>
Change-Id: Iee08b40dc2b930dacbbf4df08b0f727eb945d4ba
2022-11-30 21:24:01 -05:00
Junfeng (Shawn) Li
63912dc0b0 Update pxe boot directory in kickstart for 21.12
Details: This change is to allow the kickstart looking for the
right pxe boot directory in 21.12 for 22.12 upgrade

Test Plan:
PASS: 22.12 Debian is installed on both controllers

Task: 46968
Story: 2009303

Signed-off-by: Junfeng (Shawn) Li <junfeng.li@windriver.com>
Change-Id: I3401a25d41dd3af2c63fdb90c83316a35a9733d0
2022-11-30 16:19:06 -05:00
Robert Church
1796ed8740 Update wipedisk for LVM based rootfs
Now that the root filesystem is based on an LVM logical volume, discover
the root disk by searching for the boot partition.

Changes include:
 - remove detection of rootfs_part/rootfs and adjust rootfs related
   references with boot_disk.
 - run bashate on the script and resolve indentation and syntax related
   errors. Leave long-line errors alone for improved readability.

Test Plan:
PASS - run 'wipedisk', answer prompts, and ensure all partitions are
       cleaned up except for the platform backup partition
PASS - run 'wipedisk --include-backup', answer prompts, and ensure all
       partitions are cleaned up
PASS - run 'wipedisk --include-backup --force' and ensure all partitions
       are cleaned up

Change-Id: I036ce745353b6a26bc2615ffc6e3b8955b4dd1ec
Closes-Bug: #1998204
Signed-off-by: Robert Church <robert.church@windriver.com>
2022-11-29 05:04:38 -06:00
Robert Church
b0066dcd27 Remove all volume groups by UUID
In cases when wipedisk isn't run or isn't working correctly,
pre-existing volume groups, physical volumes, and logical volumes will
be present on the root disk. Depending on the sizes and layout of the
previous install along with partial or aborted cleanup activities, this
may lead [unknown] PVs with duplicate volume group names.

Adjust the cleanup logic to:
- Discover existing volume groups by UUID so that duplicate volume
  groups (i.e two occurrences of cgts-vg) can be handled individually.
- Ignore [unknown] physical volumes in a volume group as they cannnot be
  removed. Cleaning up existing physical volumes across all volume
  groups will resolve any [unknown] physical volumes.

In addition, unify if/then for/do syntax in the %pre-part hook

Test Plan:
PASS - create a scenario with multiple partitions along with a
       nova-local and cgts-vg volume group that result in an [unknown]
       physical volume and a duplicate cgts-vg. Do not wipe the disks
       and install an ISO with the above changes. Observe proper cleanup
       and install.
PASS - Perform consecutive installs without wipedisk and observe proper
       cleanup and install

Change-Id: Idf845cf00ca3c009d72dedef0805a77d94fa3d97
Partial-Bug: #1998204
Signed-off-by: Robert Church <robert.church@windriver.com>
2022-11-29 05:04:06 -06:00
Robert Church
651bd76566 Ensure magic strings that are visible for libblkid are erased
In the case when the root disk partition table is wiped but individual
partitions are not wiped correctly, this will leave previous physical
volume metadata intact on the disk.

When a new LVM partition is created and assigned as a newly created
physical volume the old LVM metadata on the disk partition will prevent
the cgts-vg volume group from being created.

This update will wipe all the magic strings present in the new physical
volume partition established by the kickstart by executing 'wipefs -a'
prior to creating the cgts-vg.

Test Plan:
PASS - Successfully install an ISO with this change on a system that did
       not cleanup the LVM metatadata from a previous install. Log in to
       the installed system and confirm that the cgts-vg is properly
       configured.

Change-Id: I63f4235a27cb40a4283f0f4c34f63564a4f18cdd
Partial-Bug: #1998204
Signed-off-by: Robert Church <robert.church@windriver.com>
2022-11-29 04:40:42 -06:00