How to add missing package in airgap server
search cancel

How to add missing package in airgap server

book

Article ID: 387757

calendar_today

Updated On:

Products

VMware Telco Cloud Automation

Issue/Introduction

  • Specific Tuned Package named 'tuned-2.15.0-5.ph3.noarch.rpm ' is missing on  Airgap Server.
  • The missing package is mandatory to upgrade the CNF application.

Environment

TCA Airgap Server 2.3 , 3.2

Cause

The Broadcom reference design for Airgap Server assumes an online connection to the upstream repository for synchronizing new Photon packages or artifacts when added.However, when the Airgap Server is deployed in offline mode, meaning it is not connected to the internet to fetch updates directly from the upstream repository, it may result in missing packages.

Resolution

  • Check if the required package is present on TCA 2.3 Airgap.
    root@xxx-nvi [ /photon-reps/updates/photon-updates/noarch ]# find / | grep tuned-2.15.0
    /photon-reps/updates/photon-updates/noarch/tuned-2.15.0-2.ph3.noarch.rpm
    /photon-reps/updates/photon-updates/noarch/tuned-2.15.0-1.ph3.noarch.rpm
    /photon-reps/updates/photon-updates/noarch/tuned-2.15.0-4.ph3.noarch.rpm
    /photon-reps/updates/photon-updates/noarch/tuned-2.15.0-3.ph3.noarch.rpm
  • In the above example the package tuned-2.15.0-5.ph3.noarch.rpm is missing.
  • To copy the missing package we need to source the missing package from another Airgap server at SW level 3.2 with this package available.
  • Login to Source Airgap Server SW Version 3.2 and zip the required package
    mkdir -p /tmp/package-export 
    cp /photon-reps/updates/photon-updates/noarch/tuned-2.15.0-5.ph3.noarch.rpm /tmp/package-export/ 
    tar -czvf tuned-2.15.0-5.ph3.noarch.rpm.tar.gz -C /tmp/package-export .  
  • Transfer the tar file to TCA 2.3 Airgap server , where the package is missing ,  to path /photon-reps/updates/photon-updates/noarch and unzip it.
    tar -xzvf tuned-2.15.0-5.ph3.noarch.rpm.tar.gz -C /photon-reps/updates/photon-updates/noarch/
  • Change the permission and ownership of package as shown in below example:
    chown nobody:nogroup tuned-2.15.0-5.ph3.noarch.rpm
    chmod 744 tuned-2.15.0-5.ph3.noarch.rpm
    
    root@xxxxxxxxxx [ /photon-reps/updates/photon-updates/noarch ]# ls -ltr | grep 2.15.0.5
    -rw-r--r-- 1 nobody nogroup   183822 Jan 31 09:55 tuned-2.15.0-5.ph3.noarch.rpm
  •  To create the repo data , execute createrepo command.
    root@xxxxxxxxxx [ /photon-reps/updates/photon-updates/noarch ]# createrepo --update /photon-reps/updates/photon-updates/
    Directory walk started
    Directory walk done - 12812 packages
    Loaded information about 12810 packages
    Temporary output repo path: /photon-reps/updates/photon-updates/.repodata/
    Preparing sqlite DBs
    Pool started (with 5 workers)
    Pool finished
    17:05:04: posix_spawn avoided (fd close requested)
    17:05:04: posix_spawn avoided (fd close requested)
    17:05:04: posix_spawn avoided (fd close requested)
    17:05:04: posix_spawn avoided (fd close requested)
    17:05:04: posix_spawn avoided (fd close requested)
    17:05:05: posix_spawn avoided (fd close requested)
    17:05:05: posix_spawn avoided (fd close requested)
    17:05:05: posix_spawn avoided (fd close requested)
    17:05:07: posix_spawn avoided (fd close requested)
    17:05:07: posix_spawn avoided (fd close requested)
  •  The above above command will create repodata in path /photon-reps/updates/photon-updates . Verify the files as shown in below example:
    root@xxxxxxxxxx [ /photon-reps/updates/photon-updates ]# ls -ltr
    total 2032
    drwxr-xr-x 2 nobody nogroup 1945600 Aug  3  2023 x86_64
    drwxr-xr-x 2 nobody nogroup  122880 Jan 31 17:18 noarch
    drwxr-x--- 2 nobody nogroup    4096 Jan 31 17:27 repodata
  •  Check the permission and ownership of repodata as below:
    root@xxxxxxxxxx [ /photon-reps/updates/photon-updates ]# chown -R nobody:nogroup repodata
    root@xxxxxxxxxx-nvi [ /photon-reps/updates/photon-updates ]# chmod -R 755 repodata
    
    root@xxxxxxxxxx-nvi [ /photon-reps/updates/photon-updates ]# ls -ltr
    total 2032
    drwxr-xr-x 2 nobody nogroup 1945600 Aug  3  2023 x86_64
    drwxr-xr-x 2 nobody nogroup  122880 Jan 31 17:18 noarch
    drwxr-xr-x 2 nobody nogroup    4096 Jan 31 17:27 repodata
  • Now execute command tdnf clean as shown in below example:
    root@xxxxxxxxxx [ /photon-reps/updates/photon-updates/noarch ]# tdnf clean all
    Cleaning repos: airgap-telco-debuginfo airgapphoton airgap-telco-updates airgappu
    Cleaning up everything
  • Execute tdnf makecache command as shown in below example:
    root@xxxxxxxxxx [ /photon-reps/updates/photon-updates ]#  tdnf makecache
    Refreshing metadata for: 'VMware Airgap Photon Updates Repo'
    Refreshing metadata for: 'VMware Airgap Photon Telco Updates'
    Refreshing metadata for: 'VMware Airgap Photon Release Repo'
    Refreshing metadata for: 'VMware Airgap Photon Telco Debuginfo'
    Metadata cache created.                   3091   100%
  • Verify that the new package appears in the cache.
    root@xxxxxxxxxx [ ~ ]# tdnf list  | grep 2.15.0
    tuned.noarch                                2.15.0-1.ph3            airgappu
    tuned.noarch                                2.15.0-2.ph3            airgappu
    tuned.noarch                                2.15.0-3.ph3            airgappu
    tuned.noarch                                2.15.0-4.ph3            airgappu
    tuned.noarch                                2.15.0-5.ph3            airgappu
  • Login to K8s worker node and verify the new package is listed and available in the worker node.
     capv@k8s_worker_node[ ~ ]$ sudo su
    root [ /home/capv ]# tdnf makecache
    Refreshing metadata for: 'VMware Airgap Photon Telco Updates'
    Refreshing metadata for: 'VMware Airgap Photon Release Repo'
    Refreshing metadata for: 'VMware Airgap Photon Telco Debuginfo'
    Refreshing metadata for: 'VMware Airgap Photon Updates Repo'
    Metadata cache created.                   3121   100%
    
    root [ /home/capv ]# yum  list | grep 2.15.0
    tuned.noarch                                2.15.0-4.ph3             @System
    tuned.noarch                                2.15.0-1.ph3            airgappu
    tuned.noarch                                2.15.0-2.ph3            airgappu
    tuned.noarch                                2.15.0-3.ph3            airgappu
    tuned.noarch                                2.15.0-4.ph3            airgappu
    tuned.noarch                                2.15.0-5.ph3            airgappu

Additional Information

  • Starting from TCP 4.0, this issue no longer exist, as DMZ Airgap servers now always have online connectivity to the upstream repository.
  • This means that whenever new packages or artifacts are available upstream, they can be synched using the agctl sync/resync method.