.. _satellite-upgrade:

.. _neteye-upgrade-satellites-cluster:

.. _neteye-upgrade-satellites-single:

Satellite Upgrade from 4.22 to 4.23
===================================

This guide will lead you through the steps specific for upgrading
a **NetEye Satellite** installation from version **4.22** to
**4.23**. You **must** have successfully completed the
:ref:`Satellite Update Procedure <neteye-update-satellites>` before
attempting to start the upgrade procedure.

.. warning:: Remember that you must upgrade sequentially without
   skipping versions, therefore an upgrade to **4.23** is possible only
   from **4.22**; for example, if you have version **4.14**, you
   must first upgrade to the **4.15**, then **4.16**, and so on.

Before starting an upgrade, you should very carefully read the latest
release notes on `NetEye's blog
<https://www.neteye-blog.com/category/neteye/release-notes-2/>`_ and
check the feature changes and deprecations specific to the version
being upgraded.  You should check also the whole section
:ref:`satellite-breaking` below.

The remainder of this section is organised as follows. Section
:ref:`satellite-breaking` introduces substantial changes that users must
be aware of before starting the upgrade procedure and may require to
carry out some tasks **before** starting the upgrade; then section
:ref:`satellite-upgrade-procedure` presents the actual procedure.

.. _satellite-breaking:

Breaking Changes
----------------

.. include:: /includes/4.23_breaking_changes.rst

.. _satellite-upgrade-procedure:

NetEye Satellite Upgrade Procedure
----------------------------------

Prerequisites
~~~~~~~~~~~~~

.. The prerequisites for Satellites cannot be included from 4.23_os_requirements.rst
   because for the Satellite we also have the additional requirement of the Master version.
   For including it we would need to split the list of requirements

Be sure to meet the following requirements before starting:

#. NetEye Master must be version **4.23** fully updated
#. NetEye Satellite must be version **4.22** fully updated
#. The 4.23 NetEye Satellite configuration archive is present in the path
   :file:`/root/satellite-setup/config/4.23/satellite-config.tar.gz`. To generate
   and send the Satellite configuration archive see the section
   :ref:`Satellite Configuration <neteye-satellite-configuration>`
#. NetEye Satellite must be up and running with no health checks failing
#. There must be at least **20GB** of free space in `/`
#. There must be at least **20GB** of free space in `/var`
#. All nodes must be able to reach the following domains over HTTPS (port 443 TCP):

   * **cdn.redhat.com**
   * **cdn-ubi.redhat.com**
   * **cert-api.access.redhat.com**
   * **cert.cloud.redhat.com**
   * **subscription.rhsm.redhat.com**

#. You need an *organization ID*, an *activation key* and a *name*
   (see below) before attempting the upgrade. To obtain them, please
   refer to the official channels: sales, consultant or `support
   portal
   <https://siwuerthphoenix.atlassian.net/servicedesk/customer/portals>`_.
#. Kernel requirements:

   * Some kernel modules are incompatible with RHEL 8 and need to be
     replaced. The system upgrade command will ensure those modules are
     not active in your installation. However, if any are found, refer to
     the :ref:`related troubleshooting section
     <incompatible-kernel-modules-rhel-8>` for directions on how to
     proceed.

   * Ensure the system is running the latest installed kernel. To check this please
     compare :command:`rpm -q kernel` with :command:`uname -r`.

   * Only one unused kernel version should be installed on the system (this is needed
     to avoid filling the *boot* partition during the upgrade). To remove all kernels except the currently running
     version and the previous one you can use the command:

     .. code:: bash

        neteye# package-cleanup --oldkernels --count=1

#. Filesystem types requirements:

   * Ensure there are no *XFS* filesystems with **ftype=0** mounted.

     Run the script:

     .. code:: bash

        neteye# for dev in $(findmnt -t xfs -n -o SOURCE); do echo "$dev: $(xfs_info $dev | grep -w -o ftype=0)"; done

     Case 1: If no output is reported, then no *XFS* filesystems with **ftype=0** are mounted.

     Case 2: If any output is reported, as in the snippet below, then please refer to `XFS ftype=0 case <https://access.redhat.com/solutions/5057391>`_.

     .. code::

        /dev/mapper/rhel-root: ftype=0
        /dev/mapper/rhel-usr: ftype=0
        /dev/vda1: ftype=0
        /dev/mapper/rhel-home: ftype=0
        /dev/mapper/rhel-var: ftype=0

   * Ensure no Network filesystems (e.g. *NFS*, *SMB*, *GlusterFS*) are mounted or configured to be mounted on reboot.
     Otherwise please refer to the `support portal <https://siwuerthphoenix.atlassian.net/servicedesk/customer/portals>`_
     for assistance.

#. Package installation requirements:

    * Ensure there are no unfinished *YUM* transactions. For that please run the following command:

      .. code:: bash

         neteye# yum-complete-transaction --cleanup-only

    * Ensure no duplicate RPM packages are installed. To check if there are any duplicates you can execute:

      .. code:: bash

         neteye# package-cleanup --dupes

      To remove any discovered duplicates run instead:

      .. code:: bash

         neteye# package-cleanup --cleandupes


    * Ensure *urllib3* and *requests* python modules are only installed via *RPM* packages. In case *urllib3*
      and *requests* are installed via *pip*, please run the following commands:

      .. code:: bash

         neteye# pip2 uninstall requests urllib3

      .. code:: bash

         neteye# yum reinstall python-urllib3.noarch python-requests.noarch

#. Ensure that there are no customizations or recurring tasks running as they
   may interfere with the upgrade. This includes for example **backups**,
   **Beats**, **custom scripts** and so on.

If your NetEye Satellite installation uses some custom services or some
custom Icinga2 checks, it is possible that you will need to fix them
manually during or after the upgrade and you may need the assistance
of our support or consultant team.

Step 1: Conversion from CentOS 7 to RHEL 7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To perform the conversion to RHEL 7, run from the command line the command::

  sat# (nohup neteye node system-upgrade --org <organization_id> --key <activation_key> --name <name> &) && tail --retry -f nohup.out

This command takes care of checking the system status and performs
the conversion to **RHEL 7**.
We recall that the *organization ID* and the *activation key* can be obtained upon
request to our service desk.

In case of any errors, the command will show the reason of the
failure. After fixing the problem, please repeat Step 1 from the
beginning.

At the end of the conversion a success message is shown and you
will be prompted to restart the system.
To reboot the system run the following command::

  sat# reboot

Step 2: Upgrade from RHEL 7 to RHEL 8
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

After the previous reboot, it is time to upgrade from **RHEL 7** to **RHEL 8** by running
command::

  sat# (nohup neteye node system-upgrade --org <organization_id> --key <activation_key> --name <name> &) && tail --retry -f nohup.out

During the upgrade the following kernel modules will be removed because they are not compatible
with RHEL 8:

* *pata_acpi*: pata_acpi is used for device configuration and power management of P-ATA storage devices
* *pam_pkcs11*: this Linux-PAM login module allows a X.509 certificate based user login

The command will perform a pre-upgrade in order to check the status of the system;
any of the following conditions may prompt a manual intervention:

* Since a newer kernel version is installed but currently not running, it is necessary
  to reboot the system, then execute the :command:`neteye node system-upgrade` command again
* Some packages not provided by NetEye have been installed and are not compatible with RHEL 8:
  packages that are not compatible with RHEL 8 must be removed or can be updated by
  saving a RHEL 8 compatible update package in the folder :file:`/var/www/html/rhel8-rpms-migration`.
  Alternatively, additional repositories to be used only during the upgrade can be added to file
  :file:`/etc/leapp/files/leapp_upgrade_repositories.repo`.
* Other system-specific cases: in this case a detailed report of the causes will be generated in
  :file:`/var/log/leapp/leapp-report.txt`

In case of any errors, the command will show the reason of the
failure. After fixing the problem, please repeat Step 2 from the
beginning.

At the end of the upgrade a success message is shown and you
will be informed to restart the system.
During the reboot further tasks will be performed in order to complete the upgrade to RHEL 8.

.. warning:: The whole reboot procedure will take at least **35-40 minutes**.

To reboot the system run the following command::

  sat# reboot

Step 3: OS Upgrade finalization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To complete the procedure and finalize the OS upgrade,
run from the command line the command::

  sat# (nohup neteye node system-upgrade --org <organization_id> --key <activation_key> --name <name> &) && tail --retry -f nohup.out

More information on this command can be found in section
:ref:`neteye-node-system-upgrade`; a :ref:`dedicated section
<update-ts>` provides directions in case the command
fails.

Post-upgrade Tasks
~~~~~~~~~~~~~~~~~~

A few tasks are needed on the satellite:

* Please check for any .rpmnew and .rpmsave files (see the
  :ref:`Migrate RPM Configuration <update-rpm-migration>` section for
  further information).

* Execute the command below to setup the new version of the NetEye Satellite:

  .. code:: bash

     sat# neteye satellite setup

* Launch the following script:

  .. code:: bash

     sat# neteye_finalize_installation

.. note:: You should launch the *finalize* command only if all
   previous steps have been completed **successfully**. If you
   encounter any errors or problems during the upgrade process, please
   contact :ref:`our service and support team <neteye-support>` to
   evaluate the best way forward for upgrading your NetEye System.
