Thursday, August 07, 2014

Centos 65 to Centos 70



cat /etc/centos-release
CentOS Linux release 7.0.1406 (Core)
uname --all
Linux centos70 3.10.0-123.4.4.el7.x86_64 #1 SMP Fri Jul 25 05:07:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
ps -ef | grep system
root         1     0  0 14:37 ?        00:00:00 /usr/lib/systemd/systemd --switched-root --system --deserialize 23
root       213     1  0 14:37 ?        00:00:00 /usr/lib/systemd/systemd-journald
root       225     1  0 14:37 ?        00:00:00 /usr/lib/systemd/systemd-udevd
root       322     1  0 14:37 ?        00:00:00 /usr/lib/systemd/systemd-logind
dbus       327     1  0 14:37 ?        00:00:00 /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root      1060   821  0 14:46 pts/0    00:00:00 grep --color=auto system
hostnamectl
Static hostname: centos70.topsecret.net      
Icon name: computer-vm
         Chassis: vm
      Machine ID: 62a53f2c146
         Boot ID: 0cfad1ca50d
  Virtualization: xen
Operating System: CentOS Linux 7 (Core)
     CPE OS Name: cpe:/o:centos:centos:7
          Kernel: Linux 3.10.0-123.4.4.el7.x86_64
    Architecture: x86_64
I'm currently working with IBM and Softlayer a company that allows you to host your Linux or Microsoft based computer system in any one of Softlayer's datacentres either as a Physical computer, or as a Virtual Computer running under Xen.

Annoyingly though whilst the Linux distribution Centos 7  (i.e. a Free Linux distribution taken from the code base of Red Hat Enterprise Linux 7)  was released July 2014, Softlayer still have Centos 65 as the latest image.

But unlike earlier Centos there is apparently a way to online upgrade  (i.e. not reinstall and reconfigure).

Irrelevant Aside
Softlayer has a Python based client API that I use on a local Linux system to talk to my Softlayer account.  So let us list what Operating Systems I can install:


[root@centos7 softlayer-python]# sl cci create-options
:.................:.................................................................................:
:   Name : Value                     :
:.................:.................................................................................:
:   datacenter : ams01,dal01,dal05,dal06,hkg02,lon02,sea01,sjc01,sng01,wdc01      :
:  cpus (private) : 1,2,4,8                   :
: cpus (standard) : 1,2,4,8,12,16                   :
:    memory : 1024,2048,4096,6144,8192,12288,16384,32768,49152,65536        :
:  os (CENTOS) : CENTOS_5_32                  :
:     : CENTOS_5_64                  :
:     : CENTOS_6_32                  :
:     : CENTOS_6_64                  :
:     : CENTOS_LATEST                   :
:     : CENTOS_LATEST_32                :
:     : CENTOS_LATEST_64                :
: os (CLOUDLINUX) : CLOUDLINUX_5_32                 :
:     : CLOUDLINUX_5_64                 :
:     : CLOUDLINUX_6_32                 :
:     : CLOUDLINUX_6_64                 :
:     : CLOUDLINUX_LATEST                  :
:     : CLOUDLINUX_LATEST_32               :
:     : CLOUDLINUX_LATEST_64               :
:  os (DEBIAN) : DEBIAN_5_32                  :
:     : DEBIAN_5_64                  :
:     : DEBIAN_6_32                  :
:     : DEBIAN_6_64                  :
:     : DEBIAN_7_32                  :
:     : DEBIAN_7_64                  :
:     : DEBIAN_LATEST                   :
:     : DEBIAN_LATEST_32                :
:     : DEBIAN_LATEST_64                :
:  os (REDHAT) : REDHAT_5_32                  :
:     : REDHAT_5_64                  :
:     : REDHAT_6_32                  :
:     : REDHAT_6_64                  :
:     : REDHAT_LATEST                   :
:     : REDHAT_LATEST_32                :
:     : REDHAT_LATEST_64                :
:  os (UBUNTU) : UBUNTU_10_32                 :
:     : UBUNTU_10_64                 :
:     : UBUNTU_12_32                 :
:     : UBUNTU_12_64                 :
:     : UBUNTU_14_32                 :
:     : UBUNTU_14_64                 :
:     : UBUNTU_8_32                  :
:     : UBUNTU_8_64                  :
:     : UBUNTU_LATEST                   :
:     : UBUNTU_LATEST_32                :
:     : UBUNTU_LATEST_64                :
:   os (VYATTACE) : VYATTACE_6.5_64                 :
:     : VYATTACE_6.6_64                 :
:     : VYATTACE_LATEST                 :
:     : VYATTACE_LATEST_64                 :
:  os (WIN) : WIN_2003-DC-SP2-1_32               :
:     : WIN_2003-DC-SP2-1_64               :
:     : WIN_2003-ENT-SP2-5_32                 :
:     : WIN_2003-ENT-SP2-5_64                 :
:     : WIN_2003-STD-SP2-5_32                 :
:     : WIN_2003-STD-SP2-5_64                 :
:     : WIN_2008-DC-R2_64                  :
:     : WIN_2008-DC-SP2_64                 :
:     : WIN_2008-ENT-R2_64                 :
:     : WIN_2008-ENT-SP2_32                :
:     : WIN_2008-ENT-SP2_64                :
:     : WIN_2008-STD-R2-SP1_64                :
:     : WIN_2008-STD-R2_64                 :
:     : WIN_2008-STD-SP2_32                :
:     : WIN_2008-STD-SP2_64                :
:     : WIN_2012-DC_64                  :
:     : WIN_2012-STD_64                 :
:     : WIN_LATEST                   :
:     : WIN_LATEST_32                   :
:     : WIN_LATEST_64                   :






This is what worked for me:




Get some code


mkdir /root/upgrade; cd /root/upgrade
wget  http://dev.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-1.0.2-33.el6.x86_64.rpm 
wget http://dev.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-contents-0.5.13-1.0.5.el6.centos.noarch.rpm
wget http://dev.centos.org/centos/6/upg/x86_64/Packages/preupgrade-assistant-1.0.2-33.0.3.el6.centos.x86_64.rpm
wget http://dev.centos.org/centos/6/upg/x86_64/Packages/openscap-python-1.0.8-1.0.1.el6.centos.x86_64.rpm
wget http://dev.centos.org/centos/6/upg/x86_64/Packages/redhat-upgrade-tool-0.7.22-3.el6.centos.noarch.rpm


[root@centos65 upgrade]# ls -ltr
total 8216
-rw-r--r-- 1 root root  449596 Jul 28 10:38 preupgrade-assistant-1.0.2-33.0.3.el6.centos.x86_64.rpm
-rw-r--r-- 1 root root 6955552 Jul 28 10:38 preupgrade-assistant-ui-1.0.2-33.0.3.el6.centos.x86_64.rpm
-rw-r--r-- 1 root root  604616 Jul 28 10:38 preupgrade-assistant-contents-0.5.13-1.0.5.el6.centos.noarch.rpm
-rw-r--r-- 1 root root  275140 Jul 28 12:46 openscap-python-1.0.8-1.0.1.el6.centos.x86_64.rpm
-rw-r--r-- 1 root root   87388 Jul 28 12:46 redhat-upgrade-tool-0.7.22-3.el6.centos.noarch.rpm
Download and Run the Preupgrade Assistant


yum localinstall preupgrade-assistant-*
Dependencies Resolved

===============================================================================================================================================
 Package                          Arch      Version                     Repository                                                        Size
===============================================================================================================================================
Installing:
 preupgrade-assistant             x86_64    1.0.2-33.0.3.el6.centos     /preupgrade-assistant-1.0.2-33.0.3.el6.centos.x86_64             1.6 M
 preupgrade-assistant-contents    noarch    0.5.13-1.0.5.el6.centos     /preupgrade-assistant-contents-0.5.13-1.0.5.el6.centos.noarch    4.1 M
 preupgrade-assistant-ui          x86_64    1.0.2-33.0.3.el6.centos     /preupgrade-assistant-ui-1.0.2-33.0.3.el6.centos.x86_64           32 M
Installing for dependencies:
 libgcrypt-devel                  x86_64    1.4.5-11.el6_4              base                                                             118 k
 libgpg-error-devel               x86_64    1.7-4.el6                   base                                                              14 k
 libxml2-devel                    x86_64    2.7.6-14.el6_5.2            updates                                                          1.1 M
 libxslt-devel                    x86_64    1.1.26-2.el6_3.1            base                                                             561 k
 mod_wsgi                         x86_64    3.2-6.el6_5                 updates                                                           66 k
 openscap                         x86_64    1.0.8-1.el6_5               updates                                                          2.9 M
 pcre-devel                       x86_64    7.8-6.el6                   base                                                             318 k
 zlib-devel                       x86_64    1.2.3-29.el6                base                                                              44 k
Updating for dependencies:
 libxml2                          x86_64    2.7.6-14.el6_5.2            updates                                                          800 k
 libxml2-python                   x86_64    2.7.6-14.el6_5.2            updates                                                          322 k

Transaction Summary
===============================================================================================================================================
Install      11 Package(s)
Upgrade       2 Package(s)

type preupg
preupg is /usr/bin/preupg
/usr/bin/preupg

Gathering logs used by preupgrade assistant:
All installed packages : 01/11 ...finished (time 00:00s)
All changed files      : 02/11 ...finished (time 00:51s)
Changed config files   : 03/11 ...finished (time 00:00s)
All users              : 04/11 ...finished (time 00:00s)
All groups             : 05/11 ...finished (time 00:00s)
Service statuses       : 06/11 ...finished (time 00:00s)
All installed files    : 07/11 ...finished (time 00:01s)
All local files        : 08/11 ...finished (time 00:02s)
All executable files   : 09/11 ...finished (time 00:00s)
RedHat signed packages : 10/11 ...finished (time 00:00s)
CentOS signed packages : 11/11 ...finished (time 00:00s)
Assessment of the system, running checks / SCE scripts:
001/095 ...done    (Configuration Files to Review)
002/095 ...done    (File Lists for Manual Migration)
003/095 ...done    (Bacula Backup Software)

...
NIS ypbind config files back-up                                                           |notapplicable  |
|NIS Makefile back-up                                                                      |notapplicable  |
|NIS server maps check                                                                     |notapplicable  |
|NIS server MAXUID and MAXGID limits check                                                 |notapplicable  |
|NIS server config file back-up                                                            |notapplicable  |
------------------------------------------------------------------------------------------------------------
Tarball with results is stored here /root/preupgrade-results/preupg_results-140806094546.tar.gz .
The latest assessment is stored in directory /root/preupgrade .
Upload results to UI by command:
e.g. preupg -u http://127.0.0.1:8099/submit/ -r /root/preupgrade-results/preupg_results-*.tar.gz .


Install Centos Upgrade Tool

yum localinstall redhat-upgrade-tool-0.7.22-3.el6.centos.noarch.rpm


Install       1 Package(s)

Total size: 251 k
Installed size: 251 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:redhat-upgrade-tool-0.7.22-3.el6.centos.noarch                                                                            1/1
  Verifying  : 1:redhat-upgrade-tool-0.7.22-3.el6.centos.noarch                                                                            1/1

Installed:
  redhat-upgrade-tool.noarch 1:0.7.22-3.el6.centos


Import GPG Key

rpm --import http://ftp.plusline.de/centos/7.0.1406/os/x86_64/RPM-GPG-KEY-CentOS-7

Run the Upgrade Tool

redhat-upgrade-tool --network 7.0 --instrepo http://ftp.plusline.de/centos/7.0.1406/os/x86_64/ --force

setting up repos...
.treeinfo                | 1.1 kB   00:00
getting boot images...
vmlinuz-redhat-upgrade-tool                | 4.7 MB   00:00
initramfs-redhat-upgrade-tool.img              |  32 MB   00:00
setting up update...
(1/503): abrt-2.1.11-12.el7.centos.x86_64.rpm             | 438 kB   00:00
(2/503): abrt-addon-ccpp-2.1.11-12.el7.centos.x86_64.rpm             | 178 kB   00:00
(3/503): abrt-addon-kerneloops-2.1.11-12.el7.centos.x86_64.rpm       |  95 kB   00:00
(4/503): abrt-addon-pstoreoops-2.1.11-12.el7.centos.x86_64.rpm       |  88 kB   00:00
(5/503): abrt-addon-python-2.1.11-12.el7.centos.x86_64.rpm           |  93 kB   00:00

(499/503): yum-plugin-fastestmirror-1.1.31-24.el7.noarch.rpm         |  28 kB 00:00
(500/503): yum-utils-1.1.31-24.el7.noarch.rpm                        | 111 kB 00:00
(501/503): zip-3.0-10.el7.x86_64.rpm                                 | 260 kB 00:00
(502/503): zlib-1.2.7-13.el7.x86_64.rpm                              |  89 kB 00:00
(503/503): zlib-devel-1.2.7-13.el7.x86_64.rpm                        |  49 kB 00:00
testing upgrade transaction
rpm transaction 100% [====================================================================]
rpm install 100% [========================================================================]
setting up system for upgrade
Finished. Reboot to start upgrade.
Reboot  to effect changes

shutdown --reboot now

The final part of the upgrade is completed on the reboot and luckily for me no command line interactions were required because for Virtual and not Physical Softlayer systems nobody has shown me how to access the equivalent of a BIOS come boot screen   (I'm convinced that this is impossible since Softlayer surely will not give me Xen access since this Hypervisor is over many customers, not just me).

So all looks well and now I have to repoint my DNS because I also changed the hostname of the system 

 hostnamectl set-hostname centos70.<topsecret>.net