How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8

In our previous article, we have covered with installing and configuring the spacewalk server, by following in this guide we are about to walk through creating with our first software channel, repositories, activation keys and syncing the repositories.




Before registering our first client with spacewalk server we need to have a software channel where the client needs to access the repositories for downloading the packages. The software channel may hold one or more repositories. We can have N number of Channels and repositories, depends on the number of additional channels and repositories more storage space will require to download repo contents. Once done with creating repo include them under the base channel, by following create an activation key and start to sync the channel. Repositories listed under base channel will start to download, import and finally it will link to the DB.

If you have not yet done with the Spacewalk server setup follow the below first guide.

More Spacewalk related topics are as follows:

Login to the spacewalk web interface

https://spacewalk.oel7.local

 

Below are five measures we are going to cover.

  • Creating the Base Software Channel.
  • Creating repositories.
  • Adding Repository to Channel
  • Creating activation Key for clients activation.
  • Start Syncing repositories

 

Step 1: Creating with Base Software Channel

To create our first base channel navigate to the top menu by clicking on “Channels” by following in left side pane click “Manage Software Channels” at last in right side top corner locate for “+ Create channel” and click on it.

Channels (top)–> Manage Software Channels(Left side pane) –> “+ Create Channel”(Right side top corner).

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 2
Create base Channel

It will redirect to create a software channel page, Here we need to fill with our required Channel name, Channel Label, architecture, Yum repositories checksum type, Channel summary, description, information about the restrictions and GPG key information. Except for contact information all the fields are mandatory to fill out.



First, we need have an extracted GPG key information, To get the key information download it in Spacewalk server under /etc/pki/rpm-gpg/ from CentOS official website and extract it using GPG command. Hence we are running Spacewalk server in CentOS Linux 7 we don’t require to download, if we have installed in RHEL, Oracle or in Scientific Linux downloading CentOS key required for extracting GPG ID and Fingerprint information.

In our case navigate to /etc/pki/rpm-gpg/ and extract GPG information.

# cd /etc/pki/rpm-gpg
# wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
# gpg --with-fingerprint RPM-GPG-KEY-CentOS-7

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 3
Extracting GPG information

 

From the extracted information last 8 digits in fingerprint will be “GPG Key ID”.

we are using with below details.

Channel Name: Centos 7 Base x86_64       # Channel name can any name, let us stick with the official name.
Channel Label: centos-7-base-x86_64      # Label name should not contain any spaces.
Parent Channel: None                                       # We are creating with our first channel, so not under any parent.
Architecture: x86_64                                        # Our system repo architecture.
Yum Repository Checksum Type                    # Use high security with 256 Checksum.
Channel Summary                                              # Give a channel summary.
Channel Description:                                          # Provide with a small description.
Per-User Subscription Restrictions:              All users within your organization may subscribe to this channel.
Organization Sharing:                                        This channel is private and cannot be accessed by any other org.
GPG key URL:                                                       file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
GPG key ID:                                                           F4A80EB5
GPG key Fingerprint:                                          6341 AB27 53D7 8A78 A7C2 7BB1 24C6 A8A7 F4A8 0EB5

Click “Create Channel” to create our first “Centos 7 Base x86_64” channel, Once created it will list under the “Software Channel Management“.

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 4
Create Base Channel with required info

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 5
Created Base Channel

 

Step 2: Creating with repositories.

To get all available repositories from CentOS navigate to below URL.

http://mirror.centos.org/centos/7/

 

To create with repository click on “Channels” menu from the top, by following in left side pane click on “Manage Software Channels” under it click “Manage Repositories” we will get “Create Repository” in right side top corner click to create with it.

Channels (Top)–> Manage Software Channels (Left side pane)–> Manage Repositories (Left side pane)–> Create Repository(Right side top corner).

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 6
Create Repositories

 

Repository Label :      centos7_base_x86_64_repo
Repository URL:         http://mirror.centos.org/centos/7/os/x86_64/
Repository Type:        yum

 

Click “Create Repository” to create with it.

We need to get updates, extra packages and OpenStack, so we are about to set up three more repositories by following the above step.

Repository Label : centos7_update_x86_64_repo
Repository URL: http://mirror.centos.org/centos/7/updates/x86_64/
Repository Type: yum

 

Click “Create Repository” to create with it.

Repository Label : centos7_extra_x86_64_repo
Repository URL: http://mirror.centos.org/centos/7/extras/x86_64/
Repository Type: yum

 

Click “Create Repository” to create with it.

Repository Label : centos7_opnstk_x86_64_repo
Repository URL: http://mirror.centos.org/centos/7/cloud/x86_64/
Repository Type: yum

 

Click “Create Repository” to create with it.

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 7
Repositories Lable and URL

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 8
Created Repository

 

Step 3: Adding Repository to Channel.

To add the repositories to channel navigate to “Channels” top menu click on ‘Manage Software Channels‘ our created channel “Centos 7 Base x86_64” will be listed here click on it and select “Repositories” TAB from it in the bottom of the page select the required repositories and click “Update Repositories“.

Channels (Top)–> Manage Software Channels (Left side pane)–> Centos 7 Base x86_64 –> Repositories (Tab) –> centos7_base_x86_64_repo (Check box) –> Update Repositories (Bottom right corner).

Add remaining “centos7_update_x86_64_repo”  and “centos7_extra_x86_64_repo” under base channel. Right now we are not including OpenStack repository to sync.

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 8
Adding the repository to Channel

 

Step 4: Creating activation Key.

Once we done with all the above steps we required to have an activation key. Activation keys are used to automate the registration of client machines with the Spacewalk server without providing admin username/password.

System –> ( Top menu) Activation Keys (Left Side pane) –> Create Key (Right side top corner)–> Fill description

Description : CentOS Linux 7 x86_64
Key: centoslinux7-x86_64
Usage: Leave this blank for unlimited use
Base channels: Centos 7 Base x86_64 # Select the Base channel
Add-On Entitlements: Choose all available feature you about to use.

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 10
Create Activation Key

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 11
key and channel selection

Click “Create Activation Key“.

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 12
Created Key

 

Step 5: Start Syncing repositories.

Once done with creating channels, repositories and activation Key our last task is to Sync all repositories to download the contents from CentOS official Repo to our spacewalk server. We can do with a immediate sync or schedule it for an off-peak hour from our production time.

Channel (Top)–> Manage Software channels (Left side pane) –> Centos 7 Base x86_64 –> Repositories (Tab) –> Sync –> ClickSync now” (Right side above scheduler) or Schedule it for later.

If you wish to sync from the command line run with

# /usr/bin/spacewalk-repo-sync --channel centos-7-base-x86_64 --type yum

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 13
Click Repositories tab

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 14
Click Sync for immediate sync

 

How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8 15
Schedule a Sync



To monitor the Sync progress, tail the log of base channel.

# tail -f /var/log/rhn/reposync/centos-7-base-x86_64.log

 

The output of Sync progress logs

[root@spacewalk ~]# tail -f /var/log/rhn/reposync/centos-7-base-x86_64.log 
2018/09/08 23:18:46 +05:30 364/9911 : atk-devel-2.22.0-3.el7.i686.rpm
2018/09/08 23:18:46 +05:30 365/9911 : atkmm-2.24.2-1.el7.i686.rpm
2018/09/09 02:01:23 +05:30 9910/9911 : xulrunner-31.6.0-2.el7.centos.x86_64.rpm
2018/09/09 02:01:48 +05:30 9911/9911 : xulrunner-31.6.0-2.el7.centos.i686.rpm
2018/09/09 02:01:48 +05:30 Importing packages started.
2018/09/09 02:01:48 +05:30 
2018/09/09 02:01:48 +05:30 Importing packages to DB:
2018/09/09 02:46:54 +05:30 Importing packages finished.
2018/09/09 02:46:54 +05:30 
2018/09/09 02:46:54 +05:30 Linking packages to the channel.
2018/09/09 02:47:24 +05:30 
2018/09/09 02:47:24 +05:30 Errata in repo: 0.
2018/09/09 02:47:24 +05:30

 

Sync will take a long time to complete and it depends on our bandwidth we are using, Downloaded packages came around 14G which saved under /var/satellite.

[root@spacewalk ~]# df -hP /var/satellite
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/spacewalk-var_satellite 50G 14G 37G 27% /var/satellite
[root@spacewalk ~]#

 

That’s it, we have completed with our last step by syncing repositories contents.

Conclusion:

In the above guide, continuous of post-installation steps have been carried out successfully by creating a base channel, repositories and syncing the content successfully. In upcoming guides, we will work on registering client servers with the Spacewalk server.

Subscribe to our newsletter and stay tuned, We are happy to hear from you through comment section.

4 thoughts on “How to create Software channels, Repositories, Activation keys and sync in Spacewalk Server 2.8

  1. Hi,

    The content provided is very good. But during configuration, I am facing a few issues. Can you please help me out.

Comments are closed.