Difference between revisions of "SUSE Manager/use-repositories-for-cloud-and-docker"

From MicroFocusInternationalWiki
Jump to: navigation, search
Line 1: Line 1:
 +
[[SUSE_Manager|SUSE Manager Main Page]]
 
= Using SUSE Manager Repositories =
 
= Using SUSE Manager Repositories =
 
This short document will describe how to use channels on a client without needing to register the system against SUSE Manager Server. This very usefull when creating images for OpenStack Cloud or Docker.
 
This short document will describe how to use channels on a client without needing to register the system against SUSE Manager Server. This very usefull when creating images for OpenStack Cloud or Docker.

Revision as of 08:52, 8 December 2015

SUSE Manager Main Page

Using SUSE Manager Repositories

This short document will describe how to use channels on a client without needing to register the system against SUSE Manager Server. This very usefull when creating images for OpenStack Cloud or Docker. In this document as an example SLES11 SP4 is used and for the channel design the assumption is that the SLES11SP4 channel is cloned to dev-, tst- and prd-. Replace where needed the names of ISOs, SLES version and channels according to the configuration needed.


Creating distributions

To enable “external” repositories to be used on a client with “zypper” a distribution within SUSE Manager is needed. The following procedure describes how this can be achieved:

1) Open a SSH session to the SUSE Manager server.

2) Create the following directories. If this is already present on the server, skip the next 5 bullets:

mkdir -p /srv/dist/isos
mkdir -p /srv/dist/mount/sles11sp4

3) Copy the SLES11 SP4 ISO (SLES-11-SP4-DVD-x86_64-GM-DVD1.iso) to /srv/dist/isos

4) Create the following entry in /etc/fstab

/srv/dist/isos/SLES-11-SP4-DVD-x86_64-GM-DVD1.iso       /srv/dist/mount/sles11sp4/           iso9660 loop,ro 0 0

5) Mount the iso:

mount -a

With the command mount check if the iso is mounted.

6) Start an internet browser and go to the webGUI of SUSE Manager. Login and go to Systems | Autoinstallation | Distributions.

7) Click on "Create new distribution" and enter the following information:

Distribution Label: dev-sles11sp4-repos
Tree Path: /srv/dist/mount/sles11sp4/
Base Channel: dev-sles11-sp4-pool-x86_64
Installer Generation: SUSE Linux

Finish the distribution by clicking on “Create Autoinstallable Distribution”

This complete the creation of the distribution. In the next paragraph it will be discussed how this can be used with “zypper”

Using Distribution Repositories with zypper

To use the repositories belonging to the distrubtion, zypper commands can be used.

zypper will use an http link to the repository. The link is looking as follows:

http://<suman_server>/ks/dist/child/<childchannel_label>/<distribution_label>

The <suman_server> is the hostname or the IP-address of the SUSE Manager server. To prevent problems with resolving the hostname, using the IP-address is preferred. If the system can only access a SUSE Manager Proxy server, please contact SUSE Consulting or the documentation how this can be achieved for these systems.

The <childchannel_label> is the label (not the name) of a childchannel that needs to be used. Typically these are the update channels or channels with custom packages. To find the label of such channel click on the GUI on the channel name or use the following spacecmd command to show all childchannels from the channel on which the distribution is created, e.g.:

spacecmd -q -- softwarechannel_listchildchannels dev-sles11-sp4-pool-x86_64

If the basechannel (the pool with the same information as the installation ISO) is needed, the following should be used with zypper:

http://<suman_server>/ks/dist/<distribution_label>

To add a repository to a system use the following command:

zypper ar -G <repo_link> <description>

To remove the repository use the following command:

zypper rr <description>


Example SLES11 SP4

The following is an example using SLES11 SP4. The following prerequisites have been made: Needed repositories for the system to be updated:

  • standard pool and updates
  • updates and sdk pool and updates
  • The parent channel has the name: dev-sles11-sp4-pool-x86_64.
  • The distribution has been created following the above procedure and has the name: dev-sles11-sp4-repos

To name the exact labels of the needed childchannels issue the following command on the SUSE Manager Servers console:

spacecmd -q -- softwarechannel_listchildchannels dev-sles11-sp4-pool-x86_64
dev-sle11-hae-sp4-pool-x86_64
dev-sle11-hae-sp4-updates-x86_64
dev-sle11-sdk-sp4-pool-x86_64
dev-sle11-sdk-sp4-updates-x86_64
dev-sles11-sp4-suse-manager-tools-x86_64
dev-sles11-sp4-updates-x86_64

This means that the following childchannels are needed:

dev-sle11-sdk-sp4-pool-x86_64
dev-sle11-sdk-sp4-updates-x86_64
dev-sles11-sp4-updates-x86_64 

On the system add the needed repositories with the following commands:

1) To add the basechannel:

zypper ar -G http://192.168.250.50/ks/dist/dev-sles11-sp4-repos dev-sles11-sp4-pool

2)To add the needed childchannels:

zypper ar -G http://192.168.250.50/ks/dist/child/dev-sles11-sp4-updates-x86_64/dev-sles11-sp4-repos dev-sles11-sp4-updates
zypper ar -G http://192.168.250.50/ks/dist/child/dev-sle11-sdk-sp4-pool-x86_64/dev-sles11-sp4-repos dev-sle11-sdk-sp4-pool-x86_64
zypper ar -G http://192.168.250.50/ks/dist/child/dev-sle11-sdk-sp4-updates-x86_64/dev-sles11-sp4-repos dev-sle11-sdk-sp4-updates-x86_64

To see all the added repositories issue the following:

zypper lr 
# | Alias                                         | Name                                          | Enabled | Refresh
--+-----------------------------------------------+-----------------------------------------------+---------+--------
1 | dev-sle11-sdk-sp4-pool                       | dev-sle11-sdk-sp4-pool                        | Yes     | No     
2 | dev-sle11-sdk-sp4-updates                     | dev-sle11-sdk-sp4-updates                     | Yes     | No     
3 | dev-sles11-sp4-pool                           | dev-sles11-sp4-pool                           | Yes     | No     
4 | dev-sles11-sp4-updates                        | dev-sles11-sp4-updates                        | Yes     | No     

To remove the repositories issue the following:

zypper rr dev-sles11-sp4-pool
zypper rr dev-sles11-sp4-updates
zypper rr dev-sle11-sdk-sp4-pool
zypper rr dev-sle11-sdk-sp4-updates


Example SLES12

The following is an example using SLES12. The following prerequisites have been made:

  • Needed repositories for the system to be updated:
 * standard pool and updates
 * web scripting pool
 * updates and sdk pool and updates 
  • The parent channel has the name: dev-sles12-pool-x86_64.
  • The distribution has been created following the above procedure and has the name: dev-sles12-repos


To find the exact labels of the needed childchannels issue the following command on the SUSE Manager Servers console:

# spacecmd -q -- softwarechannel_listchildchannels dev-sles12-pool-x86_64
dev-sle-ha12-pool-x86_64
dev-sle-ha12-updates-x86_64
dev-sle-manager-tools12-pool-x86_64
dev-sle-manager-tools12-updates-x86_64
dev-sle-module-adv-systems-management12-pool-x86_64
dev-sle-module-adv-systems-management12-updates-x86_64
dev-sle-module-web-scripting12-pool-x86_64
dev-sle-module-web-scripting12-updates-x86_64
dev-sle-sdk12-pool-x86_64
dev-sle-sdk12-updates-x86_64
dev-sles12-updates-x86_64

This means that the following childchannels are needed:

dev-sle-module-web-scripting12-pool-x86_64
dev-sle-module-web-scripting12-updates-x86_64
dev-sle-sdk12-pool-x86_64
dev-sle-sdk12-updates-x86_64
dev-sles12-updates-x86_64

On the system add the needed repositories with the following commands:

# To add the basechannel:
zypper ar -G http://192.168.250.50/ks/dist/dev-sles12-repos dev-sles12-pool
# To add the needed childchannels:
zypper ar -G http://192.168.250.50/ks/dist/child/dev-sles12-updates-x86_64/dev-sles12-repos dev-sles12-updates
zypper ar -G http://192.168.250.50/ks/dist/child/dev-sle-sdk12-pool-x86_64/dev-sles12-repos dev-sle12-sdk-pool
zypper ar -G http://192.168.250.50/ks/dist/child/dev-sle-sdk12-updates-x86_64/dev-sles12-repos dev-sle12-sdk-updates
zypper ar -G http://192.168.250.50/ks/dist/child/dev-sle-module-web-scripting12-pool-x86_64/dev-sles12-repos dev-sle-module-web-scripting12-pool-x86_64
zypper ar -G http://192.168.250.50/ks/dist/child/dev-sle-module-web-scripting12-updates-x86_64/dev-sles12-repos dev-sle-module-web-scripting12-updates-x86_64

To see all the added repositories issue the following:

zypper lr 
# | Alias                                         | Name                                          | Enabled | Refresh
--+-----------------------------------------------+-----------------------------------------------+---------+--------
1 | dev-sle-module-web-scripting12-pool-x86_64    | dev-sle-module-web-scripting12-pool-x86_64    | Yes     | No     
2 | dev-sle-module-web-scripting12-updates-x86_64 | dev-sle-module-web-scripting12-updates-x86_64 | Yes     | No     
3 | dev-sle12-sdk-pool                            | dev-sle12-sdk-pool                            | Yes     | No     
4 | dev-sle12-sdk-updates                         | dev-sle12-sdk-updates                         | Yes     | No     
5 | dev-sles12-pool                               | dev-sles12-pool                               | Yes     | No     
6 | dev-sles12-updates                            | dev-sles12-updates                            | Yes     | No     

To remove the repositories issue the following:

zypper rr dev-sles12-pool
zypper rr dev-sles12-updates
zypper rr dev-sle12-sdk-pool
zypper rr dev-sle12-sdk-updates
zypper rr dev-sle-module-web-scripting12-pool-x86_64
zypper rr dev-sle-module-web-scripting12-updates-x86_64

NOTE

This procedure will change with SUSE Manager 3. The wiki will be update when the new procedure is known and tested.