How To Manage Spacewalk Channels And Repositories

In our previous tutorial, we discussed how to install and configure Spacewalk server in CentOS 7 server. This is the second part of Spacewalk server. In this tutorial, let us discuss how to manage Spacewalk Channels, types of channels, and how to assign repositories to the channels.

Manage Spacewalk Channels

As you may know, Red Hat Satellite server and Spacewalk server is working based on the concept of Channels.

A channel is a logical collection of packages. The channel may contain packages from a specific distribution, also a channel may contain packages for a specific application or group of applications. The users can also define their own channels. Any Spacewalk client can subscribe to a channel to download, update, install packages. The channels are linked to a normal YUM repository. A channel can be linked to several repositories. We can clone, sync or customize the channels.

There are two type of channels.

  • Base channel ;
  • Child channel.

The Base channel contains the packages based on a specific architecture and a specific distribution, whereas a Child channel contains extra packages, for example packages of MariaDB. The Child channel is linked to the Base channel. A base channel can have any number of child channels. The Spacewalk client should subscribe to only one Base channel, and can subscribe to any number of Child channels of its base channel. Every base channel has a registration key. So that the clients can use this key to register themselves with the corresponding base channel automatically.

Create a Base channel

Log in to Spacewalk server’s web console. Open up your web browser and navigate to https://spacewalk-server-ip/.

The following screen should appear. Enter username and password which you defined in the previous tutorial during Spacewalk installation. In my case my username is admin and password is centos.

Spacewalk - Sign In - Google Chrome_001

This is how my Spacewalk’s dashboard looked.

Spacewalk - Overview - Overview - Google Chrome_002

Now, let us create the Base channel.

Go to Channels (top menu) –> Manage Software Channels (left pane) –> Create Channel.

Spacewalk - Channels - Manage Software Channels - Google Chrome_003

Enter Channel name, Channel type, select architecture etc. Finally click Create Channel.

Spacewalk - Channels - Manag_ - https___192.168.1.150_rhn_channels_manage_Edit.do

We have created a Base repository. Now, we’ll assign a real YUM repository to the Base channel.

Adding repository to Base channel

Go to Channels –> Manage Software Channels –> Manage Repositories –> Create New repository.

Spacewalk - Channels - Manage Software Channels - Manage Repositories - Google Chrome_004

Enter the repository name and actual URL and click Create Repository:

Spacewalk - Channels - Manage Software Channels - Manage Repositories - Google Chrome_005

Now, we need to create a registration key for the base channel, so that the Spacewalk clients can easily subscribe the corresponding Base channel.

Creating a registration key to the Base channel

Go to Systems (top menu) –> Activation Keys (left pane) –> Create key.

Spacewalk - Systems - Activation Keys - Google Chrome_006

Leave all the fields blank and select your base channel which we created before from the drop down list. Click Create Activation Key.

Spacewalk - Systems - Activ_ - https___192.168.1.150_rhn_activationkeys_Create.do

This activation will be needed by the Spacewalk clients to subscribe the desired channels.

Now, You can assign this Base channel to your Spacewalk client. But, here in my case, I want to assign only Child channels to my clients.

Let us go and create a Child channel.

Create A Child channel

Go to Channels (top menu) –> Manage Software Channels (left pane) -> Create Channel. Enter the Child channel name, label, Parent channel, Architecture, and Channel description etc. Don’t forget to select the Parent channel from the drop down list. Finally, click Create Channel button.

Spacewalk - Channels - Manag_ - https___192.168.1.150_rhn_channels_manage_Edit.do

Similarly, we need to create a repository to the above Channel as described in the base channel section.

Adding Repository to Child Channel

Go to Channels –> Manage Software Channels –> Manage Repositories –> Create New repository.

For example, let us create a MariaDB repository. You can create your own.

Enter the repository name and actual URL:

Spacewalk - Channels - Manage Software Channels - Manage Repositories - Google Chrome_007

Please note that we just have created a repository for the Child channel. But, we haven’t assign it to the Channel yet.

Assigning repository to Child channel

Go to to Manage Software Channels again. Select the newly created child channel.

Spacewalk - Channels - Manage Software Channels - Google Chrome_008

Click on “Repositories” tab.

Spacewalk - Channels - Manage Software Channels - Details - Google Chrome_009

Select the above newly created repository from the list. Finally, click “Update repositories”.

Spacewalk - Channels - Manage Software Channels - Repositories - Add - Remove - Google Chrome_010

Please note that I have selected only the MariaDB repository (a repository created for Child channel). If you want to get packages from the CentOS official repository, you should select the centos7_mirror repository.

Now, it is time to sync all packages to the child channel’s repository. To do that, go to Channels –> Manage Software Channels –> <child-channel-name> –> Repositories –> Sync –> Sync Now.

Spacewalk - Channels - Manage Software Channels - Repositories - Sync - Google Chrome_012

Also, you can Schedule the sync process at regular Intervals on daily, weekly, monthly basis if you want.

Spacewalk - Channels - Manage Software Channels - Repositories - Sync - Google Chrome_014

The packages will be downloaded from the official MariaDB repository and kept in /var/satellite/ folder of your Spacewalk server. Make sure you have enough space in /var/satellite/ folder.

To verify whether the package synchronization is completed, go to Channels –> Manage Software Channels –> <Select your channel(Child or Base Channel)> –> Packages –> List / Remove.

Spacewalk - Channels - Manage Software Channels - Packages - Google Chrome_015

You’ll see that the packages from official MariaDB repository have been synced to your Spacewalk server.

Spacewalk - Chann_ - https___192.168.1.150_rhn_channels_manage_ChannelPackages.do

At this stage your Spacewalk server is almost ready to serve packages to the clients.

That’s all for now. In our next article, let us see how to install Spacewalk clients, and how to subscribe channels for the clients, and also how to install packages from the Spacewalk server’s Channel.

Till then stay tuned. Cheers!

Source and Reference: