oracle / centos2ol

Script and documentation to switch CentOS/Rocky Linux to Oracle Linux
https://linux.oracle.com/switch/centos/
Universal Permissive License v1.0
346 stars 83 forks source link

CentOS 8.3 to Oracle Linux failed conversion on OpenVZ 7 VPS #6

Open centminmod opened 3 years ago

centminmod commented 3 years ago

On OpenVZ 7 VPS, the centos2ol.sh script will fail with below output for dracut: Cannot find module directory /lib/modules/4.18.0/

virt-what
openvz
lxc
bash centos2ol.sh | tee centos2ol.log
Checking for required packages...
Checking your distribution...
Checking for yum lock...
Checking for required python packages...
Finding your repository directory...
Looking for yumdownloader...
Backing up and removing old repository files...
Downloading Oracle Linux release package...
Oracle Linux 8 BaseOS Latest (x86_64)            35 MB/s |  27 MB     00:00    
Oracle Linux 8 Application Stream (x86_64)       32 MB/s |  21 MB     00:00    
Latest Unbreakable Enterprise Kernel Release 6   22 MB/s |  11 MB     00:00    
Last metadata expiration check: 0:00:02 ago on Sat Dec 12 06:41:14 2020.
(1/3): oraclelinux-release-el8-1.0-14.el8.x86_6 185 kB/s |  18 kB     00:00    
(2/3): redhat-release-8.3-1.0.0.1.el8.x86_64.rp 167 kB/s |  17 kB     00:00    
(3/3): oraclelinux-release-8.3-1.0.4.el8.x86_64 513 kB/s |  71 kB     00:00    
Switching old release package with Oracle Linux...
warning: oraclelinux-release-8.3-1.0.4.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ad986da3: NOKEY
warning: file /etc/yum.repos.d/CentOS-Linux-Sources.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-PowerTools.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-Plus.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-Media.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-HighAvailability.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-FastTrack.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-Extras.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-Devel.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-Debuginfo.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-ContinuousRelease.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-BaseOS.repo: remove failed: No such file or directory
warning: file /etc/yum.repos.d/CentOS-Linux-AppStream.repo: remove failed: No such file or directory
Installing base packages for Oracle Linux...
Last metadata expiration check: 0:00:06 ago on Sat Dec 12 06:41:14 2020.
> No match for argument: centos-backgrounds
No match for argument: centos-logos
No match for argument: centos-release-cr
No match for argument: desktop-backgrounds-basic
No match for argument: libreport-centos
No match for argument: libreport-plugin-mantisbt
No match for argument: libreport-plugin-rhtsupport
No match for argument: python3-syspurpose
No match for argument: python-oauth
No match for argument: sl-logos
No match for argument: yum-rhn-plugin
> Package basesystem-11-5.el8.noarch is already installed.
Package initscripts-10.00.9-1.el8.x86_64 is already installed.
Package grubby-8.40-41.el8.x86_64 is already installed.
> ===========================================================================================
 Package                Arch    Version                            Repository          Size
===========================================================================================
Installing:
 grub2-pc               x86_64  1:2.02-90.0.1.el8                  ol8_baseos_latest   40 k
 kernel-uek             x86_64  5.4.17-2036.100.6.1.el8uek         ol8_UEKR6           61 M
 oracle-logos           x86_64  80.5-1.0.6.el8                     ol8_baseos_latest  1.4 M
 plymouth               x86_64  0.9.4-7.20200615git1e36e30.0.1.el8 ol8_appstream      127 k
Upgrading:
 grub2-common           noarch  1:2.02-90.0.1.el8                  ol8_baseos_latest  885 k
 grub2-tools            x86_64  1:2.02-90.0.1.el8                  ol8_baseos_latest  2.0 M
 grub2-tools-minimal    x86_64  1:2.02-90.0.1.el8                  ol8_baseos_latest  205 k
 grubby                 x86_64  8.40-41.0.1.el8                    ol8_baseos_latest   50 k
Installing dependencies:
 freetype               x86_64  2.9.1-4.el8_3.1                    ol8_baseos_latest  394 k
 grub2-pc-modules       noarch  1:2.02-90.0.1.el8                  ol8_baseos_latest  869 k
 grub2-tools-efi        x86_64  1:2.02-90.0.1.el8                  ol8_baseos_latest  470 k
 grub2-tools-extra      x86_64  1:2.02-90.0.1.el8                  ol8_baseos_latest  1.1 M
 libpng                 x86_64  2:1.6.34-5.el8                     ol8_baseos_latest  126 k
 linux-firmware         noarch  999:20200902-999.5.gitd5f9eea5.el8 ol8_baseos_latest  122 M
 numactl-libs           x86_64  2.0.12-11.el8                      ol8_baseos_latest   36 k
 plymouth-core-libs     x86_64  0.9.4-7.20200615git1e36e30.0.1.el8 ol8_appstream      122 k
 plymouth-scripts       x86_64  0.9.4-7.20200615git1e36e30.0.1.el8 ol8_appstream       44 k
Removing:
 centos-linux-release   noarch  8.3-1.2011.el8                     @BaseOS             25 k

Transaction Summary
===========================================================================================
Install  13 Packages
Upgrade   4 Packages
Remove    1 Package

Total download size: 191 M
Downloading Packages:
(1/17): libpng-1.6.34-5.el8.x86_64.rpm          689 kB/s | 126 kB     00:00    
(2/17): grub2-pc-2.02-90.0.1.el8.x86_64.rpm     1.2 MB/s |  40 kB     00:00    
(3/17): oracle-logos-80.5-1.0.6.el8.x86_64.rpm  5.2 MB/s | 1.4 MB     00:00    
(4/17): numactl-libs-2.0.12-11.el8.x86_64.rpm   1.3 MB/s |  36 kB     00:00    
(5/17): grub2-tools-efi-2.02-90.0.1.el8.x86_64. 6.2 MB/s | 470 kB     00:00    
(6/17): grub2-tools-extra-2.02-90.0.1.el8.x86_6 6.1 MB/s | 1.1 MB     00:00    
(7/17): grub2-pc-modules-2.02-90.0.1.el8.noarch 8.6 MB/s | 869 kB     00:00    
(8/17): plymouth-scripts-0.9.4-7.20200615git1e3 1.5 MB/s |  44 kB     00:00    
(9/17): plymouth-0.9.4-7.20200615git1e36e30.0.1 4.4 MB/s | 127 kB     00:00    
(10/17): freetype-2.9.1-4.el8_3.1.x86_64.rpm    2.5 MB/s | 394 kB     00:00    
(11/17): plymouth-core-libs-0.9.4-7.20200615git 4.1 MB/s | 122 kB     00:00    
(12/17): grubby-8.40-41.0.1.el8.x86_64.rpm      1.8 MB/s |  50 kB     00:00    
(13/17): grub2-common-2.02-90.0.1.el8.noarch.rp 4.2 MB/s | 885 kB     00:00    
(14/17): grub2-tools-2.02-90.0.1.el8.x86_64.rpm  15 MB/s | 2.0 MB     00:00    
(15/17): grub2-tools-minimal-2.02-90.0.1.el8.x8 2.3 MB/s | 205 kB     00:00    
(16/17): kernel-uek-5.4.17-2036.100.6.1.el8uek.  41 MB/s |  61 MB     00:01    
(17/17): linux-firmware-20200902-999.5.gitd5f9e  43 MB/s | 122 MB     00:02    
--------------------------------------------------------------------------------
Total                                            67 MB/s | 191 MB     00:02     
warning: /var/cache/dnf/ol8_baseos_latest-e4c6155830ad002c/packages/libpng-1.6.34-5.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ad986da3: NOKEY
Oracle Linux 8 BaseOS Latest (x86_64)           3.0 MB/s | 3.1 kB     00:00    
Importing GPG key 0xAD986DA3:
 Userid     : "Oracle OSS group (Open Source Software group) <build@oss.oracle.com>"
 Fingerprint: 76FD 3DB1 3AB6 7410 B89D B10E 8256 2EA9 AD98 6DA3
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Running scriptlet: grub2-common-1:2.02-90.0.1.el8.noarch                  1/1 
  Upgrading        : grub2-common-1:2.02-90.0.1.el8.noarch                 1/22 
  Upgrading        : grub2-tools-minimal-1:2.02-90.0.1.el8.x86_64          2/22 
  Running scriptlet: grub2-tools-1:2.02-90.0.1.el8.x86_64                  3/22 
  Upgrading        : grub2-tools-1:2.02-90.0.1.el8.x86_64                  3/22 
  Running scriptlet: grub2-tools-1:2.02-90.0.1.el8.x86_64                  3/22 
  Installing       : grub2-pc-modules-1:2.02-90.0.1.el8.noarch             4/22 
  Installing       : plymouth-core-libs-0.9.4-7.20200615git1e36e30.0.1.    5/22 
  Running scriptlet: plymouth-core-libs-0.9.4-7.20200615git1e36e30.0.1.    5/22 
  Installing       : plymouth-scripts-0.9.4-7.20200615git1e36e30.0.1.el    6/22 
  Installing       : plymouth-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64    7/22 
  Installing       : numactl-libs-2.0.12-11.el8.x86_64                     8/22 
  Running scriptlet: numactl-libs-2.0.12-11.el8.x86_64                     8/22 
  Installing       : linux-firmware-999:20200902-999.5.gitd5f9eea5.el8.    9/22 
  Installing       : libpng-2:1.6.34-5.el8.x86_64                         10/22 
  Installing       : freetype-2.9.1-4.el8_3.1.x86_64                      11/22 
  Installing       : grub2-tools-extra-1:2.02-90.0.1.el8.x86_64           12/22 
  Installing       : grub2-pc-1:2.02-90.0.1.el8.x86_64                    13/22 
  Running scriptlet: kernel-uek-5.4.17-2036.100.6.1.el8uek.x86_64         14/22 
  Installing       : kernel-uek-5.4.17-2036.100.6.1.el8uek.x86_64         14/22 
  Running scriptlet: kernel-uek-5.4.17-2036.100.6.1.el8uek.x86_64         14/22 
  Upgrading        : grubby-8.40-41.0.1.el8.x86_64                        15/22 
  Installing       : grub2-tools-efi-1:2.02-90.0.1.el8.x86_64             16/22 
  Installing       : oracle-logos-80.5-1.0.6.el8.x86_64                   17/22 
  Running scriptlet: oracle-logos-80.5-1.0.6.el8.x86_64                   17/22 
  Cleanup          : grubby-8.40-41.el8.x86_64                            18/22 
  Erasing          : centos-linux-release-8.3-1.2011.el8.noarch           19/22 
  Running scriptlet: grub2-tools-1:2.02-90.el8.x86_64                     20/22 
  Cleanup          : grub2-tools-1:2.02-90.el8.x86_64                     20/22 
  Cleanup          : grub2-tools-minimal-1:2.02-90.el8.x86_64             21/22 
  Cleanup          : grub2-common-1:2.02-90.el8.noarch                    22/22 
  Running scriptlet: kernel-uek-5.4.17-2036.100.6.1.el8uek.x86_64         22/22 
  Running scriptlet: oracle-logos-80.5-1.0.6.el8.x86_64                   22/22 
  Running scriptlet: grub2-common-1:2.02-90.el8.noarch                    22/22 
  Verifying        : libpng-2:1.6.34-5.el8.x86_64                          1/22 
  Verifying        : oracle-logos-80.5-1.0.6.el8.x86_64                    2/22 
  Verifying        : linux-firmware-999:20200902-999.5.gitd5f9eea5.el8.    3/22 
  Verifying        : grub2-pc-1:2.02-90.0.1.el8.x86_64                     4/22 
  Verifying        : grub2-tools-extra-1:2.02-90.0.1.el8.x86_64            5/22 
  Verifying        : numactl-libs-2.0.12-11.el8.x86_64                     6/22 
  Verifying        : grub2-tools-efi-1:2.02-90.0.1.el8.x86_64              7/22 
  Verifying        : grub2-pc-modules-1:2.02-90.0.1.el8.noarch             8/22 
  Verifying        : freetype-2.9.1-4.el8_3.1.x86_64                       9/22 
  Verifying        : plymouth-scripts-0.9.4-7.20200615git1e36e30.0.1.el   10/22 
  Verifying        : plymouth-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64   11/22 
  Verifying        : plymouth-core-libs-0.9.4-7.20200615git1e36e30.0.1.   12/22 
  Verifying        : kernel-uek-5.4.17-2036.100.6.1.el8uek.x86_64         13/22 
  Verifying        : grubby-8.40-41.0.1.el8.x86_64                        14/22 
  Verifying        : grubby-8.40-41.el8.x86_64                            15/22 
  Verifying        : grub2-common-1:2.02-90.0.1.el8.noarch                16/22 
  Verifying        : grub2-common-1:2.02-90.el8.noarch                    17/22 
  Verifying        : grub2-tools-1:2.02-90.0.1.el8.x86_64                 18/22 
  Verifying        : grub2-tools-1:2.02-90.el8.x86_64                     19/22 
  Verifying        : grub2-tools-minimal-1:2.02-90.0.1.el8.x86_64         20/22 
  Verifying        : grub2-tools-minimal-1:2.02-90.el8.x86_64             21/22 
  Verifying        : centos-linux-release-8.3-1.2011.el8.noarch           22/22 

Upgraded:
  grub2-common-1:2.02-90.0.1.el8.noarch                                         
  grub2-tools-1:2.02-90.0.1.el8.x86_64                                          
  grub2-tools-minimal-1:2.02-90.0.1.el8.x86_64                                  
  grubby-8.40-41.0.1.el8.x86_64                                                 

Installed:
  freetype-2.9.1-4.el8_3.1.x86_64                                               
  grub2-pc-1:2.02-90.0.1.el8.x86_64                                             
  grub2-pc-modules-1:2.02-90.0.1.el8.noarch                                     
  grub2-tools-efi-1:2.02-90.0.1.el8.x86_64                                      
  grub2-tools-extra-1:2.02-90.0.1.el8.x86_64                                    
  kernel-uek-5.4.17-2036.100.6.1.el8uek.x86_64                                  
  libpng-2:1.6.34-5.el8.x86_64                                                  
  linux-firmware-999:20200902-999.5.gitd5f9eea5.el8.noarch                      
  numactl-libs-2.0.12-11.el8.x86_64                                             
  oracle-logos-80.5-1.0.6.el8.x86_64                                            
  plymouth-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64                            
  plymouth-core-libs-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64                  
  plymouth-scripts-0.9.4-7.20200615git1e36e30.0.1.el8.x86_64                    

Removed:
  centos-linux-release-8.3-1.2011.el8.noarch                                    

Complete!
Last metadata expiration check: 0:00:51 ago on Sat Dec 12 06:41:14 2020.
> Leaving Shell
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'yum clean packages'.
Updating initrd...
dracut: Cannot find module directory /lib/modules/4.18.0/
dracut: and --no-kernel was not specified
Djelibeybi commented 3 years ago

I'm busy downloading OpenVZ so I can try and reproduce this issue.

Djelibeybi commented 3 years ago

Can you confirm whether you're running a CentOS 8 VM or container on OpenVZ? In fact, if you could share the prlctl commands you used to create the instance, that would be very helpful. I've never used OpenVZ before, so any info you can provide to overcome the learning curve would be appreciated!

centminmod commented 3 years ago

I am not the one managing the OpenVZ VPS host node. I just rented a OpenVZ VPS from https://hostus.us/openvz-vps.html with CentOS 8 image out of the box and then ran yum update to get to CentOS 8.3 and then ran cento2ol.sh script. OpenVZ VPS use the Kernel from the host node unlike KVM/non-OpenVZ virtualized VPS servers https://hostus.us/openvz-vs-kvm.html.

OpenVZ uses a common shared kernel. Because of the shared kernel, overhead is lower and so is RAM consumption per VPS. A disadvantage to OpenVZ would be that a kernel failure could cause a failure across all VPS instances running on the same server. The shared kernel limits the operating systems you can run and keep in mind, the latest OSes with newer kernels may not work under OpenVZ.

Just quickest way to test is just rent a OpenVZ VPS and choose CentOS 8 as the out of the box image from say https://hostus.us/openvz-vs-kvm.html or another OpenVZ provider.

For scripting in centos2ol.sh you could use output from virt-what to determine if the server environment is openvz/lxc based in which case the host node's Kernel is used

On Hostus.US's OpenVZ VPS, output is

virt-what
openvz
lxc

On KVM server it would output = kvm and dedicated would have empty output

Djelibeybi commented 3 years ago

Gotcha. The script (currently) assumes its running on an instance with a dedicated kernel. We hadn't considered switching a container because it would generally be easier just to recreate one. But that ignores the VPS use case.

Can you confirm that your instance is switched and still works? As there is no kernel, the dracut error should have been purely cosmetic.

centminmod commented 3 years ago

Oh hadn't checked as I reinstalled CentOS 8 again as I assumed the conversion wasn't complete or was it complete and just dracut error can be ignored ?

Djelibeybi commented 3 years ago

Hopefully the latter, given dracut isn't needed in this scenario and it's the last thing the script does.

Djelibeybi commented 3 years ago

It's not a fix, but we've added specific docs around the need to be using a CentOS kernel (for now).

centminmod commented 3 years ago

Thanks @Djelibeybi for the update. You could add to centos2ol.sh a check for output from virt-what to see if lxc/openvz is detected to abort the script with a notice before it goes too far in the process?

Djelibeybi commented 3 years ago

Yes, that's the longer-term plan, which requires access to a testing environment and unfortunately we can't just rent third-party OpenVZ based instances, because it would all have to go through procurement, etc. I'm still working on getting a local install of OpenVZ running so I can test on that.