IBM Support

Suse Manager : cloning channels using spacewalk-clone-by-date method using CLI

How To


Summary

How to create clone of parent and child channels to a certain package update date using spacewalk-clone-by-date using CLI

Objective

to enhance the delivery of updates for certain projects and systems based on update dates , system architecture and version using CLI

Environment

Suse Manager version 3.2.x  , preferably version above 3.2.5 of Suse Manager
for this example we are setting the channels for Linux on Z channels ( s390x )

Steps

1. Identify the parent (base) and child channels you need to clone :

susemanager:~/jupiter# spacecmd -q -- softwarechannel_listbasechannels

sle-product-sles15-pool-ppc64le

sle-product-sles15-pool-s390x

sle-product-sles15-pool-x86_64

sle-product-sles15-sp1-pool-s390x

sle-product-sles15-sp1-pool-x86_64

sle-product-sles_sap15-pool-ppc64le

sle-product-sles_sap15-sp1-pool-ppc64le

sle-product-sles_sap15-sp1-pool-x86_64

sle11-sp4-sap-pool-ppc64

sle12-sp3-sap-pool-ppc64le

sle12-sp4-sap-pool-ppc64le

sle12-sp4-sap-pool-x86_64

sles11-sp4-pool-ppc64

sles11-sp4-pool-s390x

sles11-sp4-pool-x86_64

sles12-sp2-pool-x86_64

sles12-sp3-pool-ppc64le

sles12-sp3-pool-s390x

sles12-sp3-pool-x86_64

sles12-sp4-pool-ppc64le

sles12-sp4-pool-s390x

sles12-sp4-pool-x86_64

in this case the base (parent ) channel we are going to clone the child from is sles12-sp4-pool-s390x

2. now lets list all the child channels for this base ( parent channel )

susemanager:~/jupiter# spacecmd -q -- softwarechannel_listchildchannels sles12-sp4-pool-s390x

sle-ha12-sp4-pool-s390x

sle-ha12-sp4-updates-s390x

sle-manager-tools12-pool-s390x-sp4

sle-manager-tools12-updates-s390x-sp4

sle-sdk12-sp4-pool-s390x

sle-sdk12-sp4-updates-s390x

sles12-sp4-updates-s390x

suse-packagehub-12-sp4-pool-s390x

suse-packagehub-12-sp4-standard-pool-s390x

3. We will need to use the GUI to create a clone parent channel in order to clone the parent ( base channel ) :

From GUI go to the side menu and choose :

Software ==> Manage Software Channels ==> click at (+ Create Channel )

Fill in the details of the channel , for this example we will fill in these details

Channel Name*: s390x-patch-archives-channel

Channel Label*: s390x-patch-archives-channel

Parent Channel: None

Architecture: s390x

Repository Checksum Type: sha1

Tip: sha1 offers the widest compatibility with clients. sha256 offers higher security, but is compatible only with newer clients: Fedora 11 and newer, Red Hat Enterprise Linux 6 and newer or SLES11-SP1 and newer.

Channel Summary*: s390x-patch-archives-channel

Enable GPG check : yes ( check mark )

Then Click on Create Channel

4. now lets pick one of the child channels that we will clone , in that case we will pick

sles12-sp4-updates-s390x

Spacewalk-clone-by-date configuration file :

Here is below a sample of the configuration file after being modified :

{

 "username":"susemanager",

 "to_date": "2019-09-30",   ç========== the date should be identified to the last day the updates needed

 "skip_depsolve":false,

 "security_only":false,

 "use_update_date":false,

 "no_errata_sync":false,

 "dry_run":false,

"channels":[

             {

                "sles12-sp4-pool-s390x": 
                 {

                    "label": "s390x-patch-archives-channel",

                    "existing-parent-do-not-modify": true

                },

                "sles12-sp4-updates-s390x": 
                 {

                    "label": "sles12-sp4-updates-s390x-clone-jupiter-last",

                    "name": "Jupiter Last Clone test",

                    "summary": "This is my channel's summary example",

                    "description": "This is my channel's description example"

                }

             }

           ]

}

============================================Config File End=====================================================

5. Save the file as for this example “jupiter.conf” and run the “spacewalk-clone-by-date” command with “-c” option :

susemanager:~/jupiter# spacewalk-clone-by-date -c jupiter.conf

Password:

Reading repository information.

Using issue_date.

By continuing the following channels will be created:

sles12-sp4-updates-s390x-clone-jupiter-last

Continue with channel creation (y/n)?y

Cloning sles12-sp4-updates-s390x to sles12-sp4-updates-s390x-clone-jupiter-last with original package set.

Copying repodata, please wait.

Solving Dependencies (0):

________________________________________

######################################## - complete

Processing Dependencies:

________________________________________

######################################## - complete

By continuing the following will be cloned:

  sles12-sp4-updates-s390x -> sles12-sp4-updates-s390x-clone-jupiter-last  (472/499 Errata)

Continue with clone (y/n)?y

Cloning Errata into sles12-sp4-updates-s390x-clone-jupiter-last (472):

________________________________________

######################################## - complete

Copying repodata, please wait.

Solving Dependencies (2031):

________________________________________

######################################## - complete

Processing Dependencies:

________________________________________

######################################## - complete

Dependencies added, looking for new dependencies

Solving Dependencies (9):

________________________________________

######################################## - complete

Processing Dependencies:

________________________________________

######################################## - complete

9 RPM(s) added to sles12-sp4-updates-s390x-clone-jupiter-last to resolve dependencies.

6 errata added to sles12-sp4-updates-s390x-clone-jupiter-last to resolve dependencies.

Please see /var/log/rhn/errata-clone.log for details.

susemanager:~/jupiter#

6. Review from gui or command line if the clone was created as required :

susemanager:~/jupiter# spacecmd -q -- softwarechannel_listchildchannels | grep last

sles12-sp4-updates-s390x-clone-jupiter-last

susemanager:~/jupiter#

or from GUI :

Software ==> Manage Software Channels ==> Overview

7. Another way is to use 1 line command line using the below ( knowing that using this method will limit the customization for the summery, description name other options ) :

susemanager:~/jupiter# spacewalk-clone-by-date -d 2019-09-30 -u susemanager -p yourpass -l  sles12-sp4-updates-s390x sles12-sp4-updates-s390x-clone-jupiter-last -a  sles12-sp4-pool-s390x s390x-patch-archives-channel

Related Information

Document Location

Worldwide

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SGMV168","label":"SUSE Linux Enterprise Server"},"Component":"SUSE Manager , SLES , SLES 12","Platform":[{"code":"PF016","label":"Linux"}],"Version":"Suse Manager 3.2.x","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
01 April 2021

UID

ibm11085979