Chapter 2 Creating Software Channels and Repositories

This chapter describes how to create software channels in Spacewalk, for which client systems can subscribe and obtain packages and errata. Each channel is associated with at least one repository, which defines the source of the packages and errata.

The examples in this chapter use the Unbreakable Linux Network (ULN) and the Oracle Linux yum server. However, you can also use Spacewalk to obtain software packages from other internal or external sources.

2.1 About Software Channel Configuration

ULN provides more than 100 unique channels, which support the i386, x86_64, IA64, and the 64-bit Arm architectures, for releases of Oracle Linux 4 update 6 and later. To access ULN, go to https://linux.oracle.com/.

ULN provides an olN_arch_latest repository, all the latest versions of the packages in a distribution, including any errata that are also provided in the patch channel. If no vulnerabilities have been found in a package, the package version might be the same as that included in the original distribution. For other packages, the version is the same as that provided in the patch channel for the highest update level. For example, the ol6_arch_latest channel for Oracle Linux 6 Update 3 contains a combination of the ol6_u3_arch_base and ol6_u3_arch_patch channels. which includes all of the packages for an Oracle Linux release.

The Oracle Linux yum server provides the olN_latest repository, which includes all of the packages for an entire Oracle Linux release, in addition to the olN_uN_base repository for each update. Unlike ULN, the Oracle Linux yum server does not provide patch channels for updates.

Some channels, such as those for DTrace userspace, Ksplice, and OFED, are available on ULN, but not on the Oracle Linux yum server.

ULN also provides older versions of packages that are added to a parent channel. The _archive suffix is usually added to the channel for which it hosts archive packages. For example, the _latest channels have equivalent _latest_archive channels to host older versions of packages that have been updated in the _latest channels.

Packages are moved to an archive channel when newer versions of the same packages are added to the parent channel. The addition of archive channels helps keep the metadata for the parent channel manageable and also keeps the overall size of the channel down to a minimum. If you require an earlier version of a package, you can subscribe to the equivalent _archive channel to obtain it. When performing an installation or downgrade, you must specify the version of the package that you want to install.

Note

Installing packages from an _archive channel might result in your system running software that has since been patched for security related issues. This could open your system up to vulnerabilities that could be exploited for malicious purposes.

ULN also provides base and patch channels for each update of an Oracle Linux release. Depending on the Oracle Linux release, other channels might provide the latest packages for additional features such as DTrace user-space, Ksplice, and the OpenFabric Enterprise Edition (OFED) feature.

Other channels might also be available, such as _beta channels for the beta versions of packages.

As each new, major version or minor update of Oracle Linux becomes available, Oracle creates new base and patch channels for each supported architecture to distribute new packages. The existing base and patch channels for the previous versions or updates remain available and do not include the new packages. The _latest channel distributes the latest possible version of any package, and tracks the top of the development tree independently of the update level.

For a complete description of the main channels that are available on ULN, see the chapter on ULN registration in Oracle® Linux: Unbreakable Linux Network User's Guide for Oracle Linux 6 and Oracle Linux 7.

Oracle recommends that you design a channel configuration that is based on your particular work flow. For example, if you intend to use Spacewalk's channel cloning feature to promote systems from development through testing to production, you could configure a base channel and child patch channel together with other child channels.

If you duplicate child channels, you do not need to duplicate their repositories. These channels can use the same repositories as the channel from which they were cloned. For example, each cloned base channel might have a unique addons child channel, but each of the child channels would use the same repository. The packages are not duplicated, even though they are referenced in multiple channels.

To make archive channel content available to local clients, you must first create repositories for each ULN archive channel that you want to synchronize, then map these repositories to the software channels that you have created in Spacewalk.

If necessary, you can maintain the latest channels separately, without subscribing any systems to these channels. If the need arises, you can copy errata packages form the latest channels to the patch channels to make the latest fixes available.

Note

You do not need to associate a software channel with a repository if you want to create custom channels that obtain their packages by methods such as rhnpush or uploading by using the web interface. These methods enable you to serve locally developed and packaged software that has no upstream repository.

2.2 Configuring Software Channels for ULN

Spacewalk contains a ULN plugin for the spacewalk-repo-sync tool. The plugin enables you to synchronize software channels without having to register the Spacewalk server with ULN.

Configure the ULN plugin as follows:

  1. Change the mode of the /etc/rhn/spacewalk-repo-sync/uln.conf file to 600 (read-write).

    # chmod 600 /etc/rhn/spacewalk-repo-sync/uln.conf
  2. Edit the /etc/rhn/spacewalk-repo-sync/uln.conf file and add your SSO login user name and password for ULN:

    [main] 
    username=ULN_SSO_username 
    password=ULN_SSO_password
  3. Change the mode of the /etc/rhn/spacewalk-repo-sync/uln.conf file to 400 (read-only).

    # chmod 400 /etc/rhn/spacewalk-repo-sync/uln.conf
Important

To protect your ULN credentials, verify that the /etc/rhn/spacewalk-repo-sync/uln.conf file is read-only (file mode 0400) by root.

# ls -l /etc/rhn/spacewalk-repo-sync/uln.conf
-r--------. 1 root root 56 Feb  2 14:44 /etc/rhn/spacewalk-repo-sync/uln.conf

When you have configured the ULN plugin, you can use either the Spacewalk web interface, the spacecmd command, or the spacewalk-common-channels command to create Spacewalk software channels, repositories, and activation keys, as follows:

After you have set up the software channels and repositories, download the packages by synchronizing the software channels with ULN. See Section 2.6, “Synchronizing Software Channels”.

2.3 Configuring Software Channels to Obtain Packages From the Oracle Linux Yum Server

You can use the spacewalk-common-channels command, which is in the spacewalk-utils package, to configure software channels that use the Oracle Linux yum server. In addition to configuring software channels, you can use this command to configure repositories, GPG keys, and activation keys for Oracle Linux 6 and Oracle Linux 7.

To list the available channels, use the --list option:

# spacewalk-common-channels --list | grep "^ oracle"
 oraclelinux6:        i386, x86_64
 oraclelinux6-addons: i386, x86_64
 oraclelinux6-mysql55: i386, x86_64
 oraclelinux6-mysql56: i386, x86_64
 oraclelinux6-mysql57: i386, x86_64
 oraclelinux6-openstack30: x86_64
 oraclelinux6-playground: x86_64
 oraclelinux6-scl:    x86_64
 oraclelinux6-spacewalk22-client: i386, x86_64
 oraclelinux6-spacewalk22-server: x86_64
 oraclelinux6-spacewalk24-client: i386, x86_64
 oraclelinux6-spacewalk24-server: x86_64
 oraclelinux6-spacewalk26-client: i386, x86_64
 oraclelinux6-spacewalk26-server: x86_64
 oraclelinux6-spacewalk27-client: i386, x86_64
 oraclelinux6-spacewalk27-server: x86_64
 oraclelinux6-uek-r2: i386, x86_64
 oraclelinux6-uek-r3: x86_64
 oraclelinux6-uek-r4: x86_64
 oraclelinux7:        x86_64
 oraclelinux7-addons: x86_64
 oraclelinux7-ceph:   x86_64
 oraclelinux7-mysql55: x86_64
 oraclelinux7-mysql56: x86_64
 oraclelinux7-mysql57: x86_64
 oraclelinux7-openstack20: x86_64
 oraclelinux7-openstack21: x86_64
 oraclelinux7-openstack30: x86_64
 oraclelinux7-openstack30-extras: x86_64
 oraclelinux7-optional: x86_64
 oraclelinux7-scl:    x86_64
 oraclelinux7-spacewalk22-client: x86_64
 oraclelinux7-spacewalk22-server: x86_64
 oraclelinux7-spacewalk24-client: x86_64
 oraclelinux7-spacewalk24-server: x86_64
 oraclelinux7-spacewalk26-client: i386, x86_64
 oraclelinux7-spacewalk26-server: x86_64
 oraclelinux7-spacewalk27-client: i386, x86_64
 oraclelinux7-spacewalk27-server: x86_64
 oraclelinux7-uek-r3: x86_64
 oraclelinux7-uek-r4: x86_64
Note

Unlike ULN, the Oracle Linux yum server does not provide patch channels for each update of an Oracle Linux release. Instead, the spacewalk-common-channels command configures the base (parent) software channel to use the olN_latest repository, which includes all of the packages for the entire release.

Some ULN channels, such as those for DTrace user space, Ksplice, and OFED, are not available on the Oracle Linux yum server.

For example, you would create the software channels for Oracle Linux 7 (x86_64) as follows:

# spacewalk-common-channels -v -u swadm -p swadm_passwd -a x86_64 -k unlimited 'oraclelinux7*'
Connecting to http://localhost/rpc/api
Base channel 'Oracle Linux 7 (x86_64)' - creating...
* Activation key 'oraclelinux7-x86_64' - creating...
* Child channel 'Oracle Linux 7 Addons (x86_64)' - creating...
** Activation key '1-oraclelinux7-x86_64' - adding child channel...
* Child channel 'Oracle Linux 7 MySQL 5.5 (x86_64)' - creating...
** Activation key '1-oraclelinux7-x86_64' - adding child channel...
* Child channel 'Oracle Linux 7 MySQL 5.6 (x86_64)' - creating...
** Activation key '1-oraclelinux7-x86_64' - adding child channel...
* Child channel 'Oracle Linux 7 MySQL 5.7 (x86_64)' - creating...
** Activation key '1-oraclelinux7-x86_64' - adding child channel...
...

where swadm and swadm_passwd are the user name and password of the Spacewalk administrator. The -k unlimited option specifies that the command should create an activation key with no limit on the number of servers with which you can use it.

Note

If you omit this option, no activation key is created.

You can use either the Spacewalk web interface or the spacecmd command to display, modify, or delete available channels, repositories, and activation keys.

See the following for more information and instructions:

After you have set up the software channels and repositories, download the packages by synchronizing the software channels with the Oracle Linux yum server. See Section 2.6, “Synchronizing Software Channels”.

2.4 Working With Repositories

Spacewalk repositories define where to obtain packages from ULN or the Oracle Linux yum server.

For ULN, a Spacewalk repository specifies the URL of a ULN channel in the following format:

uln:///ULN_channel_label

You can obtain a list of available ULN channel labels by logging into ULN (https://linux.oracle.com) and then selecting the Channels tab.

The URL must contain three forward slash (/) characters, as shown in this example:

uln:///ol6_x86_64_latest

For the Oracle Linux yum server, a Spacewalk repository specifies the URL of an Oracle Linux yum server repository by using the following format:

https://yum.oracle.com/repository_path

You can obtain the URLs from the Oracle Linux yum server repo files at https://yum.oracle.com/.

Because each Spacewalk repository is specific to the i386 or x86_64 architecture, replace $basearch with the architecture, as shown in the following example:

https://yum.oracle.com/repo/OracleLinux/OL6/6/base/x86_64/

2.4.1 Working With Repositories by Using the Spacewalk Web Interface

Figure 2.1 Repositories Page

Go to Channels, select Manage Software Channels, and then select Manage Repositories:

  • To create a repository:

    1. Click + create new repository.

    2. On the Create New Repository page, enter the following repository settings:

      Repository Type

      Specify yum for the Oracle Linux yum server repositories or uln for the ULN repositories.

      Repository Label

      Enter a name for the repository, for example, Oracle Linux 6 (x86_64).

      Repository URL

      Enter the URL of the source for the repository's packages. For example, uln:///ol6_x86_64_latest or https://yum.oracle.com/repo/OracleLinux/OL6/6/base/x86_64/.

      Leave the remaining fields unset for Oracle Linux.

    3. Click Create Repository to create the repository.

  • To view a repository, select its entry to display its details.

  • To modify a repository:

    1. Select the repository that you want to edit.

    2. On the Repository Details page, modify the repository settings and click Update Repository to save your changes.

  • To delete a repository:

    1. Go to Channels, select Manage Software Channels, and then select Manage Repositories.

    2. Select the repository that you want to delete.

    3. On the Repository Details page, click delete repository and then click Delete Repository to confirm.

To associate a software channel with a repository, see Section 2.5.1, “Working With Software Channels by Using the Spacewalk Web Interface”.

2.4.2 Working With Repositories by Using the spacecmd Command

Create a repository by using the repo_create command as follows:

spacecmd {SSM:0}> repo_create
Name: Ksplice for Oracle Linux 7
URL: uln:///ol7_x86_64_ksplice

To list all repositories, use the repo_list command:

spacecmd {SSM:0}> repo_list
External - Addons for Oracle Linux 6 (x86_64)
External - CentOS 6 (i386)
External - CentOS 6 (x86_64)
External - Latest Unbreakable Enterprise Kernel Release 2 for Oracle Linux 6 (x86_64)
External - Latest Unbreakable Enterprise Kernel Release 3 for Oracle Linux 6 (x86_64)
External - Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux 6 (x86_64)
External - MySQL 5.5 for Oracle Linux 6 (x86_64)
External - MySQL 5.6 for Oracle Linux 6 (x86_64)
External - OpenStack 3.0 packages for Oracle Linux 6 (x86_64)
External - Oracle Linux 6 (x86_64)
External - Playground (Mainline) Kernels for Oracle Linux 6 (x86_64)
External - Software Collection Library packages for Oracle Linux 6 (x86_64)
External - Spacewalk 2.2 Client for Oracle Linux 6 (x86_64)
External - Spacewalk 2.2 Server for Oracle Linux 6 (x86_64)
External - Spacewalk 2.4 Client for Oracle Linux 6 x86_64
External - Spacewalk 2.4 Server for Oracle Linux 6 (x86_64)
External - Spacewalk 2.6 Server for Oracle Linux 6 (x86_64)
External - Spacewalk 2.7 Client for Oracle Linux 6 (x86_64)
External - Spacewalk 2.7 Server for Oracle Linux 6 (x86_64)
epel6-p-repo
ol5-i386-repo
ol5-i386-repo-test
ol5-x64-repo
ol6-i386-repo
ol6-x64-repo
ol7-repo
repo1-label
repo2-label
uln_repo

To list the details of a repository, use the repo_details command:

spacecmd {SSM:0}> repo_details "External - Oracle Linux 6 \(x86_64\)"
Repository Label:                  External - Oracle Linux 6 (x86_64)
Repository URL:                    https://yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/
Repository Type:                   yum
Repository SSL Ca Certificate:     None
Repository SSL Client Certificate: None
Repository SSL Client Key:         None

The parentheses in the name must be escaped with backslashes to protect them from the shell.

To delete a repository, use the repo_delete command:

spacecmd {SSM:0}> repo_delete "Ksplice for Oracle Linux 6"
Repos
-----
Ksplice for Oracle Linux 6

Delete these repos [y/N]: y

To associate a software channel with a repository, see Section 2.5.2, “Working With Software Channels by Using the softwarechannel_create Command”.

2.5 Working With Software Channels

The main software channel for an Oracle Linux release is termed a base (or parent) software channel. You can associate a number of child software channels with the base software channel. Each child software channel usually provides packages that are not available with the base software channel. If multiple versions of a package exist in different subscribed channels, yum versioning and dependency resolution ensure that the most up-to-date version of a package is installed.

You can subscribe a client to a single base channel and one or more of its child channels. For channels that are not specific to an update, such as addons, you can create an addons child channel for each update-level base channel and associate this child channel with the same addons repository.

If you set up Spacewalk to obtain Oracle Linux packages from ULN, Oracle recommends that you configure a separate olN_arch_un_base base software channel and olN_arch_un_patch child software channel for each update of Oracle Linux as it becomes available. This practice ensures that software channels stay small and helps to speed up channel cloning. Client systems are not upgraded across update levels unless you either change the source channel used for channel cloning or reconfigure the channels to which a client system subscribes.

The following example illustrates a typical configuration of the base and child software channels for Oracle Linux, where the base and patch channels are synchronized with ULN:

oraclelinux7-x86_64-base
 |-- oraclelinux7-x86_64-addons
 |-- oraclelinux7-x86_64-ksplice
 |-- oraclelinux7-x86_64-optional
 |-- oraclelinux7-x86_64-patch
 |-- oraclelinux7-x86_64-spacewalk27-client
 |-- oraclelinux7-x86_64-uek-r4
Note

Software channels other than the base and patch software channels do not have to be associated with ULN.

Other channels, such as those for DTrace user-space, Ksplice, and OFED packages, are available on ULN but not the Oracle Linux yum server.

Oracle Linux yum server provides a _olN_latest channel, which includes all packages for an entire Oracle Linux release. As individual patch channels for each update are not available, configure the base software channel to use the _olN_latest channel. You can use the spacewalk-common-channels command to configure the software channels, repositories, GPG keys, and activation keys for Oracle Linux 6 and Oracle Linux 7. See Section 2.3, “Configuring Software Channels to Obtain Packages From the Oracle Linux Yum Server”.

The following example illustrates a typical configuration of the base and child software channels for Oracle Linux, where the base channel is synchronized with the ol7_latest channel on the Oracle Linux yum server:

oraclelinux7-u4-x86_64-base
 |-- oraclelinux7-u4-x86_64-addons
 |-- oraclelinux7-u4-x86_64-ksplice
 |-- oraclelinux7-u4-x86_64-optional
 |-- oraclelinux7-u4-x86_64-patch
 |-- oraclelinux7-u4-x86_64-spacewalk27-client
 |-- oraclelinux7-u4-x86_64-uek-r4

2.5.1 Working With Software Channels by Using the Spacewalk Web Interface

Figure 2.2 Software Channel Management Page

Go to Channels and select Manage Software Channels:

  • To create a software channel:

    1. Click + create new channel.

    2. On the Create Software Channel page, enter channel settings in the following fields, which are the most important for the initial configuration of a channel:

      Channel Name

      Enter a descriptive short name for the channel. For example, Oracle Linux 6 (x86_64) Base.

      Channel Label

      Enter a unique label for the channel that is used by the software. For example, oraclelinux6-x86_64.

      Note

      Channel labels must be unique across the entire Spacewalk installation. So, if you are going to have multiple child channels that use the same upstream repository, for example, if you have multiple parents, then each child channel must have its own unique label. A recommended practice is to specify the update level for each hierarchy in the label, such as oraclelinux6-u9-x86_64.

      Parent Channel

      Select None if this is a base software channel or select the name of the parent channel if this is a child software channel.

      Architecture

      Select IA32 (for i386 repositories) or x86_64, as appropriate.

      Yum Repository Checksum Type

      For Oracle Linux 6 and Oracle Linux 7, select sha256.

      Channel Summary

      Enter a short, descriptive summary of the channel, for example the channel name.

      Note

      This field cannot be left blank.

      Channel Description

      Enter a long description of the channel or leave the field blank.

      GPG key URL

      Enter the URL of the local GPG key. For Oracle Linux, enter file:///etc/pki/rpm-gpg/RPM-GPG-KEY.

      For third-party repositories, you must import the GPG key into Spacewalk and deploy the key by using provisioning or other method, as appropriate to your site.

      Note

      The Spacewalk Client requires locally stored GPG keys. Do not use an HTTP based URL. Use a GPG key that you have imported into the local file system.

      GPG key ID , GPG key Fingerprint

      Enter the appropriate key ID and fingerprint for the Oracle Linux release, per the information in following table:

      Release

      Key ID

      Key Fingerprint

      Oracle Linux 6

      EC551F03

      4214 4123 FECF C55B 9086 313D 72F9 7B74 EC55 1F03

      Oracle Linux 7

      EC551F03

      4214 4123 FECF C55B 9086 313D 72F9 7B74 EC55 1F03

    3. Click Create Channel to create the channel.

  • To associate a software channel with a repository:

    1. Select the channel that you want to associate with a repository.

    2. On the Basic Channel Details page, select Repositories, select the check box of the repository, and click Update Repositories.

  • To view a software channel, select its entry to display its details.

    Alternatively, go to Channels, select Software Channels and click + next to the name of the base channel to display its child channels. Select the entry for a software channel to display its details.

  • To modify a software channel:

    1. Select the channel that you want to edit.

    2. On the Basic Channel Details page, modify the channel settings and click Update Channel to save your changes.

      Note

      You cannot change the channel label after you have created the channel.

  • To delete a software channel:

    1. Select the channel that you want to delete.

    2. On the Basic Channel Details page, click delete software channel and then click Delete Channel to confirm.

2.5.2 Working With Software Channels by Using the softwarechannel_create Command

To create a software channel, use the spacecmd command as follows:

spacecmd {SSM:0}> softwarechannel_create
Channel Name: Ksplice for Oracle Linux 7
Channel Label: oraclelinux7-x86_64-ksplice
Base Channels
-------------
oraclelinux6-x86_64
oraclelinux7-x86_64

Select Parent [blank to create a base channel]: oraclelinux7-x86_64

Architecture
------------
i386-sun-solaris
ia32
ia64
ppc
sparc-sun-solaris
x86_64

Select: x86_64

Checksum type
------------
sha256
sha384
sha512

Select: sha1

GPG URL
------------

GPG URL: file:///etc/pki/rpm-gpg/RPM-GPG-KEY

GPG ID
------------

GPG ID: EC551F03

GPG Fingerprint
---------------

GPG Fingerprint: 4214 4123 FECF C55B 9086 313D 72F9 7B74 EC55 1F03

To associate a software channel with a repository, use the softwarechannel_addrepo command, as shown in this example:

spacecmd {SSM:0}> softwarechannel_addrepo ksplice-ol7-x86_64 "Ksplice for Oracle Linux 7"

To list all software channels, use the softwarechannel_list command:

spacecmd {SSM:0}> softwarechannel_list oraclelinux7*
oraclelinux7-x86_64
oraclelinux7-x86_64-addons
oraclelinux7-x86_64-optional
oraclelinux7-x86_64-spacewalk27-client
oraclelinux7-x86_64-spacewalk27-server
oraclelinux7-x86_64-uek-r3
oraclelinux7-x86_64-uek-r4

The oraclelinux7* argument filters out all channels except those whose labels start with oraclelinux7.

To list all base (parent) software channels, use the softwarechannel_listbasechannels command:

spacecmd {SSM:0}> softwarechannel_listbasechannels
oraclelinux6-x86_64
oraclelinux7-x86_64

To list the children of a base software channel, use the softwarechannel_listchildchannels command:

spacecmd {SSM:0}> softwarechannel_listchildchannels oraclelinux7-x86_64
oraclelinux7-x86_64-addons
oraclelinux7-x86_64-optional
oraclelinux7-x86_64-spacewalk27-client
oraclelinux7-x86_64-spacewalk27-server
oraclelinux7-x86_64-uek-r3
oraclelinux7-x86_64-uek-r4

To list the systems that subscribe to a software channel, use the softwarechannel_listsystems command:

spacecmd {SSM:0}> softwarechannel_listsystems oraclelinux7-x86_64
svr1.mydom.com
svr2.mydom.com
...

To display the details of a software channel, use the softwarechannel_details command:

spacecmd {SSM:0}> softwarechannel_details oraclelinux7-x86_64
Label:              oraclelinux7-x86_64
Name:               Oracle Linux 7 (x86_64)
Architecture:       x86_64
Parent:             
Systems Subscribed: 0
Number of Packages: 0

Summary
-------
Oracle Linux 7 (x86_64)

GPG Key:            EC551F03
GPG Fingerprint:    4214 4123 FECF C55B 9086  313D 72F9 7B74 EC55 1F03
GPG URL:            file:///etc/pki/rpm-gpg/RPM-GPG-KEY

Repos
-----
External - Oracle Linux 7 (x86_64)

To delete a software channel, use the softwarechannel_delete command:

spacecmd {SSM:0}> softwarechannel_delete oraclelinux7-x86_64
Channels
--------
oraclelinux7-x86_64

Delete these channels [y/N]: y

2.6 Synchronizing Software Channels

After you have configured the software channels and the associated repositories, you can synchronize the software, either by performing an immediate manual synchronization or by scheduling a recurring synchronization job.

At minimum, Oracle recommends that you update the Oracle Linux latest channels daily.

The initial synchronization of the Oracle Linux channels can take several days to complete. Oracle recommends that you perform an initial manual synchronization to populate the channels, and then configure a recurring job to keep them updated.

You can use the Spacewalk web interface, the spacecmd command, or the spacewalk-repo-sync command to synchronize software channels.

2.6.1 Memory Considerations When Building Repositories

When building repository metadata, Spacewalk can fail with insufficient memory issues. This failure is caused by the default Java memory settings for the Taskomatic daemon, which are set to 512 MB of minimum RAM and 1024 MB of maximum RAM. These settings are defined in the global Spacewalk configuration file /etc/rhn/rhn.conf.

If this type of failure occurs, increase the maximum memory to 4096 MB by setting the following property in the configuration file:

taskomatic.java.maxmemory=4096

However, to assign a value greater than 4096 MB, follow these steps:

  1. Disable the automatic memory property settings.

  2. Manually add the minimum and maximum Java memory values (-Xms and -Xmx, respectively) to the taskomatic.java.additional.1 and taskomatic.java.additional.2 properties.

    The configuration file would resemble the following example:

    taskomatic.java.initmemory=0
    taskomatic.java.maxmemory=0
    taskomatic.java.additional.1=-Xms1024m
    taskomatic.java.additional.2=-Xmx8192m

Similar memory issues can also occur in the web interface if you have big data sets, such as a large number of servers or packages. To resolve these issues, increase the Tomcat memory limits in the /etc/sysconfig/tomcat6 file for Oracle Linux 6 and /etc/sysconfig/tomcat file for Oracle Linux 7. Specifically, edit the JAVA_OPTS environment variable and increase -Xms and -Xmx, which are the parameters, respectively, for the initial and the maximum amounts of memory.

2.6.2 Synchronizing Software Channels by Using the Spacewalk Web Interface

Figure 2.3 Channel Repositories Page

To synchronize software channels:

  1. Go to Channels, select Manage Software Channels and then select the required channel.

  2. On the Channel Details page, select Repositories and then select Sync.

  3. On the Channel Repositories page:

    1. Select the following check boxes as required:

      Do not sync erratas

      Select if you do not want to synchronize any errata that are available for the channel.

      Create kickstartable tree

      Select if you want to be able to associate a kickstart profile with the channel.

      Note

      ULN and the Oracle Linux yum server do not host the boot image files that you require to create a kickstartable tree. Instead, you can obtain the files from a Oracle Linux Media Pack DVD image and make them available on a local file system. See Chapter 4, Provisioning Client Systems.

      Terminate upon any error

      Select this option for synchronization to stop if an error occurs.

    2. Synchronize the software channel:

      • To perform an immediate manual synchronization, click Sync Now.

      • To schedule a recurring synchronization job, select the preferred schedule and times, and then click Schedule.

        You can specify a schedule by using Quartz format. For example, 0 30 22 ? * *, would specify that Spacewalk should resynchronize the channel every day at 10:30 PM. Using Quartz format is the only way to schedule a synchronization several times a day. For example, 0 0 0,2,22 ? * *, would specify that synchronization should take place at 10 PM, midnight, and 2 AM.

2.6.3 Synchronizing Software Channels by Using the spacecmd Command

You can synchronize a software channel by using the softwarechannel_syncrepos command as follows:

spacecmd {SSM:0}> softwarechannel_syncrepos oraclelinux7-x86_64-ksplice

Note that the command returns immediately and does not show the status of the synchronization.

You can use the tail -f command to view the log file, /var/logs/rhn/reposync/channel_label.log.

Set up a schedule for channel synchronization by using the softwarechannel_setsyncschedule command as follows:

spacecmd {SSM:0}> softwarechannel_setsyncschedule oraclelinux7-x86_64-ksplice 0 30 2 ? * *

The previous command configures the oraclelinux7-x86_64-ksplice channel to be resynchronized once every day at 2:30 AM. Specify the schedule in Quartz format. For more information, see http://www.quartz-scheduler.org/overview/ for more information.

List the scheduled channel synchronizations by using the softwarechannel_listsyncschedule command as follows:

spacecmd {SSM:0}> softwarechannel_listsyncschedule
  key  Channel Name                             Update Schedule     
-----  ---------------------                    ---------------                                              
  114  oraclelinux7-x86_64                      0 0 1 ? * *                                     
  115  oraclelinux7-x86_64-addons                          
  177  oraclelinux7-x86_64-ksplice              0 30 2 ? * *                            
  120  oraclelinux7-x86_64-optional                            
  127  oraclelinux7-x86_64-patch                0 0 3 ? * *       
  123  oraclelinux7-x86_64-spacewalk27-client   0 0 4 ? * *                     
  124  oraclelinux7-x86_64-spacewalk27-server   0 30 4 ? * *                   
  125  oraclelinux7-x86_64-uek-r3               0 0 1 ? * *                         
  126  oraclelinux7-x86_64-uek-r4               0 30 0 ? * *        

To remove a scheduled channel synchronization, use the softwarechannel_removesyncschedule command as follows:

spacecmd {SSM:0}> softwarechannel_removesyncschedule oraclelinux7-x86_64-uek-r3

2.6.4 Synchronizing Software Channels by Using the spacewalk-repo-sync Command

You can use the spacewalk-repo-sync command to synchronize software channels. Using this command requires that you are the root user or that you have been granted permission in the /etc/sudoers file.

You can run the spacewalk-repo-sync command manually or in a cron job. If you run the command in a cron job, include the -q or --quiet options to prevent large email messages from being sent to root.

You can use the spacewalk-repo-sync -l command to display the channel label and the URL of the repository, as shown in the following example

# spacewalk-repo-sync -l | grep ksplice
ksplice-ol7-x86_64 | uln:///ol7_x86_64_ksplice
ksplice-ol6-i386 | uln:///ol6_i386_ksplice
ksplice-ol6-x86_64 | uln:///ol6_x86_64_ksplice

# spacewalk-repo-sync -l | grep addons
oraclelinux7-x86_64-addons | https://yum.oracle.com/repo/OracleLinux/OL7/addons/x86_64/
oraclelinux6-x86_64-addons | https://yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64/

To synchronize a channel with either a Yum or a ULN repository, use the -c option to specify the channel label, as shown in the following example for Oracle Linux 6:

# spacewalk-repo-sync -c ksplice-ol6-x86_64
#### Channel label: ksplice-ol6-x86_64 ####
Repo URL: uln:///ol6_x86_64_ksplice
The download URL is: https://linux-update.oracle.com/XMLRPC/GET-REQ/ol6_x86_64_ksplice
Packages in repo:              1296
Packages already synced:          0
Packages to sync:              1296
1/1296 : ksplice-snmp-plugin-0.1.0-2.el6-0.x86_64
2/1296 : uptrack-updates-2.6.39-400.210.2.el6uek.x86_64-20150206-0-0.noarch
...
1295/1296 : uptrack-updates-2.6.32-220.el6.x86_64-20150130-0-0.noarch
1296/1296 : uptrack-updates-2.6.32-200.20.1.el6uek.x86_64-20141216-0-0.noarch
Linking packages to channel.
Repo uln:///ol6_x86_64_ksplice has 0 errata.
Sync completed.
Total time: 1 day, 8:56:47

In the previous example, all of the packages that were downloaded as the channel had not previously been synchronized with ULN. The total time taken was approximately 33 hours.

You can use the same command to synchronize a channel with an Oracle Linux yum server repository, as shown in the following example:

# spacewalk-repo-sync -c oraclelinux6-x86_64-addons
#### Channel label: oraclelinux6-x86_64-addons ####
Repo URL: https://yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64/
Packages in repo:               308
No new packages to sync.
Repo https://yum.oracle.com/repo/OracleLinux/OL6/addons/x86_64/ has 6 errata.
Sync completed.
Total time: 0:01:09

In the previous example, no new packages were available for download.

Use the -p parent_channel option and argument to synchronize a parent channel and all of its children in one operation, as shown in this example:

# spacewalk-repo-sync -p oraclelinux7-x86_64

If you also specify the --latest option, as shown in the following example, the server synchronizes only the latest packages that are available:

 spacewalk-repo-sync -p oraclelinux7-x86_64 --latest
#### Channel label: oraclelinux7-x86_64 ####
Repo URL: https://yum.oracle.com/repo/OracleLinux/OL7/optional/latest/x86_64/
Packages in repo:             10133
Packages already synced:          0
Packages to sync:              5845
1/5845 : bind-lite-devel-9.9.4-18.el7_1.3-32.i686
2/5845 : bind-sdb-chroot-9.9.4-18.el7_1.2-32.x86_64
...

In the previous example, only the 5,845 latest packages (of the 10,133 total packages in the repository) needed to be downloaded.

Note

The --latest option downloads the latest packages that are available at the time of synchronization. Running the command does not remove older packages from the channel. If the synchronization interval is large, you might miss a particular version of a package, which can have implications for errata handling, where errata are associated with specific package versions. If errata consistency is important to you, Oracle recommends that you do not use --latest. Note that the exception is using --latest with a Ksplice channel because these packages are always cumulative.

For more information, see the spacewalk-repo-sync(8) manual page.

Caution

To reduce the overall space consumed by Ksplice Offline packages, Oracle strongly recommends using repository filters to limit downloaded packages to only those required by your client systems. You can apply a filter either on the Repository configuration in the Manage Repositories page in the web UI or by providing the -i or --include parameter with the spacewalk-repo-sync command line, for example:

# spacewalk-repo-sync --channel ol6_x86_64_ksplice -t uln \
  -i uptrack-updates-installed kernel base version,...

2.7 Cloning Software Channels

You can clone a software channel to capture the state of its packages and errata at a given point. Cloned channels are useful for providing a stable reference base when developing and testing server systems before deployment. Cloning channels are not recommended for deployed systems, as they might be exposed to security vulnerabilities.

Note the following addiitional information about cloning software channels:

  • You can use the Spacewalk web interface to clone one channel at a time.

  • If you want to clone a channel to preserve its state on a given date, use the spacewalk-clone-by-date command.

  • If you want to clone a base channel and all of its child channels at the same time, consider using the spacecmd or spacewalk-clone-by-date command.

  • The spacewalk-manage-channel-lifecycle command enables you to manage the life cycles of software channels from development, through testing to production. Oracle recommends using spacewalk-manage-channel-lifecycle in preference to spacewalk-clone-by-date as it supports archiving, roll back, and is designed for repetitive use. See Section 2.8, “Managing Channel Life Cycles by Using the spacewalk-manage-channel-lifecycle Command”.

2.7.1 Cloning Software Channels by Using the Spacewalk Web Interface

Figure 2.4 Clone Channel Page

Clone a software channel as follows:

  1. Go to Channels and select Manage Software Channels.

  2. Click clone channel.

  3. On the Clone Channel page, select the source channel that you want to clone from the pull-down menu, and select the clone type:

    Current state of the channel (all errata)

    The clone channel includes all packages and errata from the source channel.

    Original state of the channel (no errata)

    The cloned channel includes all of the packages that were originally in the source channel, but no associated errata.

    Select errata

    The cloned channel includes all of the packages that were originally in the source channel and any errata that you select. Selecting all errata is equivalent to cloning the current state of the channel. Selecting no errata is equivalent to cloning the original state of the channel.

  4. Click Create Channel.

  5. On the Edit Software Channel page, you can change the channel details. The default label is the source channel label prefixed with clone-.

  6. Click Create Channel again.

  7. If you specified Select errata as the clone type, the Clone Errata page displays the available errata. For each erratum, you can choose to merge it with the source erratum, to create a separate cloned erratum, or to do nothing and exclude the erratum. By default, an erratum is merged with the source erratum, which means that the source erratum is used instead of creating a cloned copy.

    Click Clone Errata when you have finished cloning errata.

  8. On the Details page for the channel, you can also edit the channel details other than the channel label.

    If you select the Errata tab, you can add errata from other channels or clone errata from the source channel.

    If you select the Packages tab, you can add or remove packages from the channel.

2.7.2 Cloning Software Channels by Using the spacecmd Command

You can clone a single channel by using the softwarechannel_clone command by running the following command:

spacecmd {SSM:0}> softwarechannel_clone -s ol6u9-x86_64 -x "s/$/-clone/" -o
spacecmd {SSM:0}> softwarechannel_details ol6u9-x86_64-clone

The -x option appends -clone to the new channel's name and label. The -o option excludes all errata from the cloned channel.

To compare the differences between the package contents of two channels, use the softwarechannel_diff command as follows:

spacecmd {SSM:0}> softwarechannel_diff ol6u9-x86_64-clone ol6u9-x86_64

To clone a base channel and all of its child channels, use the softwarechannel_clonetree command as follows:

spacecmd {SSM:0}> softwarechannel_clonetree -s ol6u9-x86_64 -p "clone-"

2.7.3 Cloning Software Channels by Using the spacewalk-clone-by-date Command

You use the spacewalk-clone-by-date command to clone Oracle Linux channels for a given date, which preserves the state of the channel's errata and their associated packages from its original release up to and including that date. If required, you can blocklist or remove packages, and choose which types of errata to include or exclude.

For example, the following command clones only security errata from the ol6-x86_64-latest channel up to January 31, 2017 to ol6-x86_64-latest-sec-20170131:

# spacewalk-clone-by-date --username=swadmin --password=swpasswd \
  --to_date=2017-01-31 --channels=ol6-x86_64-latest ol6-x86_64-latest-sec-20170131 \
  --security_only --background --assumeyes 

The command runs uninterrupted in the background. The specified spacewalk user must have Organizational Administrator or Channel Administrator privileges.

The following example clones both a base channel and a patch child channel up to January 31, 2017, excluding all versions of the ntp package and packages that start with fuse:

# spacewalk-clone-by-date --username=swadmin --password=swpasswd \
  --channels=ol6-x86_64-base ol6-x86_64-base-20170131
  --channels=ol6-x86_64-patch ol6-x86_64-patch-20170131
  --to_date=2017-01-31 --blacklist=ntp,fuse*

You can run spacewalk-clone-by-date remotely by using the -s option to specify the Spacewalk server's URL for XML/RPC API connections, for example -s https://swksvr_FQDN/rpc/api.

A common use case is to run spacewalk-clone-by-date at regular intervals to keep cloned channels up to date. To generate a sample configuration file, use the following command:

# spacewalk-clone-by-date --sample-config

For more information, see the spacewalk-clone-by-date(8) manual page.

2.8 Managing Channel Life Cycles by Using the spacewalk-manage-channel-lifecycle Command

The spacewalk-manage-channel-lifecycle command enables you to perform the following tasks to manage the life cycle of a software channel from development, through testing to production:

  • Create a development channel dev-ol6-x86_64-appsvr based on the latest available packages in ol6-x86_64-appsvr.

    # spacewalk-manage-channel-lifecycle -c ol6-x86_64-appsvr --init
  • Promote the packages from the development channel to the test channel test-ol6-x86_64-appsvr.

    # spacewalk-manage-channel-lifecycle -c dev-ol6-x86_64-appsvr --promote
  • Promote the packages from the test channel to the production channel prod-ol6-x86_64-appsvr.

    # spacewalk-manage-channel-lifecycle -c test-ol6-x86_64-appsvr --promote

You can save the state of a channel by creating an archive channel archive-date-channel.

# spacewalk-manage-channel-lifecycle -c prod-ol6-x86_64-appsvr --archive

If you need to restore the state of a channel, use the --rollback option and specify the archived version of the channel that you want to restore:

# spacewalk-manage-channel-lifecycle -c archive-20110520-test-ol6-x86_64-appsvr --rollback

Use the -l option to list the channels:

# spacewalk-manage-channel-lifecycle -l
Channel tree:

 1. archive-20160203-ol6-x86_64-appsvr
      \__ archive-20160203-prod-ol6-x86_64-appcmd
      \__ archive-20160203-prod-ol6-x86_64-applib

 2. dev-ol6-x86_64-appsvr
      \__ dev-ol6-x86_64-appcmd
      \__ dev-ol6-x86_64-applib
  
 3. ol6-x86_64-appsvr
      \__ ol6-x86_64-appcmd
      \__ ol6-x86_64-applib

 4. prod-ol6-x86_64-appsvr
      \__ prod-ol6-x86_64-appcmd
      \__ prod-ol6-x86_64-applib

 5. test-ol6-x86_64-appsvr
      \__ test-ol6-x86_64-appcmd
      \__ test-ol6-x86_64-applib