CentOS Linux 8 to CentOS Stream 8 migration¶
As was recently announced, CentOS Linux 8 will reach end-of-life at the end of 2021 and all users should migrate to CentOS Stream 8 before then. Migration from C8 to CS8 is very simple, as it mostly entails changing repositories and upgrading packages.
Please find below the instructions for your particular setup:
Migration for unmanaged, standalone or locmap-managed machines¶
As root, run the following commands on the machine to migrate:
dnf swap centos-linux-repos centos-stream-repos
dnf distro-sync --disablerepo=openafs*
After step 1, some repositories (such as the
openafs ones, if used) may be inaccessible
due to a missing DNF variable, which is why those repositories need to be
disabled in step 2 (this means you may need to disable other repos if necessary).
Step 2 will change some repository configuration files, so the second distro-sync in step 3 is necessary to upgrade packages coming from those repositories as well.
The reboot is necessary to use the new kernel and it's associated modules.
Migration for CERN IT Puppet-managed machines (VMs or Ironic Bare Metal)¶
Before starting, it is strongly recommended that you create a new machine with a CS8 image in your hostgroup. This will allow you to verify that your Puppet catalog compiles correctly, that all your dependencies are met and that all functional tests for your service pass. Doing this will significantly improve your chances of a smooth migration.
Once that is complete, you have two migration options:
Create or Rebuild machines¶
You can use
ai-bs to create new machines in your hostgroup:
$ ai-bs --cs8 -g foohostgroup fooname.cern.ch
Or you can use
ai-rebuild to rebuild your existing machines:
$ ai-rebuild --cs8 fooname.cern.ch
Migration with no reinstall for CERN IT Puppet-managed machines was enabled by the changes in CRM-3981. Here are the steps to follow:
- Remove your machine(s) from production, you will be rebooting and your service will be impacted.
- In Hiera, set
base::migrate::stream8: truefor the machine/hostgroup you wish to upgrade.
puppet agent -ton your machine(s) twice. This could be done with mco like this:
$ mco puppet runonce --batch 100 --batch-sleep 60 -t 5 -T lxsoft -F hostgroup_0=lxsoft $ mco puppet status --batch 100 --batch-sleep 60 -t 5 -T lxsoft -F hostgroup_0=lxsoft (repeat until all machines are "Currently idling") $ mco puppet runonce --batch 100 --batch-sleep 60 -t 5 -T lxsoft -F hostgroup_0=lxsoft
systemctl start --wait dnf-distro-sync.service. With mco, this would be:
$ mco shell run "systemctl start --wait dnf-distro-sync.service" --batch 100 --batch-sleep 60 -t 5 -T lxsoft -F hostgroup_0=lxsoft
- Once you're happy, add your machine(s) back into production.
The first Puppet run is needed so Facter reports this machine as a CS8 machine to the Puppet servers, the second Puppet run is the one that actually configures the new repositories. Both of them must complete before running distro-sync.
Migration for non-IT Puppet-managed machines¶
Puppet module changes¶
You will need to change your Puppet modules to account for the new distribution and new sets of repos. Detailed instructions are outside the scope of this guide, but you can use the following merge requests as inspiration:
On the machines to upgrade:
- Replace the contents of
CentOS Stream release 8. This will "trick" Facter into reporting that machine as a CS8 machine.
puppet agent -ttwice.
dnf swap centos-linux-repos centos-stream-repos, otherwise the distro-sync won't be able to succeed.