Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ......

140
Best Practices SUSE Manager 3

Transcript of Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ......

Page 1: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

Best Practices

SUSE Manager 3

Page 2: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

Best PracticesSUSE Manager 3Joseph Cayouette

Publication Date: 2017-10-09

Edited by SUSE Manager Team

SUSE LLC10 Canal Park DriveSuite 200Cambridge MA 02141USA

https://www.suse.com/documentation

Copyright © 2017 SUSE LLC

Copyright © 2011-2014 Red Hat, Inc.

The text of and illustrations in this document are licensed by Red Hat under a Creative Commons

Attribution-Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://

creativecommons.org/licenses/by-sa/3.0/ . In accordance with CC-BY-SA, if you distribute this document or an

adaptation of it, you must provide the URL for the original version.

This document is an adaption of original works found at https://access.redhat.com/site/

documentation/en-US/Red_Hat_Network_Satellite/5.4/ and https://access.redhat.com/site/documentation/en-US/

Red_Hat_Network_Satellite/5.5/ and https://access.redhat.com/site/documentation/en-US/Red_Hat_Satellite/ .

Red Hat, as a licensor of these documents, waives the right to enforce, and agrees not to assert, Section 4d of

CC-BY-SA to the fullest extent permitted by applicable law.

Page 3: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

Red Hat, Red Hat Enterprise Linux, the Shadowman logo, JBoss, MetaMatrix, Fedora, the Infinity Logo, and RHCE

are trademarks of Red Hat, Inc., registered in the United States and other countries. Linux® is the registered

trademark of Linus Torvalds in the United States and other countries. Java® is a registered trademark of Oracle

and/or its affiliates. XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United

States and/or other countries. MySQL® is a registered trademark of MySQL AB in the United States, the European

Union and other countries. All other trademarks are the property of their respective owners.

For Novell trademarks, see the Novell Trademark and Service Mark list http://www.novell.com/company/legal/

trademarks/tmlist.html . Linux* is a registered trademark of Linus Torvalds. All other third party trademarks

are the property of their respective owners. A trademark symbol (®, ™ etc.) denotes a Novell trademark; an

asterisk (*) denotes a third party trademark.

All information found in this book has been compiled with utmost attention to detail. However, this does not

guarantee complete accuracy. Neither Novell, Inc., SUSE LINUX Products GmbH, the authors, nor the translators

shall be held liable for possible errors or the consequences thereof.

Page 4: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

iv Best Practices

Contents

1 SUSE Manager 2.1 and 3 Product Comparison 11.1 Overview of Changes 1

2 Introduction 5

2.1 What's Covered in this Guide? 5

2.2 Prerequisites 5

2.3 Network Requirements 6

2.4 Hardware Recommendations 9

3 Managing Your Entitlements 11

3.1 Overview SUSE Customer Center (SCC) 11

3.2 Subscription Management Tool (SMT) and Disconnected Setup(DMZ) 11

4 Expanded Support 14

4.1 Managing RES Clients 14

Server Configuration for RES Channels 14 • RES Channel Management

Tips 14 • Mirroring RHEL Media into a Channel 15 • Registering

RES salt-minions with SUSE Manager 16 • Register a Salt Minion via

Bootstrap 17 • Manual Salt-minion Registration 18

4.2 Managing CentOS Expanded Support Clients (RES) 19

Creating Channels and Repositories 19 • Creating CentOS

Channels 19 • Adding the Repositories to the New

Channels 20 • Registering CentOS salt-minions with SUSE Manager 21

5 Configuration Management with Salt 22

5.1 Configuration Management Overview 22

5.2 State Data: Levels of Hierarchy 22

Page 5: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

v Best Practices

5.3 Salt States Storage Locations 23

5.4 SUSE Manager States 23

5.5 Pillar Data Exposed by SUSE Manager 24

6 Salt Minion Scalability 25

6.1 Minions Running with Unaccepted Salt Keys 25

6.2 Salt Timeouts 25

Background Information 25 • A Presence Ping Mechanism for Unreachable

Salt Minions 26 • Overriding Salt Presence Timeout Values 27 • Salt SSH

Minions (SSH Push) 27

7 Activation Key Management 28

7.1 What's Covered Here? 28

7.2 What are Activation Keys? 28

7.3 Provisioning and Configuration 29

7.4 Activation Keys Best Practices 29

Key Label Naming 30 • Channels which will be Included 30

7.5 Combining Activation Keys 31

7.6 Using Activation Keys and Bootstrap with Traditional Clients (Non-Salt) 32

7.7 Using Activation Keys when Registering salt-minions 33

Using an Activation Key and Custom Grains File 33 • Using an Activation Key

in the Minion Configuration File 34

8 Contact Methods 35

8.1 Selecting a Contact Method 35

8.2 Default (the SUSE Manager Daemon rhnsd) 35

Configuring SUSE Manager rhnsd Daemon 36 • Viewing rhnsd Daemon

Status 37

Page 6: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

vi Best Practices

8.3 Push via SSH 37

Configuring the Server for Push via SSH 38 • Using sudo with Push

via SSH 39 • Client Registration 39 • API Support for Push via

SSH 41 • Proxy Support with Push via SSH 42

8.4 Push via Salt SSH 42

Overview 43 • Requirements 43 • Bootstrapping 44 • Configuration 45 • Action

Execution 45 • Known Limitation 45 • For More Information 46

8.5 osad 46

Configuring and Enabling osad 47 • osad Configuration and Logging

Files 49

9 Advanced Patch Lifecycle Management 50

9.1 What's Covered Here? 50

9.2 Assumptions 50

9.3 Patch Lifecycle Management Overview 51

Important Terminology 52

9.4 Example Scenario 52

9.5 Implementation 53

9.6 Base Channels and Architecture 55

9.7 Automation and Process Design 57

9.8 Patch Promotion Cycle 58

9.9 Exception and Escalation Channels 60

9.10 Components to be Created 61

9.11 Channels 61

Creating Archive Channels 62 • Service Pack Migration Support with

Update and Exception Channels 64 • Current-Updates Channels

67 • Exception Channels 68

9.12 Activation Keys and Bootstrapping 70

Page 7: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

vii Best Practices

9.13 Scripts 72

Patch/Package Merge Script 72 • Channel Archive Creation Script / Channel

Archive Sources List Config File 73

9.14 Crontab Entries and Automation 73

9.15 Use Cases and Workflows 74

Workflow 1: Patch Promotion Process 75 • Workflow 2: Patch Exception

Process 76 • Workflow 3: Security ASAP Exceptions Process 77

9.16 Sample Scripts 80

Sample Spacewalk-Clone-By-Date Configuration 80 • Sample Patch/Package

Merge Script Using Python 82 • Sample Crontab Entries for Automation

and Archive Channel Creation 83 • Sample Archive Channel Creation

Script 84 • Sample Archive Channel Sources List File 86

10 Live Patching 88

10.1 Introduction 88

10.2 Initial Setup Requirements 88

10.3 Viewing Available CVE's 88

10.4 Cloning Channels 89

10.5 Removing Kernel Patches 90

10.6 Promoting Channels 90

10.7 Installing kGraft Kernel Patches 91

11 Performing a Service Pack Migration 93

11.1 Service Pack Migration 93

11.2 Migrating SUSE Manager Version 3.0 to 3.1 93

12 SUSE Manager Migration from Version 2.1 toVersion 3 94

12.1 Introduction 94

12.2 Prerequisites 94

Page 8: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

viii Best Practices

12.3 Setup the Target Machine 95

12.4 Performing the Migration 96

12.5 Speeding up the Migration 97

12.6 Packages on External Storage 98

12.7 Troubleshooting a Broken Web UI after Migration 98

12.8 Example Session 98

13 Common Administration Tasks 104

13.1 Updating SUSE Manager 104

14 Database Backup and Restoration 105

14.1 Files and Directories Requiring Backup 105

14.2 Administering The SUSE Manager Database with (smdba) 106

14.3 Starting and Stopping the Database 107

14.4 Backing up the Database 108

14.5 Automatic Backup with cron 110

14.6 Restoring a Database Backup 111

14.7 Archive Log Settings 111

14.8 Retrieving an Overview of Occupied Database Space 112

14.9 Moving the Database 113

14.10 Recovering from a Crashed Root Partition 114

14.11 Database Connection Information 115

15 Using a Custom SSL Certificate 116

15.1 Prerequisites 116

15.2 Using a Custom Certificate with SUSE Manager Proxy 3 117

Page 9: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

ix Best Practices

16 System Auditing and Security Management 118

16.1 Implementing PAM Authentication 118

17 Troubleshooting 120

17.1 Registering Cloned Salt Systems (minions) 120

17.2 Registering Cloned Traditional Systems 122

17.3 Typical OSAD/jabberd Challenges 124

Open File Count Exceeded 124 • jabberd Database

Corruption 124 • Capturing XMPP Network Data for Debugging

Purposes 125 • Engineering Notes: Analyzing Captured Data 126

18 Additional Resources 128

18.1 Learning YAML Syntax for Salt States 128

18.2 Getting Started with Jinja Templates 128

18.3 Salt Best Practices 128

A GNU Licenses 129

A.1 GNU Free Documentation License 129

Page 10: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

1 Overview of Changes SUSE Manager 3

1 SUSE Manager 2.1 and 3 Product Comparison

1.1 Overview of ChangesYou may already have experience managing your systems using SUSE Manager 2.1. The goodnews is all the features you are used to working with, (regarding the traditional stack) havenot changed. The only real exception is that the original built-in monitoring feature has beenremoved. (Icinga, a third party monitoring solution is included within the SUSE Manager ToolsChannel for SLES12 and SLES 12 SP1, and will become fully integrated in a maintenance update).SUSE Manager 3 supports managing systems via the popular IT orchestration engine Salt, inaddition to the previously existing traditional management stack.

Important: Selecting a Management MethodYou cannot and should not mix a single system with both methods although you canhave Salt managed systems and traditionally managed systems coexisting and managedby a SUSE Manager server. You may for example have a development department andassign all machines in this department as Salt minions, likewise you could also have aproduction department and assign machines as traditional bootstrap clients. Remembera single machine is either traditionally managed or Salt but never both.

Keep in mind that minions are not traditional clients and their feature set is currently limited.Future maintenance updates will provide feature parity over time and your feedback forprioritization of these features is welcome! The following tables provide a comparison betweeneach feature set. This includes features in development and features available only to theirparent management stack.

Feature/Function Traditional Management Salt Management

Registration bootstrap/rhnreg_ks Accept Minion Keys

Install Packages Supported Supported

Install Patches Supported Supported

Remote Commands Supported Scheduled Supported Real-time

Page 11: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

2 Overview of Changes SUSE Manager 3

Feature/Function Traditional Management Salt Management

System Package States Unsupported Supported

System Custom States Unsupported Supported

Group Custom States Unsupported Supported

Organization Custom States Unsupported Supported

System Set Manager Supported Supported

Service Pack Migration Supported Supported

Virtualization HostManagement: Auto-installation/bare metalinstallation support

Supported Coming Soon

System Redeployment: WithAuto-installation

Supported Coming Soon

Contact Methods: How theserver communicates with aclient

osad, rhnsd, ssh push,Supported

zeromq: Salt default

salt-ssh: Coming Soon

Red Hat Network ClientsRHEL 6, 7

Supported Supported

SUSE Manager Proxy Supported Supported

Action Chains Supported Unsupported

Software Crash Reporting Supported Unsupported

Staging Supported Under Review

Duplicate Package ReportingExample: Multiple Versions ofthe Linux Kernel

Supported Coming Soon

Page 12: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

3 Overview of Changes SUSE Manager 3

Feature/Function Traditional Management Salt Management

SCAP Auditing Supported Coming Soon

Support for MultipleOrganizations

Supported with IsolationEnforcement **

Supported without IsolationEnforcement **

Package Verification Supported Under Review

System Locking Supported Under Review

Configuration FileManagement

Supported Coming Soon

Snapshots and Profiles Supported Under Review

Power Management Supported Coming Soon

Warning: Isolation Enforcement **In SUSE Manager 2.1 organizations are multi-tenant and completely isolated from oneanother. This isolation includes both privacy and security. For example: User A in Org_1cannot see user B in Org_2. (This relates to any data specific to an organization including:servers, channels, activation keys, configuration channels, files and so on.)

In SUSE Manager 3.0 Salt currently does not support any level of multi-tenancy andtherefore information specific to an organization is accessible across organizations. Forexample:

salt '*' cmd.run "some_dangerous_command"

The above command will target all organization, groups and single systems including theirfiles, channels, activation keys etc. This should be kept in mind when working with Salt.

The following table provides an overview of differences in functionality between SUSE Manager2.1 and 3.

Page 13: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

4 Overview of Changes SUSE Manager 3

Functionality SUSE Manager 2.1 SUSE Manager 3

Configuration Management Based on Static Configuration Redesigned with SaltIntegration

Configuration Management No Concept of States States are Supported

Subscription Management Limited Functionality New Design, Full Featured

Monitoring Traditional MonitoringSupported until End of Life

Nagios Compatible, IcingaMonitoring Server isIncluded

Installation Approach Appliance Based Installed as an Add-on

Compatibility Compatibility CarriedForward to SUSE Manager 3

Maintains full SUSE Manager2.1 Functionality TraditionalMonitoring Removed

Page 14: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

5 What's Covered in this Guide? SUSE Manager 3

2 Introduction

This document targets system administrators.

2.1 What's Covered in this Guide?This document describes SUSE recommended best practices for SUSE Manager. This informationhas been collected from a large number of successful SUSE Manager real world implementationsand includes feedback provided by product management, sales and engineering.

This chapter will discuss the following topics:

Prerequisites

Network Requirements

Hardware Requirements

2.2 Prerequisites

Purchased Registration Keys.  During initial setup SUSE Manager will request a productRegistration Key . This key will be provided to you after purchasing the product. You can findyour key located under your SUSE Customer Center account. Log-in with your SUSE CustomerCenter credentials or register for a new account. — https://scc.suse.com

Evaluation Keys.  If you wish to run a test system (non-production) a 60 day evaluation key maybe obtained. On the SUSE Manager product page click TRY SUSE MANAGER. The evaluationkey limits the number of systems that may be registered with SUSE Manager to 10. — https://

www.suse.com/products/suse-manager/

SCC Organization Credentials.  During setup you will also be asked to enter your SUSE CustomerCenter Organization Credentials .

Users and Passwords.  During both the SUSE Linux Enterprise installation and setup of SUSEManager several users and passwords will be created:

SUSE Linux Enterprise root user account

PostgreSQL database user and password

Page 15: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

6 Network Requirements SUSE Manager 3

Certificate of Authority password

SUSE Manager administrator user and password

Tip: Safe PasswordsMaintain security by creating safe passwords. Store passwords within a secure location.Use the following guidelines when creating your passwords.

At least 8 characters long

Should contain uppercase characters A B C

Should contain lowercase characters a b c

Should contain numbers 1 2 3

Should contain symbols ~ ! @ #

2.3 Network RequirementsSUSE Manager and SUSE Manager Proxy both contact several external addresses in order tomaintain updates and entitlements. The following lists provide the up-to-date hostnames foreach service requiring permission when used in combination with corporate firewall and contentfilters.

SUSE CUSTOMER CENTER HOSTNAMES (REQUIRED)

https://scc.suse.com

https://updates.suse.com

NOVELL CUSTOMER CENTER HOSTNAMES (LEGACY)

https://secure-www.novell.com

https://nu.novell.com

For SUSE Manager to function properly it requires the following pre-configured componentswithin your network.

Networking Hardware.  The following table provides networking hardware info. As SUSEManager will likely be managing a large number of systems quite possibly numbering in

Page 16: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

7 Network Requirements SUSE Manager 3

hundreds or even thousands, networking hardware which increases bandwidth will becomeincreasingly more important.

Hardware Recommended

100Mbits/s Link Non-production test server

1Gb/s Link + Production Server

DHCP Server.  The purpose of the Dynamic Host Configuration Protocol (DHCP) is to assignnetwork settings centrally (from a server) rather than configuring them locally on each andevery workstation. A host configured to use DHCP does not have control over its own staticaddress. It is enabled to configure itself completely and automatically according to directionsfrom the server. A DHCP server supplies not only the IP address and the netmask, but also thehost name, domain name, gateway, and name server addresses for the client to use. For moreinformation on configuring DHCP see also:

https://www.suse.com/documentation/sles-12/book_sle_admin/data/cha_dhcp.html

FQDN.  DNS assists in assigning an IP address to one or more names and assigning a nameto an IP address. In Linux, this conversion is usually carried out by a special type of softwareknown as bind. The machine that takes care of this conversion is called a name server. The namesmake up a hierarchical system in which each name component is separated by a period. Thename hierarchy is, however, independent of the IP address hierarchy described above. Considera complete name, such as jupiter.example.com, written in the format hostname.domain. A fullname, referred to as a fully qualified domain name (FQDN), consists of a host name and a domainname (example.com). For more information on configuring a name server see also:

https://www.suse.com/documentation/sles-12/book_sle_admin/data/

sec_basicnet_nameres.html

DNS Server.  DNS (domain name system) is required for resolving domain names and host namesinto IP addresses. For example, the IP address 192.168.2.100 could be assigned to the host namejupiter. In the case of SUSE Manager the DNS server must be resolvable both via DNS and reverselookup. For more information on configuring DNS see also:

Page 17: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

8 Network Requirements SUSE Manager 3

https://www.suse.com/documentation/sles-12/book_sle_admin/data/cha_dns.html

Important: Microsoft NT Lan Manager CompatibilityMicrosoft NT Lan Manager can be configured for use with basic authentication and willwork with SUSE Manager but authentication using native (NTLM) Microsoft protocols isnot supported.

Open Port List.  During the setup process of SUSE Manager all required ports will be openedautomatically. The following tables provide you with an overview of ports which are used bySUSE Manager.

TABLE 2.1: REQUIRED SERVER PORTS

Port Description

67 Required when SUSE Manager is configured as a DHCP server for systemsrequesting IP addresses.

69 Used when SUSE Manager is configured as a PXE server and allows installationand re-installation of PXE-boot enabled systems.

80 Used to contact SUSE Customer Center. All WebGUI, client, and proxy serverrequests travel via http or https.

443 All WebGUI, client, and proxy server requests via http or https and SUSE Manageruses this port for SUSE Customer Center inbound traffic.

5222 When you wish to push actions to clients this port is required by the osad daemonrunning on your client systems

5269 Needed if you push actions to or via a SUSE Manager Proxy.

4505 Required by the Salt-master for communication via TCP to minions.

4506 Required by the Salt-master for communication via TCP to minions.

Page 18: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

9 Hardware Recommendations SUSE Manager 3

Tip: Denying External Network AccessWhen your network requires denying external network access to and from SUSE Manager,an SMT Server may be registered against SUSE Manager. The SMT server can then be usedto synchronize the necessary SUSE repositories. For more information on utilizing an SMTServer, see: Section 3.2, “Subscription Management Tool (SMT) and Disconnected Setup (DMZ)”.

Note: Blocking Port 80Port 80 may be blocked as traffic is automatically redirected through port 443. It shouldbe noted you will lose redirection. Keep in mind you will need additional ports open whenusing traditional clients in combination with osad , (XMPP TCP 5222).

2.4 Hardware RecommendationsThis section provides tested production recommendations for small to mid size networks thatwill be managed by SUSE Manager.

Hardware Recommended

CPU Multi-core 64bit CPU (x86_64).

RAM Minimum 4  GB+ for test server

Minimum 16 GB+ for base installation

Minimum 32 GB+ for a production server

Free Disk Space Minimum 100 GB for root partition

Minimum 50 GB for /var/lib/pgsql

Minimum 50 GB per SUSE product + 100 GB per Red Hat product /var/spacewalk

Advised Number of CPUs.  Review the following list for CPU recommendations.

Connecting 200 systems or less to SUSE Manager: 4 CPUs

Connecting 500 systems or less to SUSE Manager: 4-8 CPUs

When implementing RHEL channels: 8 CPUs

Page 19: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

10 Hardware Recommendations SUSE Manager 3

Disk Space.  SUSE Manager stores information in several directories. For these directories itis strongly recommend that you create separate file-systems or use an NFS share. Duringinstallation one VG will be created that contains all disks selected during installation. Thereforethe first disk should be large enough to contain the OS. Normally 20GB - 50GB is sufficient. A50 GB partition would be the recommended size. The following directories should be createdon a separate file-system.

/var/spacewalk This directory will contain all rpm's. Each RPM will be stored only once.The needed size will depend on the number of channels and type of channels that willbe downloaded. The general rule would be that per SUSE Service Pack (including SUSERedHat Expanded Support) around 50 GB should be enough. An extra 50 GB for non-SUSErepositories should be added on top. If other non-enterprise distributions (eg OpenSUSE,CentOS) will be added, also calculated 50 GB per distribution. This directory could alsobe stored on an NFS share.

/var/lib/pgsql This directory contains the PostgreSQL database. Recommended is tocreate a file-system of 50 GB. This volume should be monitored, because a full file-systemwhere the database is running on can cause unexpected errors (and this even months afterit happened).

/srv/tftpboot If PXE/cobbler is used, this directory will contain the images (initrd andlinux) for all created auto-installation profiles. Each image is around 50 MB. Dependingon the number of profiles a decision has to be made if it would be useful to move thisdirectory to a separate file-system.

/var/log As SUSE Manager writes a large number of logs, it is recommended to create aseparate file-system for /var/log. The size should be around 20 GB.

/var/spacewalk/db_backup For the backup of the PostgreSQL database, it isrecommended the create a separate directory. As the database can be rather large, it isadvised to mount it on a separate file-system. A safe estimate would be to provide twicespace as for the directory created for /var/lib/pqsql .

Supported Databases.  SUSE Manager 3 no longer provides support for an external Oracledatabase. The default database is an embedded PostgreSQL. During SUSE Manager setup thedatabase will be created and configured.

Page 20: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

11 Overview SUSE Customer Center (SCC) SUSE Manager 3

3 Managing Your Entitlements

There are two methods for managing your subscriptions and entitlements. Both methods accessSUSE Customer Center and provide specialized benefits.

Directly connecting to SUSE Customer Center is the recommended default way of managingyour SUSE Manager Server.

If you have special network security requirements which do not allow access from yourinternal network to the internet then you may use a SUSE Linux Enterprise 12 Serverrunning the Subscription Management Tool (SMT) for maintaining your entitlements. Thistool will contact SUSE Customer Center from a system connected to the external networkand obtain updates for your clients which you may then mount on your internal SUSEManager Server. This is the preferred method for managing client systems within a highlysecure network infrastructure.

3.1 Overview SUSE Customer Center (SCC)SUSE Customer Center (SCC) is the central place to manage your purchased SUSE subscriptionsand entitlements, helping you access your update channels and get in contact with SUSE experts.The user-friendly interface gives you a centralized view of all your SUSE subscriptions, allowingyou to easily find all subscription information you need. The improved registration providesfaster access to your patches and updates. SUSE Customer Center is also designed to providea common platform for your support requests and feedback. Discover a new way of managingyour SUSE account and subscriptions via one interface—anytime, anywhere.

For more information on using SUSE Customer Center see: https://scc.suse.com/docs/

userguide

3.2 Subscription Management Tool (SMT) andDisconnected Setup (DMZ)If it is not possible to connect SUSE Manager directly or via a proxy to the Internet,a disconnected setup in combination with Subscription Management Tool (SMT) is therecommended solution. In this scenario, SMT stays in an “external” network with a connection to

Page 21: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

12 Subscription Management Tool (SMT) and Disconnected Setup (DMZ) SUSE Manager 3

SUSE Customer Center and synchronizes the software channels and repositories on a removablestorage medium. Then you separate the storage medium from SMT, and mount it locally on yourSUSE Manager server to read the updated data.

The following procedure will guide you through using SMT.

PROCEDURE 3.1: SMT: FETCHING REPOSITORY DATA FROM SUSE CUSTOMER CENTER

1. Configure SMT in the external network with SUSE Customer Center (SCC). For detailsabout configuring SMT with SUSE Linux Enterprise 12, see: https://www.suse.com/

documentation/sles-12/book_smt/data/book_smt.html

2. Using SMT, mirror all required repositories.

3. Create a "database replacement file" (for example, /tmp/dbrepl.xml .

smt-sync --createdbreplacementfile /tmp/dbrepl.xml

4. Mount a removable storage medium such as an external hard disk or USB flash drive.

5. Export the data to the mounted medium:

smt-sync --todir /media/disk/smt-mirror --dbreplfile /tmp/dbrepl.xml --directory /media/disk \ --fromlocalsmt -L /var/log/smt/smt-mirror-export.log

Note: Keeping A Disconnected Server Up-to-datesmt-sync also exports your subscription and entitlement data. To keep SUSEManager up-to-date with your subscriptions and entitlements, you must frequentlyimport and export this data.

6. Unmount the storage medium and carry it securely to your SUSE Manager 3 Server.

The next procedure will show you how to update your server from the SMT media.

PROCEDURE 3.2: UPDATING YOUR SUSE MANAGER SERVER FROM THE STORAGE MEDIUM

1. Mount the storage medium on your SUSE Manager server (for example, at /media/disk ).

2. Specify the local path on the SUSE Manager server in /etc/rhn/rhn.conf :

server.susemanager.fromdir = /media/disk

Page 22: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

13 Subscription Management Tool (SMT) and Disconnected Setup (DMZ) SUSE Manager 3

This setting is mandatory for SUSE Customer Center and mgr-sync .

3. Restart Tomcat:

systemctl restart tomcat

4. Before performing another operation on the server execute a full sync:

mgr-sync refresh # SCC (fromdir in rhn.conf required!)

5. mgr-sync can now be executed normally:

mgr-sync list channelsmgr-sync add channel channel-label

Warning: Data CorruptionThe disk must always be available at the same mount point. To avoid datacorruption, do not trigger a sync, if the storage medium is not mounted. If you havealready added a channel from a local repository path, you will not be able to changeits URL to point to a different path afterwards.

Up-to-date data is now available on your SUSE Manager server and is ready for updating clientsystems. According to your maintenance windows or update schedule refresh the data on thestorage medium with SMT.

PROCEDURE 3.3: REFRESHING DATA ON THE STORAGE MEDIUM FROM SMT

1. On your SUSE Manager server, unmount the storage medium and carry it to your SMT.

2. On your SMT system, continue with Step 4.

Warning: Data CorruptionThe storage medium must always be available at the same mount point. To avoiddata corruption, do not trigger a sync if the storage medium is not mounted.

This concludes using SMT with SUSE Manager 3.

Page 23: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

14 Managing RES Clients SUSE Manager 3

4 Expanded Support

4.1 Managing RES ClientsThe following sections provide guidance on managing Red Hat Expanded Support clients, thisincludes salt-minions and traditional systems.

4.1.1 Server Configuration for RES Channels

This section provides guidance on server configuration for RES Channels provided by SUSE.

Minimum of 8GB ram and at least two physical CPU or virtual CPU's. Taskomatic will use1 of these CPUs

Taskomatic requires of minimum of 3072MB Ram. This should be set in /etc/rhn/rhn.conf :

taskomatic.java.maxmemory=3072

Provision enough disk space. /var/spacewalk contains all mirrored RPMs. For example:RES 6 x86_64 channels require 90GB+

LVM or an NFS mount is recommended

Access to RHEL 5/6/7 Subscription Media

Warning: Access to RHEL Media/repositoriesAccess to Red Hat base media repositories and RHEL installation media is theresponsibility of our customers. Ensure that all your RHEL systems obtain support fromRHEL, or alternatively all your RHEL systems obtain support from SUSE. If you do notfollow these practices you may violate terms with Red Hat.

4.1.2 RES Channel Management Tips

This section provides tips on RES channel management.

Page 24: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

15 Mirroring RHEL Media into a Channel SUSE Manager 3

The base parent distribution/architecture RES channel contains zero packages. No basemedia is provided by SUSE. The RHEL media or installation ISOs should be added as childchannels of the RES parent channel.

The RES and tools channels are provided by SUSE Customer Center(SCC) using mgr-sync

It can take up to or more than 24 hours for an initial channel sync.

Once you have completed the initial sync process of any RES channel it is recommended toclone the channel before working with it. This provides you with a backup of the originalsync.

4.1.3 Mirroring RHEL Media into a Channel

The following procedure guides you through setup of the RHEL media as a SUSE Managerchannel. All packages on the RHEL media will be mirrored into a child channel located underRES 5/6/7 distribution/architecture.

PROCEDURE 4.1: MIRRORING RHEL MEDIA INTO A CHANNEL

1. Create a new Channel by logging into the WebUI and selecting Channels > ManageSoftware Channels > Create Channel.

2. Fill in basic channel details and add the channel as a child to the corresponding RES 5/6/7distribution/architecture channel from Customer Center. The base parent channel shouldcontain zero packages.

3. Modify the RES 5/6/7 activation key to include this new child channel

4. As root on the SUSE Manager command line copy the ISO to /tmp directory.

5. Create a directory to contain the media content:

# mkdir -p /srv/www/htdocs/pub/rhel

6. Mount the ISO:

# mount -o loop /tmp/name_of_iso /srv/www/htdocs/pub/rhel

7. Start spacewalk-repo-sync to sync packages:

# spacewalk-repo-sync -c channel_name -u https://127.0.0.1/pub/rhel/Server/Repo URL: https://127.0.0.1/pub/rhel/Server/Packages in repo: 3690

Page 25: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

16 Registering RES salt-minions with SUSE Manager SUSE Manager 3

Packages already synced: 0Packages to sync: 36901/3690 : texlive-latex-2007-57.el6_2-0.x86_642/3690 : boost-filesystem-1.41.0-18.el6-0.i6863/3690 : policycoreutils-newrole-2.0.83-19.39.el6-0.x86_64[...]

8. Once the channel has completed the sync process you can utilize the channel as any normalSUSE Manager channel.

4.1.4 Registering RES salt-minions with SUSE Manager

This section will guide you through registering RHEL minions with SUSE Manager. This sectionassumes you have updated your server to the latest patch level

4.1.4.1 Syncing Appropriate RES Channels

Ensure you have the corresponding RES product enabled and required channels have been fullysynced:

RHEL 7.X

- Product: RES 7

- Mandatory channels: rhel-x86_64-server-7, res7-suse-manager-tools-x86_64, res7-x86_64

RHEL 6.X

- Product: RES 6

- Mandatory channels: rhel-x86_64-server-6, res6-suse-manager-tools-x86_64, res6-x86_64

Tip: Checking Sync ProgressTo check if a channel has finished syncing you can do one of the following:

From the SUSE Manager WebUI browse to Admin > Setup Wizard and select theSUSE Products tab. Here you will find a percent completion bar for each product.

Alternatively you may check the sync log file located under /var/log/rhn/

reposync/<channel-label>.log using cat or the tailf command. Keep in mindthat base channels can contain multiple child channels. Each of these child channels

Page 26: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

17 Register a Salt Minion via Bootstrap SUSE Manager 3

will generate its own log during the sync progress. Do not assume a channel hasfinished syncing until you have checked all relevant log files including base andchild channels.

Create an activation key associated with the RES channel.

4.1.4.2 Creating a Bootstrap Repository

The following procedure demonstrate creating a bootstrap repository for RHEL

1. On the server command line as root, create a bootstrap repo for RHEL with the followingcommand :

mgr-create-bootstrap-repo RHEL_activation_channel_key

If required, recreate the bootstrap script with the Salt option enabled:

mgr-bootstrap --salt

2. Rename bootstrap.sh to resversion-boostrap.sh:

# cp bootstrap.sh res7-bootstrap.sh

4.1.5 Register a Salt Minion via Bootstrap

The following procedure will guide you through registering a Salt-minion using the bootstrapscript.

PROCEDURE 4.2:  REGISTRATION USING THE BOOTSTRAP SCRIPT

1. From your new minion download the bootstrap script from the SUSE Manager server:

wget --no-check-certificate https://<server>/pub/bootstrap/res7-bootstrap.sh

2. Add the appropriate res-gpg-pubkey-#####-#####.key to the ORG_GPG_KEY keyparameter, comma delimited in your res7-bootstrap.sh script. These are located on yourSUSE Manager server at:

http://(FDQN)/pub/

Page 27: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

18 Manual Salt-minion Registration SUSE Manager 3

3. Make the bootstrap.sh script executable and run it. This will install necessary Salt packagesfrom the bootstrap repository and start the salt-minion service:

# chmod +x res7-bootstrap.sh# ./res7-boostrap.sh

4. From the SUSE Manager WebUI select the Salt > Onboarding and accept the new minionskey.

Important: Troubleshooting BootstrapIf you have issues bootstrapping a minion its usually due to missing packages. Thesemissing packages are contained on the RHEL installation media. The RHEL installationmedia should be loop mounted and added as a child channel to the RES channel. See thewarning above on access to RHEL Media.

4.1.6 Manual Salt-minion Registration

The following procedure will guide you through the registration of a Salt-minion manually.

1. Add the bootstrap repository:

yum-config-manager --add-repo https://<server>/pub/repositories/res/7/bootstrap

2. Install the salt-minion package:

# yum install salt-minion

3. Edit the salt-minion configuration file to point to the SUSE manager server:

# mkdir /etc/salt/minion.d# echo "master: <server fqdn>" > /etc/salt/minion.d/susemanager.conf

4. Start the minion service:

# systemctl start salt-minion

5. From the SUSE Manager WebUI select the Salt > Onboarding and accept the new minionskey.

Page 28: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

19 Managing CentOS Expanded Support Clients (RES) SUSE Manager 3

4.2 Managing CentOS Expanded Support Clients(RES)The following sections will guide you through preparing CentOS channels and repositories forbootstrapping CentOS clients to SUSE Manager.

4.2.1 Creating Channels and Repositories

Create the repositories for CentOS.

PROCEDURE 4.3: ADDING THE BASE REPOSITORY

1. Login to your SUSE Manager WebUI and browse to: Channels > Manage Software Channels> Manage Repositories and select Create New Repository

2. Add the Base repository details:

Repository label: CentOS 6 Base x86_64Repository URL: http://mirrors.kernel.org/centos/6/os/x86_64/

Has signed metadata? UNCHECKED

3. Repeat previous steps and create the updates repository:

Repository label: CentOS 6 updates x86_64Repository URL: http://mirrors.kernel.org/centos/6/updates/x86_64/(or your preferred mirror)

Has signed metadata? UNCHECKED

4.2.2 Creating CentOS Channels

Create the CentOS channels.

PROCEDURE 4.4: CREATING THE CENTOS CHANNELS

1. Login to your SUSE Manager WebUI and browse to: Channels > Manage Software Channels> Create New Channel

2. Add the following base channel details:

Channel Name*: CentOS 6 Base - x86_64

Page 29: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

20 Adding the Repositories to the New Channels SUSE Manager 3

Channel Label*: centos6-base-x86_64Parent Channel: NoneArchitecture: x86_64Repository Checksum Type: sha1

Channel Summary, etc: fill as desired

GPG key URL: http://mirrors.kernel.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6GPG key ID: C105B9DEGPG key Fingerprint: C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE

3. Repeat the previous steps and create the updates child channel

Channel Name*: CentOS 6 Updates - x86_64Channel Label*: centos6-updates-x86_64Parent Channel: CentOS 6 Base - x86_64Architecture: x86_64Repository Checksum Type: sha1

Channel Summary, etc: fill as desired

GPG key URL: http://mirrors.kernel.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6GPG key ID: C105B9DEGPG key Fingerprint: C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE

4.2.3 Adding the Repositories to the New Channels

Add the repositories to your new channels.

PROCEDURE 4.5: ADD REPOSITORIES TO CHANNELS

1. Login to your SUSE Manager WebUI and browse to: Channels > Manage Software Channelsand click the CentOS Base channel created previously.

2. Select the Repositories tab and select the CentOS base repository.

3. Now add the updates repository to the updates child channel. Browse to Channels >Manage Software Channels and select the CentOS Updates Channel created previously.

4. Select the Repositories tab and select the CentOS updates repository.

5. You may optionally force a sync of channel packages by clicking the Sync.

Page 30: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

21 Registering CentOS salt-minions with SUSE Manager SUSE Manager 3

6. Once you have completed syncing the Updates and Base CentOS channels you should seean estimated 6000+ packages for the base channel and a few hundred for the updateschannel. The next section will cover registering CentOS clients.

4.2.4 Registering CentOS salt-minions with SUSE Manager

Page 31: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

22 Configuration Management Overview SUSE Manager 3

5 Configuration Management with Salt

5.1 Configuration Management OverviewSalt is capable of applying states by matching minions with relevant state data. This data comesfrom SUSE Manager in the form of package and custom states.

5.2 State Data: Levels of HierarchyState data comes from SUSE Manager in the form of package and custom states and targetsminions at three specific levels of hierarchy. The state hierarchy is defined by the followingorder or priority: Individual minions have priority on packages and custom states over groups.Next a group has priority over the organization.

Minion Level

Systems Specific Minion States

Group Level

Systems System Groups

Organization Level

Systems Manage System Types: My Organization

For example:

Org1 requires that vim version 1 is installed

Group1 requires that vim version 2 is installed

Group2 requires any version installed

This would lead to the following order of hierarchy:

Minion1 part of [Org1, Group1] wants vim removed, vim is removed (Minion Level)

Minion2 part of [Org1, Group1] wants vim version 2 gets version 2 (Group Level)

Page 32: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

23 Salt States Storage Locations SUSE Manager 3

Minion3 part of [Org1, Group1] wants any version, gets version 2 (Org Level)

Minion4 part of[Org1, Group2] wants any version, gets vim version 1 (Org Level)

5.3 Salt States Storage LocationsThe SUSE Manager salt-master reads its state data from three file root locations.

The directory /usr/share/susemanager/salt is used by SUSE Manager and comes from thesusemanager-sls. It is shipped and updated together with SUSE Manager and includes certificatesetup and common state logic to be applied to packages and channels.

The directory /srv/susemanager/salt is generated by SUSE Manager and based on assignedchannels and packages for minions, groups and organizations. This file will be overwrittenand regenerated. This could be thought of as the SUSE Manager database translated into saltdirectives.

The third directory /srv/salt is for custom state data, modules etc. SUSE Manager does notoperate within or utilize this directory. However the state data placed here affects the Highstateof minions and is merged with the total state result generated by SUSE Manager.

5.4 SUSE Manager StatesAll sls files created by users will be saved to disk on the salt-master server. These files willbe placed in /srv/susemanager/salt/ and each organization will be placed within its owndirectory. Although these states are custom, these states are created using SUSE Manager. Thefollowing provides an overview of directory structure:

├── manager_org_DEVEL│ ├── files│ │ ... files needed by states (uploaded by users)...│ └── state.sls ... other sls files (created by users)...E.g.:├── manager_org_TESTING│ ├── files│ │ └── motd # user created│ │ ... other files needed by states ...│ └── motd.sls # user created ... other sls files ...

Page 33: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

24 Pillar Data Exposed by SUSE Manager SUSE Manager 3

5.5 Pillar Data Exposed by SUSE ManagerSUSE Manager exposes a small amount of internal data like group membership, organizationmembership and file roots as pillars which can be used with custom sls states. These are managedby SUSE Manager or by the user.

To avoid hard-coding organization id's within sls files, a pillar entry is added for eachorganization:

org-files-dir: relative_path_to_files

This file will be available for all minions which belong to this organization.

The following represents a Pillar example located in /etc/motd/ :

file.managed: - source: salt://{{ pillar['org-files-dir']}}/motd - user: root - group: root - mode: 644

Page 34: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

25 Minions Running with Unaccepted Salt Keys SUSE Manager 3

6 Salt Minion Scalability

6.1 Minions Running with Unaccepted Salt Keys

Minions which have not been on-boarded, (minions running with unaccepted salt keys) consumeresources, in particular inbound network bandwidth for ~2.5Kb/s per minion. 1000 idle minionswill consume around ~2.5Mb/s, and this number will drop to almost 0 once on-boarding hasbeen completed. Limit non-onboarded systems for optimal performance

Salt's official documentation suggests the maximum number of opened files should be set to atleast 2x the minion count. Current default is 16384, which is sufficient for ~8000 minions. Forlarger installations, this number may be increased by editing the following line in /usr/lib/systemd/system/salt-master.service :

LimitNOFILE=16384

6.2 Salt Timeouts

6.2.1 Background Information

Salt features two timeout parameters called timeout and gather_job_timeout that arerelevant during the execution of Salt commands and jobs—it does not matter whether they aretriggered using the command line interface or API. These two parameters are explained in thefollowing article.

This is a normal workflow when all minions are well reachable:

A salt command or job is executed:

salt '*' test.ping

Salt master publishes the job with the targeted minions into the Salt PUB channel.

Minions take that job and start working on it.

Page 35: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

26 A Presence Ping Mechanism for Unreachable Salt Minions SUSE Manager 3

Salt master is looking at the Salt RET channel to gather responses from the minions.

If Salt master gets all responses from targeted minions, then everything is completed andSalt master will return a response containing all the minion responses.

If some of the minions are down during this process, the workflow continues as follows:

1. If timeout is reached before getting all expected responses from the minions, then Saltmaster would trigger an aditional job (a Salt find_job job) targeting only pendingminions to check whether the job is already running on the minion.

2. Now gather_job_timeout is evaluated. A new counter is now triggered.

3. If this new find_job job responses that the original job is actually running on the minion,then Salt master will wait for that minion's response.

4. In case of reaching gather_job_timeout without having any response from the minion(neither for the initial test.ping nor for the find_job job), Salt master will return withonly the gathered responses from the responding minions.

By default, SUSE Manager globally sets timeout and gather_job_timeout to 120 seconds.So, in the worst case, a Salt call targeting unreachable minions will end up with 240 seconds ofwaiting until getting a response.

6.2.2 A Presence Ping Mechanism for Unreachable Salt Minions

In order to prevent waiting until timeouts are reached when some minions are down, SUSEintroduced a so-called "presence mechanism" for Salt minions.

On SUSE Manager  3.0.5 and later, this presence mechanism checks for unreachable Saltminions when SUSE Manager is performing synchronous calls to these minions, and it excludesunreachable minions from that call. Synchronous calls are going to be displaced in favor ofasynchronous calls but currently still being used during some workflows.

The presence mechanism triggers a Salt test.ping with a custom and fixed short Salt timeoutvalues. Default Salt values for the presence ping are: timeout = 4 and gather_job_timeout= 1 . This way, we can quickly detect which targeted minions are unreachable, and then excludethem from the synchronous call.

Page 36: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

27 Overriding Salt Presence Timeout Values SUSE Manager 3

6.2.3 Overriding Salt Presence Timeout Values

SUSE Manager administrators can increase or decrease default presence ping timeoutvalues by removing the comment markers ( # ) and setting the desired values forsalt_presence_ping_timeout and salt_presence_ping_gather_job_timeout options in/etc/rhn/rhn.conf :

# SUSE Manager presence timeouts for Salt minions# salt_presence_ping_timeout = 4# salt_presence_ping_gather_job_timeout = 1

6.2.4 Salt SSH Minions (SSH Push)

Salt SSH minions are slightly different that regular minions (zeromq). Salt SSH minions do notuse Salt PUB/RET channels but a wrapper Salt command inside of an SSH call. Salt timeoutand gather_job_timeout are not playing a role here.

SUSE Manager defines a timeout for SSH connections in /etc/rhn/rhn.conf :

# salt_ssh_connect_timeout = 180

The presence ping mechanism is also working with SSH minions. In this case, SUSE Manager willuse salt_presence_ping_timeout to override the default timeout value for SSH connections.

Page 37: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

28 What's Covered Here? SUSE Manager 3

7 Activation Key Management

7.1 What's Covered Here?

7.2 What are Activation Keys?

An activation key in SUSE Manager is a group of configuration settings with a label. Youcan apply all configuration settings associated with an activation key by adding its label as aparameter to a bootstrap script. Under normal operating conditions best practices suggest usingan activation key label always in combination with a bootstrap script.

An activation key can specify:

Channel Assignment

System Types (Traditionally called Add-on Entitlements)

Contact Method

Configuration Files

Packages to be Installed

System Group Assignment

So what do activation keys do exactly? Activation keys alone do nothing. The are just a collectionof configuration settings which have been given a label name and then added to a bootstrapscript. When the bootstrap script is executed all configuration settings associated with the labelare applied to the system the script is run on.

Page 38: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

29 Provisioning and Configuration SUSE Manager 3

7.3 Provisioning and Configuration

FIGURE 7.1: PROVISIONING AND CONFIGURATION OVERVIEW

7.4 Activation Keys Best Practices

There are a few important concepts which should be kept in mind when creating activationkeys. The following sections provide insight when creating and naming your activation keys.

Page 39: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

30 Key Label Naming SUSE Manager 3

7.4.1 Key Label Naming

One of the most important things to consider during activation key creation is label naming.Creating simple names which are associated with your organization's infrastructure will makeit easier for you when performing more complex operations. When naming key labels keep thefollowing in mind:

OS naming(mandatory): Keys should always refer to the OS they provide settings for

Architecture naming(recommended): Unless your company is running on one architecture,for example x86_64, then providing labels with an architecture type is a good idea.

Server type naming: What is, or what will this server be used for?

Location naming: Where is the server located? Room, building or department?

Date naming: Maintenance windows, quarter, etc.

Custom naming: What naming scheme suits your organizations needs?

Example activation key label names:

sles12-sp1-web_server-room_129-x86_64

sles12-sp2-test_packages-blg_502-room_21-i586

7.4.2 Channels which will be Included

When creating activation keys you also need to keep in mind which channels (software sources)will be associated with it.

Important: Default Base ChannelKeys should have a specific base channel assigned to it for example: SLES12-SP1-Pool-x86_64 If this is not the case SUSE Manager will be unable to utilize specific stages. Usingthe default base channel is not recommended and may cause problems.

Page 40: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

31 Combining Activation Keys SUSE Manager 3

Channels to be included:

suse-manager-tools

Typical packages to be included:

osad (pushing tasks)

Installs python-jabberpy and pyxml as dependencies

rhncfg-actions (Remote Command, Configuration Managment)

Installs rhncfg and rhncfg-client as dependencies

7.5 Combining Activation Keys

You can combine activation keys when executing the bootstrap script on your clients. Combiningkeys allows for more control on what is installed on your systems and reduces duplication ofkeys for large complex environments.

FIGURE 7.2: COMBINING ACTIVATION KEYS

Page 41: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

32 Using Activation Keys and Bootstrap with Traditional Clients (Non-Salt) SUSE Manager 3

FIGURE 7.3: COMBINING ACTIVATION KEYS 2

7.6 Using Activation Keys and Bootstrap withTraditional Clients (Non-Salt)

Create the initial bootstrap script template from the command line on the SUSE Manager serverwith:

# mgr-bootstrap

This command will generate the bootstrap script and place them in /srv/www/htdocs/pub/bootstrap .

Alternatively you may use the WebUI to create your bootstrap script template.

Create the activation keys you need from command line with:

Alternatively use the WebUI to create your keys. From the WebUI proceedto:Overview Tasks Manage Activation Keys

Page 42: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

33 Using Activation Keys when Registering salt-minions SUSE Manager 3

7.7 Using Activation Keys when Registering salt-minions

With the addition of Salt to SUSE Manager 3 states should now be considered best practiceover the more traditional way of combining activation keys. Although states allow for moreconfiguration options you need to place the new system within the correct group so the desiredstates will be applied to the system. Using an activation key on your minions will place thesystem within the correct group automatically.

You should be aware of a few facts when working with Salt over traditional activation keys:

Currently we do not support specifying an activation key on the minion on-boarding page.

Activation keys used with salt-minions are the same as those used with traditional systemsand may be shared.

The equivalent of specifying a key using the traditional bootstrap method is to placethe desired key in the grain of a minion. For more information on grains see: https://

docs.saltstack.com/en/latest/topics/targeting/grains.html

Once a minion has been accepted either from the Salt Onboarding page located in theWebUI or from the command line, all configurations specified by the activation key placedwithin a salt grain will be applied.

Currently you may only use one activation key when working with salt. You cannotcombine them, despite this, salt states allow for even more control.

7.7.1 Using an Activation Key and Custom Grains File

Create a custom grains file and place it on the minion here:

# /etc/salt/grains

Then add the following lines to the grains file replacing 1-sles12-sp1 with your activation keylabel:

susemanager: activation_key: 1-sles12-sp1

Page 43: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

34 Using an Activation Key in the Minion Configuration File SUSE Manager 3

Now restart the minion with:

# systemctl restart salt-minion

7.7.2 Using an Activation Key in the Minion Configuration File

You may also place the activation key grain within the minion configuration file located in:

# /etc/salt/minion

Now add the following lines to the minion configuration file replacing 1-sles12-sp1 with youractivation key label:

grains: susemanager: activation_key: 1-sles12-sp1

Reboot the minion with:

# systemctl restart salt-minion

Page 44: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

35 Selecting a Contact Method SUSE Manager 3

8 Contact Methods

8.1 Selecting a Contact MethodSUSE Manager provides several methods for communication between client and server. Allcommands your SUSE Manager server sends its clients to do will be routed through one of them.Which one you select will depend on your network infrastructure. The following sections providea starting point for selecting a method which best suits your network environment.

Note: Contact Methods and SaltThis chapter is only relevant for traditional clients as Salt clients (minions) utilize aSalt specific contact method. For general information about Salt clients, see Book “Getting

Started”, Chapter 6 “Getting Started with Salt”, Section 6.1 “Introduction”.

8.2 Default (the SUSE Manager Daemon rhnsd)The SUSE Manager daemon ( rhnsd ) runs on client systems and periodically connects with SUSEManager to check for new updates and notifications. The daemon, which runs in the background,is started by rhnsd.service or the rcrhnsd initialization script. By default, it will check every4 hours for new actions, therefore it may take some time for your clients to begin updating afteractions have been scheduled for them.

To check for updates, rhnsd runs the external mgr_check program located in /usr/sbin/ .This is a small application that establishes the network connection to SUSE Manager. The SUSEManager daemon does not listen on any network ports or talk to the network directly. Allnetwork activity is done via the mgr_check utility.

Warning: Auto accepting (EULAs)When new packages or updates are installed on the client via SUSE Manager, any licenses(EULAs) requiring agreement before installation are automatically accepted.

This figure provides an overview of the default rhnsd process path. All items left of the PythonXMLRPC server block represent processes running on a SUSE Manager client.

Page 45: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

36 Configuring SUSE Manager rhnsd Daemon SUSE Manager 3

FIGURE 8.1: RHNSD CONTACT METHOD

8.2.1 Configuring SUSE Manager rhnsd Daemon

The SUSE Manager daemon can be configured by editing the file on the client:

/etc/sysconfig/rhn/rhnsd

This is the configuration file the rhnsd initialization script uses. An important parameter forthe daemon is its check-in frequency. The default interval time is four hours (240 minutes). Ifyou modify the configuration file, you must as root restart the daemon with the command(systemd) systemctl rhnsd restart or (runcom) rcrhnsd restart .

Important: Minimum Allowed Check-in ParameterThe minimum allowed time interval is one hour (60 minutes). If you set the intervalbelow one hour, it will default back to the default of 4 hours (240 minutes).

Page 46: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

37 Viewing rhnsd Daemon Status SUSE Manager 3

8.2.2 Viewing rhnsd Daemon Status

You can view the status of rhnsd by typing the command systemctl status rhnsd or rcrhnsdstatus as root .

8.3 Push via SSH

Push via SSH is intended to be used in environments where your clients cannot reach the SUSEManager server directly to regularly check in and, for example, fetch package updates.

In detail, this feature enables a SUSE Manager located within an internal network to manageclients located on a DMZ. Due to security reasons, no system on a DMZ is authorized to open aconnection to the internal network and therefore your SUSE Manager server. The solution is toconfigure Push via SSH which utilizes an encrypted tunnel from your SUSE Manager server onthe internal network to the clients located on the DMZ. After all actions/events are executed,the tunnel is closed. The server will contact the clients in regular intervals (using SSH) to checkin and perform all actions and events.

Important: Push via SSH Unsupported ActionsCertain actions are currently not supported on scheduled clients which are managed viaPush via SSH. This includes re-installation of systems using the provisioning module.Additionally, image deployments using SUSE Studio will work only when the vhost ispermitted to directly connect to the SUSE Studio image store and download the requiredimages.

The following figure provides an overview of the Push via SSH process path. All items left ofthe Taskomatic block represent processes running on a SUSE Manager client.

Page 47: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

38 Configuring the Server for Push via SSH SUSE Manager 3

FIGURE 8.2: PUSH VIA SSH CONTACT METHOD

8.3.1 Configuring the Server for Push via SSH

For tunneling connections via SSH, two available port numbers are required, one for tunnelingHTTP and the second for tunneling via HTTPS (HTTP is only necessary during the registrationprocess). The port numbers used by default are 1232 and 1233 . To overwrite these, add twocustom port numbers greater than 1024 to /etc/rhn/rhn.conf like this:

ssh_push_port_http = high port 1ssh_push_port_https = high port 2

If you would like your clients to be contacted via their hostnames instead of an IP address, setthe following option:

ssh_push_use_hostname = true

It is also possible to adjust the number of threads to use for opening client connections in parallel.By default two parallel threads are used. Set taskomatic.ssh_push_workers in /etc/rhn/rhn.conf like this:

taskomatic.ssh_push_workers = number

Page 48: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

39 Using sudo with Push via SSH SUSE Manager 3

8.3.2 Using sudo with Push via SSH

For security reasons you may desire to use sudo and SSH into a system as a user other than root .The following procedure will guide you through configuring sudo for use with Push via SSH.

Note: sudo RequirementsThe packages spacewalk-taskomatic >= 2.1.165.19 and spacewalk-certs-tools=> 2.1.6.7 are required for using sudo with Push via SSH.

PROCEDURE 8.1: CONFIGURING SUDO

1. Set the following parameter on the server located in /etc/rhn/rhn.conf .

ssh_push_sudo_user = user

The server will use sudo to ssh as the configured user .

2. You must create the user specified in Step 1 on each of your clients and the followingparameters should be commented out within each client's /etc/sudoers file:

#Defaults targetpw # ask for the password of the target user i.e. root#ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!

3. Add the following line beneath the ## User privilege specification section of eachclient's /etc/sudoers file:

user ALL=(ALL) NOPASSWD:/usr/sbin/mgr_check

4. On each client add the following two lines to the /home/user/.bashrc file:

PATH=$PATH:/usr/sbinexport PATH

8.3.3 Client Registration

As your clients cannot reach the server, you will need to register your clients from the server.A tool for performing registration of clients from the server is included with SUSE Manager 3called mgr-ssh-push-init . This tool expects a client's hostname or IP address and the path toa valid bootstrap script located in the server's filesystem for registration as parameters.

Page 49: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

40 Client Registration SUSE Manager 3

Important: Specifying Ports for Tunneling before RegisteringClientsThe ports for tunneling need to be specified before the first client is registered. Clientsalready registered before changing the port numbers must be registered again, otherwisethe server will not be able to contact them anymore.

Note: mgr-ssh-push-init Disables rhnsdThe mgr-ssh-push-init command disables the rhnsd daemon which normally checksclients for updates every 4 hours. Because your clients cannot reach the server withoutusing the Push via SSH contact method, the rhnsd daemon is disabled.

For registration of systems which should be managed via the Push via SSH tunnel contactmethod, it is required to use an activation key that is configured to use this method. NormalPush via SSH is unable to reach the server. For managing activation keys, see Chapter 7,

Activation Key Management.

Run the following command as root on the server to register a client:

# mgr-ssh-push-init --client client --register \/srv/www/htdocs/pub/bootstrap/bootstrap_script --tunnel

To enable a client to be managed using Push via SSH (without tunneling), the same script maybe used. Registration is optional since it can also be done from within the client in this case.mgr-ssh-push-init will also automatically generate the necessary SSH key pair if it does notyet exist on the server:

# mgr-ssh-push-init --client client --register bootstrap_script

When using the Push via SSH tunnel contact method, the client is configured to connect SUSEManager via the high ports mentioned above (see /etc/sysconfig/rhn/up2date ). Tools likerhn_check and zypper will need an active SSH session with the proper port forwarding optionsin order to access the SUSE Manager API. To verify the Push via SSH tunnel connection manually,run the following command on the SUSE Manager server:

# ssh -i /root/.ssh/id_susemanager -R high port: susemanager :443 client zypper ref

Page 50: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

41 API Support for Push via SSH SUSE Manager 3

8.3.4 API Support for Push via SSH

The contact method to be used for managing a server can also be modified via the API. Thefollowing example code (python) shows how to set a system's contact method to ssh-push .Valid values are:

default (pull)

ssh-push

ssh-push-tunnel

client = xmlrpclib.Server(SUMA_HOST + "/rpc/api", verbose=0)key = client.auth.login(SUMA_LOGIN, SUMA_PASSWORD)client.system.setDetails(key, 1000012345, {'contact_method' : 'ssh-push'})

Note: Migration and Management via Push via SSHWhen a system should be migrated and managed using Push via SSH, it requires setupusing the mgr-ssh-push-init script before the server can connect via SSH. This separatecommand requires human interaction to install the server's SSH key onto the managedclient ( root password). The following procedure illustrates how to migrate an alreadyregistered system:

PROCEDURE 8.2: MIGRATING REGISTERED SYSTEMS

1. Setup the client using the mgr-ssh-push-init script (without --register ).

2. Change the client's contact method to ssh-push or ssh-push-tunnel respectively (viaAPI or Web UI).

Existing activation keys can also be edited via API to use the Push via SSH contact method forclients registered with these keys:

client.activationkey.setDetails(key, '1-mykey', {'contact_method' : 'ssh-push'})

Page 51: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

42 Proxy Support with Push via SSH SUSE Manager 3

8.3.5 Proxy Support with Push via SSH

It is possible to use Push via SSH to manage systems that are connected to the SUSE Managerserver via a proxy. To register a system, run mgr-ssh-push-init on the proxy system for eachclient you wish to register. Update your proxy with the latest packages to ensure the registrationtool is available. It is necessary to copy the ssh key to your proxy. This can be achieved byexecuting the following command from the server:

#mgr-ssh-push-init --client proxy

8.4 Push via Salt SSH

Push via Salt SSH is intended to be used in environments where your Salt clients cannot reach theSUSE Manager server directly to regularly checking in and, for example, fetch package updates.

Note: Push via SSHThis feature is not related to Push via SSH for the traditional clients. For Push via SSH,see Section 8.3, “Push via SSH”.

Page 52: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

43 Overview SUSE Manager 3

8.4.1 Overview

FIGURE 8.3: PUSH VIA SALT SSH CONTACT METHOD

Salt provides “Salt SSH” ( salt-ssh ), a feature to manage clients from a server. It works withoutinstalling Salt related software on clients. Using Salt SSH there is no need to have minionsconnected to the Salt master. Using this as a SUSE Manager connect method, this feature providessimilar functionality for Salt clients as the traditional Push via SSH feature for traditional clients.

This feature allows:

Managing Salt entitled systems with the Push via SSH contact method using Salt SSH.

Bootstrapping such systems.

8.4.2 Requirements

SSH daemon must be running on the remote system and reachable by the salt-apidaemon (typically running on the SUSE Manager server).

Python must be available on the remote system (Python must be supported by the installedSalt). Currently: python 2.6.

Page 53: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

44 Bootstrapping SUSE Manager 3

Note: Unsupported SystemsRed Hat Enterprise Linux and CentOS versions <= 5 are not supported because they donot have Python 2.6 by default.

8.4.3 Bootstrapping

To bootstrap a Salt SSH system, proceed as follows:

1. Open the Bootstrapping dialog in the Web UI (Salt Bootstrapping).

FIGURE 8.4: BOOTSTRAP MINION WITH SALT SSH ENABLED

2. Fill out the required fields. Select an Activation Key with the Push via SSH contact methodconfigured. For more information about activation keys, see Book “Reference Manual”,

Chapter 2 “Systems”, Section 2.8 “Activation Keys”.

3. Check the Manage system completely via SSH option.

4. Confirm with clicking the Bootstrap button.

Page 54: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

45 Configuration SUSE Manager 3

Now the system will be bootstrapped and registered in SUSE Manager. If done successfully, itwill appear in the Systems list.

8.4.4 Configuration

There are two kinds of parameters for Push via Salt SSH:

Bootstrap-time parameters — configured in the Bootstrapping page:

Host

Activation key

Password — used only for bootstrapping, not saved anywhere; all future SSH sessionsare authorized via a key/certificate pair

Persistent parameters — configured SUSE Manager-wide:

sudo user — same as in Section 8.3.2, “Using sudo with Push via SSH ”.

8.4.5 Action Execution

The Push via Salt SSH feature uses a taskomatic job to execute scheduled actions using salt-ssh . The taskomatic job periodically checks for scheduled actions and executes them. While ontraditional clients with SSH push configured only rhn_check is executed via SSH, the Salt SSHpush job executes a complete salt-ssh call based on the scheduled action.

8.4.6 Known Limitation

OpenSCAP auditing is not available on Salt SSH minions.

Beacons do not work with Salt SSH.

Page 55: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

46 For More Information SUSE Manager 3

Installing a package on a system using zypper will not invoke the package refresh.

Virtual Host functions (for example, a host to guests) will not work if the virtual hostsystem is Salt SSH-based.

8.4.7 For More Information

For more information, see

https://wiki.microfocus.com/index.php/SUSE_Manager/SaltSSHServerPush

https://docs.saltstack.com/en/latest/topics/ssh/

8.5 osad

The default contact method between SUSE Manager and its clients is rhnsd . When usingthe rhnsd daemon the server will check every 4 hours and then execute a scheduled actionon clients. Depending on your network environment rhnsd may not suit your requirements.Alternatively you may configure osad for use with registered client systems enabling immediateexecution of scheduled actions. osad consists of three components:

osad.  A client-side service that responds to pings and runs mgr_check when directed by theosa-dispatcher running on SUSE Manager.

osa-dispatcher.  A service running on SUSE Manager that checks the database to determine if aclient running osad needs to be pinged or is required to run mgr_check , then sends a messagetelling the client to do so.

jabberd.  A daemon that runs on SUSE Manager and uses the XMPP protocol. osad and osa-dispatcher both connect to this daemon. jabberd also handles authentication when usingosad.

The following figure represents the osad contact method. All items left of the osa-dispatcherblock represent running processes on the client.

Page 56: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

47 Configuring and Enabling osad SUSE Manager 3

FIGURE 8.5: OSAD CONTACT METHOD

HOW IT WORKS

On SUSE Manager the osa-dispatcher periodically runs a query which checks to see ifthere are any clients overdue for a ping.

If an overdue client is found, a message is sent via jabberd to the osad instances runningon all clients registered with your SUSE Manager server. The osad instances respond tothe ping through the jabberd deamon running in the background on your SUSE ManagerServer. osa-dispatcher receives the response, and marks the client as 'online'.

If osa-dispatcher fails to receive a response from an osad instance in a certain amountof time, the client is marked 'offline'.

osa-dispatcher also periodically executes a select on the database to check all SUSEManager clients which have actions that need to be executed. If an action is found, amessage is sent through jabberd to osad which then executes mgr_check on the client.mgr_check then takes over performing the actual action.

8.5.1 Configuring and Enabling osad

The following procedure enables use of osad with SUSE Manager.

Page 57: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

48 Configuring and Enabling osad SUSE Manager 3

Important: Enabling SSLFor this communication method to work SSL is mandatory. If SSL certificates are notavailable, the daemon on your client systems will fail to connect. Make sure your firewallrules allow for the required ports. See:Table 2.1, “Required Server Ports”.

PROCEDURE 8.3: ENABLING OSA-DISPATCHER ON SUSE MANAGER AND OSAD ON CLIENTS

1. On your SUSE Manager server use the following command as root to start the osa-dispatcher service:

rcosa-dispatcher start

systemctl start osa-dispatcher

2. Install the osad package on all client systems to allow communication to the osa-dispatcher on SUSE Manager. The package can be found in the Tools child channel. Formore information about child channels, see Book “Reference Manual”, Chapter 5 “Channels”,

Section 5.1.2 “Child Channels”.

Warning: osad conflicts with osa-dispatcherDo not install the osad client package on your SUSE Manager server. The osadclient service conflicts with osa-dispatcher server package.

3. Once osad has been installed, start the service on your client systems as root using thecommand:

rcosad startsystemctl start osad

Like other services, rcosa-dispatcher and rcosad accept stop, restart, and status commandsas well.

This feature depends on the client systems recognizing the fully qualified domain name (FQDN)of SUSE Manager. The client systems use this name and not the IP address of the server whenconfiguring the YaST Online Update.

Now when you schedule actions from SUSE Manager on any of the osad enabled systems, thetask will be carried out immediately rather than after a client checks in using rhnsd .

Page 58: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

49 osad Configuration and Logging Files SUSE Manager 3

8.5.2 osad Configuration and Logging Files

Each component of osad is configured via local configuration files. Changing default parametersis not recommended. For reference the configuration files and logs are found in the followinglocations.

osa-dispatcher. osa-dispatcher is configured via the rhn.conf file located on the SUSE Managerat:

/etc/rhn/rhn.conf

All parameters for configuring osa-dispatcher are located under the section heading:

# OSA configuration #.

osad.  osad configuration files are located on all SUSE Manager clients at:

/etc/sysconfig/rhn/osad.conf/etc/syseconfig/rhn/up2date

For troubleshooting osad the log file is located in:

/var/log/osad

The location of this log file is configurable via the osad.conf file.

jabberd.  Configuration of jabberd goes beyond the scope of this document. The jabberd log fileis located at:

/var/log/messages

This concludes osad configuration and logging.

Page 59: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

50 What's Covered Here? SUSE Manager 3

9 Advanced Patch Lifecycle Management

9.1 What's Covered Here?

This chapter describes how to setup and configure a SUSE Manager testing implementation toenable companies in the delivery of these often requested features:

Automatic creation and archive of patch sets by quarter (or any other time period)

Consistent method of patch promotion and delivery through numerous landscapes andenvironments

Exception process for handling patches that need to be excluded from a patch cycle

Environment creation with historical patch sets

Minimal need for host channel subscription manipulation from cradle-to-grave

Support for service-pack migration using custom child channels

Provides a foundation for using multiple organizations to maintain systems.

9.2 Assumptions

A fresh installation is not required but some assumptions are made. You have a working SUSEManager environment, with a few registered clients, and a decent knowledge of SUSE Managerterms and capabilities. If you are unfamiliar with these terms or do not have a current workingsetup, see the: Book “Getting Started”, Chapter 1 “What is Covered?”

Note: spacecmd and XMLRPC ExamplesUsing advanced features such as spacecmd or XMLRPC API will be explained in somedetail, but will not be exhaustive. Code examples will be included at the end of thischapter which may be modified or used as-is. These come with no WARRANTY andshould not be expected to run with every implementation. Always test before running anyexamples in production.

Page 60: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

51 Patch Lifecycle Management Overview SUSE Manager 3

9.3 Patch Lifecycle Management OverviewKeeping systems patched and secure remains one of the greatest ongoing challenges whichyou will face as an administrator. Both proprietary and open-source companies are constantlyworking to provide updates which fix flaws discovered within their software products.

Adding to these pressures are requirements imposed by compliance initiatives such as:

PCI-DSS (Payment Card Industry Data Security Standard)

SOX (Sarbanes-Oxley)

HIPAA (Health Insurance Portability and Accountability Act)

FIPS 140 (Federal Information Processing Standard)

Included in most of these standards are rules which dictate frequency and time frames requiredfor patching and often these schedules are modified due to the severity level of a specific patch.

Businesses depend upon a changing landscape of applications covering a wide range of computeinfrastructure. These may include physical and virtual hosts and have complicated applicationstacks.

These applications may require the following:

A specific kernel version

Strict uptime requirements

Specific run-time environments, (like Java)

Specific Linux OS release

Specific configuration requirements

Hardening and platform requirements

Specific software versions

Additionally, many companies have created duplicate host environments such as:

Production (PROD)

Development (DEV)

Page 61: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

52 Important Terminology SUSE Manager 3

Quality Assurance (QA)

User-acceptance/Testing (UAT)

These landscapes mirror production environments and allow for testing or validation of appliedchanges to a system or set of systems. This means that you are required to manage, patch andreport on at least one more complete set of hosts.

9.3.1 Important Terminology

The following paragraphs provide an explanation of important terms used throughout thischapter.

Landscape.  Describes one of several groups of Linux hosts. This is commonly used withenterprise software deployments as a way to define the role/quality of a host. Examplesinclude, production (PROD), development (DEV), quality-assurance (QA), user-acceptance/testing (UAT), etc.

Environment.  Defined as a physical separation of Linux hosts, like Corporate (CORP), or Store(STORE), or NPE (Non-production Environment).

Organizations.  Defined as a separate management environment placed under the defaultorganization which is created during initial installation of a SUSE Manager Server. Organizationsin SUSE Manager will typically have separate credentials required to administer them via theWebUI and any Linux hosts managed by SUSE Manager will be registered to a single organizationand only visible to this organization.

9.4 Example Scenario

The Chameleon Corporation.  The world’s largest reptile and amphibian pet store whoseheadquarters are located in Yemen. This corporation has more than 1500 stores operatingunder the names LizardsRUs, UnVeiledInc and Chameleo-rama in five different countries. Dueto compliance constraints, their patch lifecycle (both timing and delivery) is based on theircorporate security policies, host environments, landscapes, and future management needs. TheChameleon Corporation must maintain the following requirements for managing patch andsecurity updates to their Linux hosts:

Page 62: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

53 Implementation SUSE Manager 3

REQUIREMENT SUMMARY

The published Security Policy states: "All Linux systems need to be up-to-date with thelatest available updates, bug-fixes and enhancements on a quarterly basis."Quarters are defined as:

Q1: January 1st through March 31st

Q2: April 1st through June 30th

Q3: July 1st through September 30th

Q4: October 1st through December 31st

The published Security Policy also states the need to patch all Linux systems with “critical”security updates (CVSS score of 7 or greater) within 1 month of release of the patch. Thisintroduces a second schedule that may overlap any existing patch roll-out.

The company has 3 different host environments, Corporate, Store and NPE.These arepartitioned using SUSE Manager Organizations. Each SUSE Manager Organization hasvisibility into the default SUSE Manager Organization’s software channels due to trusts,yet the managed hosts are naturally grouped and managed by their environment.

There are at least 3 landscapes in each environment, PROD, DEV, and UAT.

A “patch exceptions" process exists, as there is often a need to account for the removalof patches (e.g. kernel updates) from a roll-out. Some hosts may have hardware driversor third party software for example which depend upon specific kernel versions. Thisexception process would be handled on a case-by-case basis.

9.5 ImplementationTo review, you need to configure SUSE Manager, creating a set of procedures, processes ortools (scripts) to help with your patch lifecycle management. This includes the creation (andoptimally an “automatic” creation) of patch archive channels from the SUSE provided “updates”channels for the versions of SLES you use. These patch archives will be the sources for yourpatch promotions, but can also be a source to setup testing environments based on a patch setrolled out in the past. This could be used to troubleshoot an error condition for example, bycreating a lab full of hosts patched up to any previous patch set. You may also demonstrate andvisualize a clear view of compliance defined by a time-stamped set of patches.

Page 63: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

54 Implementation SUSE Manager 3

You also will create a set of software channels which will be updated when you need to roll themout. Each landscape should receive these updates only from a previously “validated” landscape.This means a landscape patch set will first get put into DEV, tested, then move to QA, undergotests and finally be moved into the PROD landscape. This process will begin anew each quarter,and you will handle exceptions if and when they occur.

Every exception will be tracked by another established process with the constant goal of re-mediating any exception and making sure the patch is reintroduced as quickly as possible inorder to ensure a clear view of compliance.

Other interruptions to a quarterly roll-out might be the release of a “critical” security patch thatneeds to be deployed more rapidly than once-a-quarter. In order to handle this extra schedule,you will need to create an addition channel for any critical patches to track them and their roll-out. Critical patches should be considered any CVE that has a CVSS score of 7.1 or greater, orotherwise be mandated by your corporate security organization.

For this implementation you will use two different SLES versions, SLES 11 SP3 and SLES 12.You will plan to use SUSE Manager to assist with your service pack migrations, so setting up toaccount for SLES 11 SP4 initially would be ideal. We also maintain both 32-bit and 64-bit Intel/AMD architecture versions of SLES 11 SP3 so we will need to account for both of them.

There are 2 different environments we need to manage, Corporate (CORP) and Store (STORE).We have created separate SUSE Manager Organizations to allow our systems administrators anexclusive view of the hosts they are responsible for. Each SUSE Manager Organization has the3 landscapes (DEV, QA and PROD) that they use for patch testing and promotion.

Activation keys and bootstraps should be created for each SUSE Manager Organization (eachenvironment) and each landscape so that hosts can be registered into their appropriate, andmost likely, permanent role. For example, a bootstrap script will register a SLES 11 SP3 (64bit)DEV host into the correct organization and will add the appropriate base and child channelsthat should never have to be manipulated again.

Automation is preferred. As mentioned, the use of scripts or scheduled jobs would greatlyenhance this solution and make it easier for support staff.

Page 64: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

55 Base Channels and Architecture SUSE Manager 3

9.6 Base Channels and Architecture

This represents a high-level outline of the architecture and channels:

Note: Base Channel NamingAny Base channel listed can also be a clone tree of the SUSE vendor channels thereforeshould include a prefix in the name. A good base channel name can aid the handling ofservice pack migrations described during channel creation.

SUSE Manager Organization

Default(Main) - 1

32 Bit Archive Channels (Public)

Q2 - 06-30-2016 - SLES 11 SP3 Updates for i586

Q3 - 09-30-2016 - SLES 11 SP3 Updates for I586

64 Bit Archive Channels(Public)

Q2 - 06-30-2016 - SLES 11 SP3 Updates for x86_64

Q3 - 09-30-2016 - SLES 11 SP3 Updates for x86_64

Q2 - 06-30-2016 - SLES 12 Updates for x86_64

Q3 - 09-30-2016 - SLES 12 Updates for x86_64

Clone Sets or Child Channels within SUSE Base Channels:

Base : SLES 11 SP3 Pool for i586

DEV - Current Patch Set - SLES 11 SP3 Updates for i586

QA - Current Patch Set - SLES 11 SP3 Updates for i586

PROD - Current Patch Set - SLES 11 SP3 Updates for i586

Patch Exceptions (DO NOT SUBSCRIBE) - SLES 11 SP3 i586

Security ASAP Exceptions - SLES 11 SP3 i586

Page 65: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

56 Base Channels and Architecture SUSE Manager 3

Base : SLES 11 SP3 Pool for x86_64

DEV - Current Patch Set - SLES 11 SP3 Updates for x86_64

QA - Current Patch Set - SLES 11 SP3 Updates for x86_64

PROD - Current Patch Set - SLES 12 Updates for x86_64

Patch Exceptions (DO NOT SUBSCRIBE) - SLES 12 x86_64

Security ASAP Exceptions - SLES 12 x86_64

Base : SLES 12 Pool for x86_64

DEV - Current Patch Set - SLES 12 Updates for x86_64

QA - Current Patch Set - SLES 12 Updates for x86_64

PROD - Current Patch Set - SLES 12 Updates for x86_64

Patch Exceptions (DO NOT SUBSCRIBE) - SLES 12 x86_64

Security ASAP Exceptions - SLES 12 x86_64

Patch Exceptions Channels (as above)

Per Base Channel - 1 channel for each “Updates” channel:

Examples:

Patch Exceptions (DO NOT SUBSCRIBE) - SLES 11 SP3 i586

Security ASAP Exceptions - SLES 11 SP3 i586

Corporate (CORP) - 2

Any public channel will be visible here

Private channels can be shared per-organization

Store (STORE) - 3

Page 66: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

57 Automation and Process Design SUSE Manager 3

Any public channel will be visible here

Private channels can be shared per-organization

9.7 Automation and Process Design

Automation will include automatic channel clone creation for the Archive channels. To best suita particular company’s use-cases and product usage, a combination of scripts (cron and bash)and a configuration file will be used. The archive creation will be triggered by a custom cron jobas follows. Criteria for dates will determine the exact setup. For example, a quarterly schedulecould be implemented based on the first or last day of a given quarter. If the trigger time is theEND of a quarter, it would have to consider day 30 on the 3rd and 9th months of a calendar(March and September), and day 31 on the 6th and 12th months (June and December). Thiswill require 2 crontab entries such as (cron syntax):

0 0 30 6,9 * /path/to/archive-create-script 0 0 31 3,12 * /path/to/archive-create-script

If the trigger for the quarter is going to happen on the 1 st of a month, then only onecrontab entry would be required, for example:

0 0 1 1,4,7,10 * /path/to/archive-create-script

The actual “archive-create-script” will also need logic in it to determine the quarter it was runand formatting logic to provide the correct syntax for SUSE Manager channel cloning, etc. Thescript should also loop through each architecture and SLES version in order to make a full setof archives based on the company’s choices.

Processes for patch promotion will be created so that administrators can precisely and explicitlydefine when a patch set is moved into a given landscape, and just as importantly - from where.The easiest method to do this is using a script that leverages the XMLRPC API exposed inSUSE Manager. The API contains a softwareChannel method called mergePackages andmergeErrata . These two methods can be called with a source channel and target channel toquickly take content from one channel and merge the differences into another.

Page 67: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

58 Patch Promotion Cycle SUSE Manager 3

The last process will define a work-flow for removing a patch from the promotion process andmake sure it is stored for tracking purposes. These patch exceptions can later be reintroducedto a patch roll-out calendar as the reason for the exception is re-mediated. In addition to theexception process of removing a patch, there is a similar process for adding a patch as anemergency dictates.

Emergency patches will likely always be available in the current SUSE Updates channels, butmight not have been introduced into an archive channel yet. As the quarterly archive channelcreation job is triggered, any available patches would be part of an archive set but for a givenpoint in time, this might have occurred before the patch was released or it may be up to 3months until a new archive is created that contains this recent patch. A method for searchingand then copying a patch into a target channel will need to be created. This will handle thosetimes when a critical patch is released by SUSE but your archive channel will not be providedwith a copy until the quarter is up.

Copying these emergency patches into place does not affect the normal deployments or creationof archive channels. The next archive channel creation will also contain this patch, and the useof an emergency patch channel with a duplicate patch (in the case of merging the same patchlater) will not cause any conflicts with a system that already has installed it.

For more information see also: Section 9.9, “Exception and Escalation Channels”

9.8 Patch Promotion Cycle

Understanding how patches (and the packages they include) are obtained from SUSE, wherethey go after download, and how they are arranged within SUSE Manager is key to properconstruction of the Advanced Patch Lifecycle system. By default, SUSE Manager arranges itschannel sets by a particular version and architecture of SUSE Linux Enterprise Server and itsextensions.

For example, a base set of channels within SUSE Manager for SLES 11 SP3 x86_64 includes theparent or base channel called a “pool” channel. This channel contains packages that are thefunctional equivalent of the installation DVD for SLES 11 SP3 64-bit. Under this pool channelare all of the “child” channels which include a channel for the SUSE Manager Client packages,called SUSE Manager Tools channel, and an updates channel called in this case, SLES 11 SP3Updates for x86_64.

Page 68: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

59 Patch Promotion Cycle SUSE Manager 3

A normal set of channels that a managed host subscribes to will include at least a parent channel(pool), a SUSE Manager Tools channel, and an Updates channel. In some cases like SLES 11 SP2- this will include the SLES 11 SP1 Pool, the SP1 Updates channel, the SP2 Core channel, SP2Updates, SP2 Extension Store and the SP2 SUSE Manager Tools channel.

Note: Long Term Service Pack Support (LTSS)Due to SP1 and SP2 both being in their LTSS (Long Term Service and Support) phase,there are no longer any non-LTSS updates being created from SUSE. This means that anySP1 or SP2 hosts a company will need to purchase LTSS and use LTSS Updates channels inorder to receive further patches and support. For more information see: www.suse.com/

lifecycle

FIGURE 9.1: PATCH PROMOTION PROCESS

Page 69: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

60 Exception and Escalation Channels SUSE Manager 3

9.9 Exception and Escalation Channels

There may be several reasons to delay or remove a patch from a deployment cycle. A patchcould cause issues with the stability of a system or systems, or perhaps it has not passed a testingcycle from the current or previous landscape.

There may also be a reason to deploy a critical patch (one that patches a security vulnerabilityor a debilitating bug) ahead of schedule. Due to the critical nature of the patch, it will need togo through testing and deployment as quickly as possible. A critical patch should not appliedon the next quarterly patch cycle.

In order to handle the periodic removal or addition of these exception patches, processes shouldbe created to track them appropriately. While these exceptions are being tracked, they will becopied into their own channel containers for safe-keeping, accounting and reporting.

These channels can be created within the Archive base channel or within the cloned base channelfor the version of SLES that corresponds to the patch exception (recommended).

The process for excluding a patch will be to first copy the patch (and associated packages) intothe Exception Channel, and then to remove the patch (and associated packages) from the currentdeployment landscape. Optionally it can be removed from the current quarter’s archive channelbut it is important to realize that the patch will be included in the following quarter’s archiveas well. It might be tempting to remove it from the SUSE Updates channel, but this can oftenlead to a mishandling or misreporting of compliance. It is much better to track and resolve thereasons for the exception in the first place. This way, the patch can be reintroduced to the patchdeployment workflow and remediate any potential security issues or code flaws that the patchwas created to fix.

Security Escalation Channel and Process.  The process for adding a security patch is similar tothe process of excluding one. The key difference is that the patch needs to be copied into theSecurity Exception Channel from either the SUSE Updates channel or the latest archive if it hasbeen created but not used for a promotion cycle yet. Assuming that this new critical securitypatch has been released in the middle of a rollout phase (you have already been promoting thecurrent quarter’s patches and this new one comes out), it is likely that this new patch has notyet appeared in an archive.

Another assumption is the need to test this new patch by promoting it through the landscapesas any normal patch set, but if necessary it can be copied directly to any stage. Simply copythis security patch into the initial landscape (for example: DEV - Current) and follow the normal

Page 70: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

61 Components to be Created SUSE Manager 3

deploy-test-promote cycles to get it into production. Depending on the critical nature of thepatch, the normal schedule for testing could be accelerated or in rare cases bypassed altogetherassuming acceptable risk.

9.10 Components to be CreatedThe following list provides an overview on what you will be creating to enable Advanced PatchLife-cycle Management:

CHANNELS

Archive channels

Current updates channels

Exception channels (patch exclusions or security-ASAP)

Optional SP-Migration clone set

ACTIVATION KEYS AND BOOTSTRAP SCRIPTS

Per-Organization, Per-SLES version activation keys

SCRIPTS

Archive creation script

Archive sources list control file

Merge Tool python script

CRONTAB ENTRIES AND AUTOMATION

Quarterly (or any other frequency) archive creation call

9.11 ChannelsSeveral custom channels will be created to support the patch promotion process. These channelswill store the archives (created as clones of the SUSE Updates channels) and they will also storeexception patches. For each landscape a custom channel will be created to hold patches whichhave been promoted. These channels will grow in size over time as patches are promoted eachcycle.

Page 71: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

62 Creating Archive Channels SUSE Manager 3

Each new patch cycle updates the available patches in a given landscape’s “current updates”channel. In this way each subsequent patch promotion adds the new updates and these can beapplied to any hosts subscribed to the channel.

The exception channels will be populated by managing individual patches, copying them fromone of the landscape updates channels or from one of the archive channels. Once a patch iscopied successfully into an exception channel, it can be removed from an updates channel oran archive.

9.11.1 Creating Archive Channels

Custom channels are created in SUSE Manager as “new”, blank and empty channels, or “clones”.Technically, cloned channels can also be created as empty, but in this case we will create thearchive channels with content sourced from the SUSE Updates channel, the patches and thepackages they reference.

Each archive channel will reside within an empty base channel. Base channels will be createdfor each processor architecture managed by SUSE Manager, for example:

IA-32

x86_64

s390x

PPC

Multiple archives matching the different versions of SLES may exist in the base channel, butthey will all be of the same processor architecture.

Important: Channel NamingFailing to label the following channels appropriately will cause the example archive scriptto fail unless modified.

Note: Note on Base/Parent ChannelsThe archive channels you are creating have no parent because they are parent/basechannels.

Page 72: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

63 Creating Archive Channels SUSE Manager 3

PROCEDURE 9.1: CREATE THE BASE ARCHIVE CHANNELS

1. For each processor architecture used by hosts which are managed by SUSE Manager, createempty channels named: 32 Bit Archives Channel and 64 Bit Archives Channel

2. In the Web UI click Channels Manage Software Channels then click the + Create Channelbutton.

3. The channel label must be in the format of architecture-patch-archives-channel , forexample the 64-bit channel label should be:

x86_64-patch-archives-channel

4. Select the appropriate architecture for this channel - x86_64 for 64-bit, and IA-32 for 32-bit, etc.

5. Under the Channel Access Control heading select the radio button with the description:This channel is public and may be accessed by any of the trusted organizations trustedby this organization.

6. Repeat this procedure for each architecture type of SLES you need deployed

The following procedure will guide you through creating clone channels for each version ofSUSE Linux Enterprise being used.

PROCEDURE 9.2: CREATING THE CLONED ARCHIVED CHANNELS

1. From the WebUI click Channels Manage Software Channels then click the Clone Channelbutton.

2. Select the SUSE vendor channel of the SLES version you need to create and use for yourupdate archive source.

3. Select the radio button for all content/patches

4. Name the channel appropriately with an indication of Time/Date and what the archivecontains e.g. Q3 - 09-30-2015 - Archive of SLES 11 SP3 for x86_64

5. Create a label using proper syntax - e.g. “q3-09-30-2015-archive-sles11sp3-x86_64”

6. Include an appropriate description of the channel in the Summary and Description fields

7. Click the Create Channel button when finished

Page 73: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

64 Service Pack Migration Support with Update and Exception Channels SUSE Manager 3

8. Scroll down and select the Public radio button and then click the Update Channel button.

Repeat this process for each version of SLES within architecture.

Note: spacewalk-clone-by-dateYou can Use spacewalk-clone-by-date to create archive channels from the past. See: foran example source file that can be used with the spacewalk-clone-by-date utility. Thisconfiguration file can be used to create a clone channel with a certain date range as afilter for the content in the channel:

The utility is called with the following syntax: spacewalk-clone-by-date -c <configfile>

Repeat for each archive channel with a past date modifying the configuration filesto match the appropriate dates and channel source/target names.

9.11.2 Service Pack Migration Support with Update and ExceptionChannels

There are a couple of generally accepted methods to managing a set of channels that allowsconsistent and expected behaviors when leveraging the SP Migration feature. You can find thisfeature in the Software tab of a particular host - it allows you to update the service pack of aparticular host in a one-click fashion.

When using the patch lifecycle methods described in this document, some challenges arise whenusing the SP Migration feature. When you select a given host to do an SP Migration, the UIproposes (dictates) a set of mandatory “child” channels that will be subscribed to for a migrationaction. These mandatory child channels (greyed-out in the UI) will normally include the SUSEprovided Updates channel for a given SLES version. See the following image

Page 74: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

65 Service Pack Migration Support with Update and Exception Channels SUSE Manager 3

FIGURE 9.2: SERVICE PACK MIGRATION SUPPORT WITH UPDATE AND EXCEPTION CHANNELS

In order to allow usage of the patch lifecycle processes described here AND to use thefunctionality of SP Migrations, it is best to create a full clone-set of the SUSE Linux Enterpriseproduct versions in use at your company. This is sometimes called a clone-tree, and can be easilycreated using the spacecmd command, softwarechannel_clonetree .

A full clonetree will include the base/parent channel (normally called a pool) and all childchannels that currently exist beneath it. For example, using the SLES 11 SP3 Pool x86_64channel as a source, you provide your own prefix to the clonetree command and it will makea copy of the pool and all children adding the prefix to the beginning of all the channel namesand labels.

The following figure provides an example of the SUSE Linux Enterprise 11 SP3 x86_64 channelsand the cloned tree with prefix Chameleon_Co .

Page 75: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

66 Service Pack Migration Support with Update and Exception Channels SUSE Manager 3

FIGURE 9.3: EXAMPLE CHAMELEON_CO CHANNELS

The command spacecmd softwarechannel_clonetree can be called directly by providing thesource and prefix information directly or interactively by calling the command from within thespacecmd shell itself:

spacecmd -u SMadmin -- softwarechannel_clonetree sles11-sp3-pool-x86_64 -p “my_company-“

This will create a set of SLES 11 SP3 x86_64 channels with a prefix (my_company).

Repeat this process for each SLES version and then when using the Service Pack migrationfeature you may select your company version of the target SLES version and choose the childchannels appropriate for the landscape the host is in (described below).

You can then modify the cloned Updates channel by removing all patches/packages - then usethe merge script process to merge your “Current Patch Set” into the mandatory updates channel.This way you are able to do Service Pack Migrations and still retain your currently promotedpatch set. Otherwise, SP Migrations will always update to whatever is the latest packages in the“mandatory” Updates child channel.

Page 76: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

67 Current-Updates Channels SUSE Manager 3

Consider the following Image that shows the Q3 Patch Archive for SLES 11 SP4 with 227packages, the SUSE Updates channel for SP4 with 234 packages, and the Chameleon_Co versionof SP4 Updates with 0 (zero) packages:

FIGURE 9.4: PATCH ARCHIVE AND UPDATE CHANNELS

In the following sections we will describe the creation of custom Current Updates channelsand how to use a Merge script (also detailed below). For SP migrations using your own setof promoted patches, you would merge a Current Patch Archive from a Production channelinto the Updates channel so it will be used for migration efforts or simply leave the Updateschannel permanantly empty and add your Current Updates channel to the Optional Child Channelsselection.

With an empty Updates channel and a populated “Current Updates”, you can be assured of anSP Migration working as expected and not patching the machine to a version of packages morecurrent than whatever is deemed “production.” The custom “updates” channels and the mergescript process will be described in detail in the following sections.

9.11.3 Current-Updates Channels

Now create the current updates channels that managed hosts will subscribe to depending on theirlandscape, for example, DEV - Current Updates for SLES 11 SP3 x86_64, or PROD - Current Updates- for SLES 12 x86_64. There will be a full set of landscape channels for each SLES version andthey will all be empty to begin with so we will create a “new” and then optionally “clone” thatone to reduce the amount of typing needed:

PROCEDURE 9.3: CREATING THE CURRENT UPDATES CHANNELS

1. From the Channels Manage Software Channels click +Create Channel.

Page 77: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

68 Exception Channels SUSE Manager 3

2. Create the channel within one of the SLES Pool Channels or within your own clone set pool.

3. Modify the channel to be Public.

4. Clone this new channel (without updates) into the remaining Landscapes. Each channelas a Current Updates channel, and each with the appropriate landscape prefix (e.g. DEV,TEST, PROD , etc.)

FIGURE 9.5: UPDATES CHANNELS

This procedure guided you through creating a full set of landscapes for each SLES version to bemanaged. Keep in mind for the SLES 11 SP1 and SP2 channels this will result in a full set 2xor even 4x with LTSS. However, SP1 and SP2 Update channels are no longer updated so thesecould be subscribed as static channels.

9.11.4 Exception Channels

Now create the 2 exception channels for each SLES version being managed. While it may bepossible to create a mixed channel that is unique to architecture (like the archive channel base),tracking which distribution a patch exception has come from can get cumbersome. If you mixpatches/packages from different versions of SLES, it is more difficult to track, resolve and then

Page 78: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

69 Exception Channels SUSE Manager 3

reintroduce these patches back into the patch workflow. It is much easier to place them into anexceptions channel specifically for the version of SLES the patch came from. Create the PatchException and Security ASAP Exception channels as follows:

Note: Exceptions Channel SubscriptionIt is recommended to add the text DO NOT SUBSCRIBE to the Patch Exceptions ChannelName field during creation. Keep in mind that this channel is used only as a bucket totrack patches/packages that will not be installed on a system. If systems subscribe tothis channel they will see available content and therefore potentially apply it during apatch installation. The DO NOT SUBSCRIBE text acts as a visual reminder when creatingactivation keys or manipulating a hosts channel subscriptions preventing you from addingit to a hosts active channels.

PROCEDURE 9.4: CREATING EXCEPTION CHANNELS

1. From the Channels Manage Software Channels click +Create Channel.

2. Create the “Patch Exceptions - DO NOT SUBSCRIBE” channel within one of the SLES PoolChannels or if you have your own clone set within that pool. This channel will reside nextto your Landscape channels.

3. Modify the channel to be Public.

4. Create the Security ASAP Exception channel as above - it too will reside next to yourLandscape and Patch Exceptions channels.

Keep in mind for SLES 11 SP1 and SP2 - they reside in the same SP1 Pool base channel, so therewill be Exceptions and Security Exceptions Channels for each Service Pack.

FIGURE 9.6: EXCEPTION CHANNELS

Page 79: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

70 Activation Keys and Bootstrapping SUSE Manager 3

9.12 Activation Keys and Bootstrapping

Normally you should create a set of Activation Keys each assigned to a specific version of SLESthat your hosts are installed with. There may be other characteristics assigned in your keyslike System Groups, assorted Child Channels, Software Packages, etc. You may also chooseto modify your existing Activation Keys and reuse them, or you can create new keys for thisimplementation. This example assumes a new key.

PROCEDURE 9.5: ACTIVATION KEY SETUP

1. From the Systems Activation Keys click +Create Key.

2. Create the Activation Key within this Organization (remember to log into otherOrganizations to create keys there if needed). Assign the appropriate Entitlements andSoftware Packages and Configuration Channels as appropriate.

3. Name the Activation Key according to the Landscape host will register to with this key.For example:

FIGURE 9.7: CREATE ACTIVATION KEY

Page 80: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

71 Activation Keys and Bootstrapping SUSE Manager 3

4. Click on the Child Channels Tab and assign the appropriate Current Updates channel tothe Landscape this key will be used for:

FIGURE 9.8: LANDSCAPE KEY

Page 81: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

72 Scripts SUSE Manager 3

5. Select the appropriate SUSE Manager Tools channel as well as the other needed channelsto fill out the requirements for the version of SLES in question.

Note: Security ASAP ExceptionsThe Security ASAP Exceptions channel is selected as an active child channel, and thePatch Exceptions (DO NOT SUBSCRIBE) channel is NOT selected. This is important as anypatch/package copied into the Patch Exceptions channel should remain invisible to hostswhile patches/packages copied to the Security ASAP Exceptions channel should alwaysbe immediately visible to a host.

The Activation Key is called by a bootstrap script, often there is a one-to-one relationshipbetween a registration bootstrap script and an activation key. Whether new activation keyswere created or existing ones were modified to point to the landscape specific “current updates”channels, there should be a bootstrap script that calls that activation key.

All new hosts will use these bootstraps to register and become managed by SUSE Manager. Oneof the key benefits is that they should never need to change their channel assignments as thehost will now be assigned to its proper landscape update channels and will receive new updatesas they are promoted each patch cycle.

9.13 Scripts

9.13.1 Patch/Package Merge Script

The Patch/Package Merge Script is used to Promote patches (and relevant packages) from onechannel to another. It is used at first to merge content from an Archive channel into the firststage (landscape) e.g. DEV. It is then used to promote content from one stage to the next untilthe content reaches the final stage. This process is then repeated for each version of SLES (like11 SP1, SP2, etc.) and each corporate environment (like STORE, CORP, etc.).

Finally, the entire process is repeated for each patch calendar cycle (quarterly/monthly/etc.).

Page 82: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

73

Channel Archive Creation Script / Channel Archive Sources List Config File SUSE Manager

3

9.13.2 Channel Archive Creation Script / Channel Archive SourcesList Config File

This script and its associated “sources list” configuration file are called either manually or bya crontab entry. The script uses the sources list file to determine which versions of SLES andwhich architectures to create archives for. As previously described, the Archive Channels arecreated as point-in-time clones of the various SLES Updates channels.

To have the correct archive channels created, add lines to the sources file. Each line has 3 fields,the first being the architecture, the second is the source channel, and the third is target channeltext. The script parses the source list and constructs the target parent channel for the archivesby architecture, and then constructs the target channel and label, etc.

The script calls the spacecmd functions softwarechannel_clone andsoftwarechannel_setorgaccess for each entry in the sources list. It then calculates thecurrent calendar quarter, creates the archives and makes these archives publicly visible. See theAppendix for the entire script.

9.14 Crontab Entries and Automation

A decision needs to be made whether a calendar quarter is going to be created (lookingbackwards) at the end of a particular month, or at the beginning of a month (one day pastthe final day of a quarter). Since the Archive Channels are being created by cloning the SUSEUpdates channels of a particular SLES version, the decision can affect the content.

Either way is fine as it will be consistent from quarter to quarter. For the purposes of explainingthe cron syntax, we will opt to show the more difficult of the two how to call the archive scriptat the end of the quarter. This is more difficult because it requires two cron entries to handleboth the 30th of the month (for June and September), and the 31st of the month (for Marchand December).

The crontab entries will point to the archive creation script and execute in months 3, 6, 9 and12. Here are what the cron entries look like:

0 0 30 6,9 * /path_to/the/archive/script0 0 31 3,12 * /path_to/the/archive/script

The path will point to the actual archive-channel-create-script.sh (or similar). This could beplaced in /usr/sbin/ and must be made executable chmod +x

Page 83: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

74 Use Cases and Workflows SUSE Manager 3

Also it is very important to note that this script in calling spacecmd commands from withina bash shell script. Spacecmd is itself a python-based shell that can be invoked - allowing theuse of an extensive set of commands within the shell, or from outside the shell as a mediatedcommand interpreter.

The invocation of spacecmd stores a .spacecmd directory in the users home directory. Withinthe .spacecmd directory is a config file which can store credential sets that can be leveraged inorder to keep from being prompted at spacecmd execution. This can be used to store credentialsso the cron job will execute and not pause waiting for authentication credentials to be passed.

Edit the /root/.spacecmd/ config file and add the appropriate credentials:

[spacecmd]server=localhostusername=adminpassword=suse1234nossl=0

Storing these credentials will allow spacecmd operations from the SUSE Manager’s root user tobe executed without the need to pass a username or password allowing the cron job for archivecreation to run without failure at the appropriate time.

9.15 Use Cases and Workflows

This section describes an approach to patch lifecycle management that leverages SUSE Managerto allow deliverance of the following benefits:

Automated creation of Patch Archive Channels

These channels can be created on a quarterly (or more frequent) basis and allowsan organization to create test environments based on a historical set of patches (i.e.creation of a lab using available patches from 2 calendar quarters ago.)

Leverage a static set of “current” update channels so host subscriptions don’t have tochange

Page 84: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

75 Workflow 1: Patch Promotion Process SUSE Manager 3

Using the API/scripts, updates can be merged from a patch “archive” into asubscribed host channel removing the need to constantly clone and re-clone channelsand modify host subscriptions

Multi-Landscape environments can use a promotion process to merge updatesthrough each phase during testing/validation of patch sets

Exception handling for patches that need to be excluded from a patch roll-out

Creation of a “patch exceptions” channel and a process for copying patches/packagesinto that channel (and then removing them from an updates channel) allows fortracking of patch exception. This channel should be excluded from any hostschannel subscriptions, thereby keeping all patch/package content from being visible/available for installation.

Patch exceptions “processes” must be developed in order to track remediation of allexceptions in order to avoid future complications from managing an ever-growingbucket of patches.

Security ASAP Exceptions handling for patches that need to roll out with a higher priority

The security ASAP exception channel should always be subscribed to (unlike the“patch exceptions channel). Subscription to this channel allows a host to obtainpatches/packages added in an ad-hoc manner, for example a security patch deemedimportant enough to deploy outside of a normal patch schedule. This could be copiedfrom a new archive or directly from one of the SUSE (vendor) updates channels.

9.15.1 Workflow 1: Patch Promotion Process

The following sections provide some example workflows for the patch promotion and exceptionprocesses. Keep in mind that these can be modified to fit more closely to a particular operationalgroup’s existing set of processes.

Review the Patch Promotion Process in the following table.

Page 85: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

76 Workflow 2: Patch Exception Process SUSE Manager 3

FIGURE 9.9: WORKFLOW 1: PATCH PROMOTION PROCESS

9.15.2 Workflow 2: Patch Exception Process

Reveiwed the Patch Exception Process in the following table. Again, keep in mind that these canbe modified to fit more closely with your particular operational group’s existing set of processes.

Page 86: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

77 Workflow 3: Security ASAP Exceptions Process SUSE Manager 3

FIGURE 9.10: WORKFLOW 2: PATCH EXCEPTION PROCESS

9.15.3 Workflow 3: Security ASAP Exceptions Process

The Security exception process differs from the previous patch exception process in that a patchis now being added into a patch rollout cycle, likely in the middle of a current (in-progress)rollout. A process table is included here as well as some images from the SUSE Manager WebUIto provide clarity.

Page 87: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

78 Workflow 3: Security ASAP Exceptions Process SUSE Manager 3

FIGURE 9.11: WORKFLOW 3: SECURITY PATCH ASAP PROCESS

Page 88: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

79 Workflow 3: Security ASAP Exceptions Process SUSE Manager 3

The following image provides and overview of adding a patch to the Security ASAP ExceptionsChannel, specifically the SLES 11 SP1 x86_64 version:

FIGURE 9.12: SECURITY ASAP EXCEPTIONS

The following image provides a view of the List/Remove function of a specific channel (in thiscase, DEV - Current - SLES11-SP1-LTSS-Updates for x86_64 and is the interface where apatch would be removed from a channel to keep it from being visible and potentially deployedas part of an exception process.

Page 89: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

80 Sample Scripts SUSE Manager 3

FIGURE 9.13: PATCHES LIST/REMOVE

9.16 Sample Scripts

This section contains scripts which will be useful for Advanced Patch Lifecycle Management.

9.16.1 Sample Spacewalk-Clone-By-Date Configuration

This sample is stored as a text-file. It is used with the spacewalk-clone-by-date utility by usingthe -c flag to indicate an input config file:

spacewalk-clone-by-date -c Q3-2015-sles11sp3-x86_64-archive.conf

Page 90: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

81 Sample Spacewalk-Clone-By-Date Configuration SUSE Manager 3

This sample, below is using the SUSE Manager administrator account name of SMadmin but canbe changed to meet the requirements of your installation. The config file is using an end-date of9/30/2015 and a source of the SLES 11 SP3 Updates for x86_64 and creating a clone inside thecc_patch_archives_channel_64bit base channel. The end result is a 3 Quarter patch archive thatfilters all available patches for SLES 11 SP3 64-bit, up to the date of 9/30/2015.

Note: Base Channel Source/Target Channel/ DirectiveThis specifies the following:

Base channel source: sles11-sp3-pool-x86_64

The target base channel: cc_patch_archives_channel_64bit

Uses directive: existing-parent-do-not- modify true

This tells the utility that a child channel from one base will be cloned into a completelydifferent base channel. Your channel names may differ therefore this example may needmodifications to work in your tests.

The following is an example from the Q3-2015-sles11sp3-x86_64-archive.conf .

{"username":"SMadmin","to_date": "2015-09-30","skip_depsolve":false,"security_only":false,"use_update_date":false,"no_errata_sync":false,"dry_run":false,"channels":[ { "sles11-sp3-pool-x86_64": { "label": "cc_patch_archives_channel_64bit", "existing-parent-do-not-modify": true }, "sles11-sp3-updates-x86_64": { "label": "09_30_2015_q3_archive-sles11-sp3-updates-x86_64", "name": "Q3-2015 Patch Archive - 09-30-2015 - SLES11-SP3-Updates for x86_64", "summary": "Q3 - 2015 - Patch Archive Set (9-30-2015) - SUSE Linux EnterpriseServer 11 SP3 x86_64", "description": "Q3 - 2015 - Patch Archive Set (9-30-2015) - SUSE Linux Enterprise

Page 91: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

82 Sample Patch/Package Merge Script Using Python SUSE Manager 3

Server 11 SP3 x86_64" } } ]}

Important: spacewalk-clone-by-date Utility Post ChecksWhen using the spacewalk-clone-by-date utility please review the channel patchcontent after creation to ensure that the channel contains the patches for the appropriateend-date. Sometimes extra patches are included in the channel that are in the wrong time-period and these may be deleted manually.

9.16.2 Sample Patch/Package Merge Script Using Python

This script has a defined SUSE Manager server URL set in the “MANAGER_URL” variable. Thescript prompts for a SUSE Manager Administrator ID and password. It then asks for a sourceand target channel. The script will then confirm the channels and ask if it should continue. Anaffirmative response (Y) will then allow the script to merge the patches and packages from thesource channel into the target channel.

#!/usr/bin/pythonimport xmlrpclibimport sysimport getpass

MANAGER_URL = "https://suma01.chameleoncorp.com/rpc/api"MANAGER_LOGIN = raw_input("Please Enter the SUSE Manager Login Name: ")MANAGER_PASSWORD = getpass.getpass("Please Enter the Password: ")

MERGE_SOURCE = raw_input("Enter the SOURCE channel label to Merge FROM: ")MERGE_TARGET = raw_input("Enter the TARGET channel label to Merge INTO: ")print("This tool is going to take all packages and errata from the SOURCE")print("Channel : " + MERGE_SOURCE)print("and merge it into the TARGET ")print("Channel : " + MERGE_TARGET)

def query_yes_no(question, default="yes"): """Ask a yes/no question via raw_input() and return their answer. "question" is a string that is presented to the user. "default" is the presumed answer if the user just hits (Enter).

Page 92: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

83 Sample Crontab Entries for Automation and Archive Channel Creation SUSE Manager 3

It must be "yes" (the default), "no" or None (meaning an answer is required of the user). The "answer" return value is True for "yes" or False for "no". """ valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False} if default is None: prompt = " [y/n] " elif default == "yes": prompt = " [Y/n] " elif default == "no": prompt = " [y/N] " else: raise ValueError("invalid default answer: '%s'" % default) while True: sys.stdout.write(question + prompt) choice = raw_input().lower() if default is not None and choice == '': return valid[default] elif choice in valid: return valid[choice] else: sys.stdout.write("Please respond with 'yes' or 'no' " "(or 'y' or 'n').\n")query_yes_no("Is this information correct?")

client = xmlrpclib.Server(MANAGER_URL, verbose=0)key = client.auth.login(MANAGER_LOGIN, MANAGER_PASSWORD)

client.channel.software.mergePackages(key, MERGE_SOURCE, MERGE_TARGET)client.channel.software.mergeErrata(key, MERGE_SOURCE, MERGE_TARGET)

client.auth.logout(key)

9.16.3 Sample Crontab Entries for Automation and ArchiveChannel Creation

Below are some sample cron entries that can be used to run the Archive Channel Creation Scriptresulting in channel creation for each quarter. This example has two entries in order to cloneall patches received up until the end of a quarter. A single entry could be used to create it atthe beginning of a quarter, but care must be taken to modify the calculations in the Archive

Page 93: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

84 Sample Archive Channel Creation Script SUSE Manager 3

Script to account for that. Currently the example Archive Channel Creation Script below figuresout what quarter it is by looking at the current date. Running the script in the 4 th quarter willname the archive created as a 4 th quarter archive.

Cron entries for end-of-quarter (e.g. 30th of months June and Sept. and 31st of months Marchand December):

0 0 30 6,9 * /path_to/the/archive/script0 0 31 3,12 * /path_to/the/archive/script

9.16.4 Sample Archive Channel Creation Script

The script below works with the Archive Channel Sources file (next appendix item) to createquarterly archives of the SUSE Updates channels. This example script is written in BASH butcalls spacecmd to accomplish the cloning and setting the new archive to be public (accessibleto other organizations).

The script takes some time to run - as the clone command finishes quickly, but the actual clonedchannel still takes some time to settle down before the org-access command can access/finish.So if you want to test this manually - you must be patient. A normal cron-type run of the scriptwill finish in due-time.

#!/bin/bash##################################################################### ## SUMa Archive Channel Creation Script - Called from Cron ## ###################################################################### ## This script creates quarterly archives of SUSE Manager ## channels from SUSE Updates channels. It takes a list ## of source channels from the archive-sources.lst file ## that should be located in the same directory as this ## script. Each entry in that file will be used as a ## source channel to create an archive for patches/updates ## in the appropriate archive channel. # # ## REQUIRES: ## 1. cron entries for each quarter: ## eg. 30th of months June and Sept. and 31st of months ## March and December: ## 0 0 30 6,9 * /path/to/this/script ## 0 0 31 3,12 * /path/to/this/script #

Page 94: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

85 Sample Archive Channel Creation Script SUSE Manager 3

# ## 2. archive-sources.lst: ## A list of the architecture, the source updates channel # # for each distro and the suffix of the target channel ## version and architecture (1 per line - no line-feed at EOF) ## EXAMPLE: ## S390x,sles11-sp3-updates-s390x,SLES11-SP3-Updates for s390x # # ppc64,sles11-sp4-updates-ppc64,SLES11-SP4-Updates for PPC ## x86_64,sles11-sp3-updates-x86_64,SLES11-SP3-Updates for x86_64 ## ###################################################################### ## Created by - Jeff Price, SUSE Consulting - 2015 ## ##################################################################### ## date stringsmonth=`date +%m`year=`date +%Y`fdate=`date +%m-%d-%Y`

## set quarterif [ $month -le 3 ]then quar=1elif [ $month -gt 3 ] && [ $month -lt 7 ]then quar=2elif [ $month -gt 6 ] && [ $month -lt 10 ]then quar=3elif [ $month -gt 9 ]then quar=4fi

## Create archives using source list

while read linedo arch=`echo "$line" | awk -F, '{print $1}'` src_ch=`echo "$line" | awk -F, '{print $2}'` trg_ch=`echo "$line" | awk -F, '{print $3}'`

## set archive channeltarget_parent=$arch"-patch-archives-channel"

Page 95: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

86 Sample Archive Channel Sources List File SUSE Manager 3

source_channel=$src_chtarget_channel_name="Q"$quar" "$year" - "$fdate" - Archive of "$trg_chtarget_summary="Q"$quar"-"$year" Archive Set "$trg_chtarget_channel_label="q"$quar"-"$year"-archive-"$src_ch

## Debug Outputecho "Architecture: " $archecho "Source Channel: "$src_checho "Target Channel Archive Suffix: "$trg_checho "Target Archive Parent Channel: "$target_parentecho "Source Channel (again): "$source_channelecho "Target Channel Name: "$target_channel_namelctn=`echo $target_channel_name|tr '[:upper:]' '[:lower:]'`echo "lowercase target name: "$lctnecho "Target Channel Label: "$target_channel_labelecho "Target Channel Summary and Description: "$target_summary

/usr/bin/spacecmd -d -- softwarechannel_clone -s “‘$src_ch’” -n“‘$target_channel_name’” -l “‘$target_channel_label’” -p “‘$target_parent’” -g

/usr/bin/spacecmd -d -- softwarechannel_setorgaccess“‘$target_channel_label’” -e

done < ./archive-sources.lst

9.16.5 Sample Archive Channel Sources List File

This file is called/used by the Archive Channel Creation Script located above in the previoussection. Since the function “readline” is used, there should only be lines with data in the file.Any blank lines will be sourced as data and will cause errors with the Archive Channel Creationscript above.

The fields are:

Architecture - which defines the source parent archive channel. This is where the newarchive will be placed as a child channel.

Source Channel Label - This defines Where patches/packages are coming from.

Target channel Naming - the text that makes up the channel name and part of the channelsummary/description fields.

s390x, sles11-sp3-updates-s390x,SLES11-SP3-Updatesx86_64, sles11-sp4-updates-x86_64,SLES11-SP4-Updates

Page 96: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

87 Sample Archive Channel Sources List File SUSE Manager 3

i586, sles11-sp3-updates-x86_64,SLES11-SP3-Updates

This concludes the Advanced Patch Lifecycle Managment chapter of this guide.

Page 97: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

88 Introduction SUSE Manager 3

10 Live Patching

10.1 IntroductionUnder normal circumstances a system needs to be rebooted after a Kernel update. Live patchingallows you skip rebooting once a new kernel update has been applied by applying a subset ofLinux kernel releases injected via kGraft. (Supported for up to one year)

The following chapter will guide you through selecting the appropriate patches from a list ofavailable CVE patches and cloning vendor channels using the spacewalk-manage-channel-lifecycle tool into testing , dev and prod channels. You also learn how to use live patchingto avoid the typical reboot requirement after updating a system kernel. This chapter alsoprovides a good example for maintaining environments using the spacewalk-manage-channel-lifecycle tool.

For more information on using kGraft see: https://www.suse.com/documentation/sles-12/

singlehtml/book_sle_admin/book_sle_admin.html#cha.kgraft

10.2 Initial Setup RequirementsTo work with Live Patching the following expectations are assumed:

SUSE Manager 3.0 or greater fully updated

At least 1 Salt Minion running SLES12-SP1 and registered with SUSE manager

The vendor channel for SLES12-SP1 including the Live Patching child channel fully synced.

spacewalk-utils package installed on SUSE Manager Server.

# zypper in spacewalk-utils

10.3 Viewing Available CVE'sThe following procedure will guide you through selecting and viewing available CVE Patches(Common Vulnerabilities and Exposures) then applying these kernel updates using the new LivePatching feature. In this example you will use the spacewalk-manage-channel-lifecycletool to maintain specific channel states for testing, development and production.

Page 98: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

89 Cloning Channels SUSE Manager 3

1. Select your SLES12 SP1 minion from the Systems page to view its System Details. Once youhave added the SLES12 SP1 Updates vendor child channel to your client, you should seeseveral Critical software updates available. Click on Critical to see a list of availablepatches. Select any of these patches listed with the following synopsis: Important: Securityupdate for the Linux Kernel. All fixed security bugs will be listed along with their number.For example:(CVE-2016-8666)

Important: Reboot IconNormal or non-live Kernel patches always require a reboot. In SUSE Manager theseare represented by a Reboot Required icon located next to the Security shieldicon.

2. You can search for individual CVE's by selecting the Audit tab from the navigation menu.Try searching for CVE-2016-8666 . You will see that the patch is available in the vendorupdate channel and the systems it applies to will be listed.

10.4 Cloning Channels

It is considered best practice to clone a vendor channel that will be modified into a new channelwith one of the following prefix names: (dev, testing, and prod). In the following procedureyou will clone the default vendor channel into a new channel named dev-sles12-sp1-pool-x86_64 using the command line.

1. Open a terminal and as root enter:

# spacewalk-manage-channel-lifecycle --list-channelsSpacewalk Username: adminSpacewalk Password: Channel tree:

1. sles12-sp1-pool-x86_64 \__ sle-live-patching12-pool-x86_64-sp1 \__ sle-live-patching12-updates-x86_64-sp1 \__ sle-manager-tools12-pool-x86_64-sp1 \__ sle-manager-tools12-updates-x86_64-sp1 \__ sles12-sp1-updates-x86_64

Page 99: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

90 Removing Kernel Patches SUSE Manager 3

2. Now use the --init argument to automatically create a new development clone of theoriginal vendor channel:

spacewalk-manage-channel-lifecycle --init -c sles12-sp1-pool-x86_64

10.5 Removing Kernel Patches

In the following procedure you will remove all Kernel patch updates located in the dev-sles12-sp1-updates-x86_64 channel that require a reboot.

1. Check the current Kernel version in use on your client:

# uname -r3.12.62-60.64.8-default

2. From the SUSE Manager WebUI select Channels Manage Software Channels dev-sles12-sp1-updates-x86_64 Patches List/Remove. Type Kernel in the search field. Find the Kernelversion that matches the Kernel in use on your minion.

3. Remove all kernel update versions that are later than the current Kernel.

4. Your channel is now ready to promote for testing Live patching.

10.6 Promoting Channels

The following procedure will guide you through promoting and cloning a development channelto a testing channel. You will change the subscription to the dev repositories on your clientto the new testing channel repositories. You will also add the Live Patching child channels toyour client.

1. Promote and clone the dev-sles12-sp1-pool-x86_64 to a new testing channel:

# spacewalk-manage-channel-lifecycle --promote -c dev-sles12-sp1-pool-x86_64

2. From the SUSE Manager WebUI under the Systems tab select your client system to viewthe System Details page. Select Software Software Channels. From the Software Channelspage you can edit which channels a system is subscribed to. Select the new base software

Page 100: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

91 Installing kGraft Kernel Patches SUSE Manager 3

channel, in this case it should be test-sles12-sp1-pool-x86_64 . Click the Confirmbutton to switch the Base Software Channel and finalize it by clicking the Modify BaseSoftware Channel button.

3. From the Software Channels page select and add both Live Patching child channels byclicking the Change Subscriptions button.

10.7 Installing kGraft Kernel Patches

The following section will guide you through installing and enabling kGraft and utilizing kGraftpatches.

1. You will have to wait a moment for new channel meta-data to refresh. You can verifycompletion from the client with:

# zypper ref

2. You will now install the first kGraft patch on your client. Keep in mind the first kGraftpatch will required a reboot of the system. All kGraft patches applied after the initialpatch installation will not require a reboot. Using zypper search for the kgraft patch thatmatches your current kernel version. 3.12.62-60.64.8-default

# zypper ref# zypper se -s kgraft-patch-3.12.62-60.64.8-default...| kgraft-patch-3_12_62-60_64_8-default | package | 3-2.1 | x86_64 | test-sle-live-patching12-updates-x86_64-sp1| kgraft-patch-3_12_62-60_64_8-default | package | 2-2.1 | x86_64 | test-sle-live-patching12-updates-x86_64-sp1| kgraft-patch-3_12_62-60_64_8-default | package | 1-2.2 | x86_64 | test-sle-live-patching12-updates-x86_64-sp1...

3. Always install the lowest version of a kGraft patch. Keep in mind kGraft patches do notpatch anything they only prepare the kernel for live patching. Install the lowest versionof kGraft that matches your kernel:

# zypper in kgraft-patch-3_12_62-60_64_8-default-1-2.2

Page 101: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

92 Installing kGraft Kernel Patches SUSE Manager 3

4. From the SUSE Manager WebUI select Systems then select your client system. On the SystemDetails page you will notice several things:

Under System Status The system requires a reboot to enable use of kGraft LivePatching

Under System Info Kernel: You can see that Live patch: kgraft_patch_1_2_2has been applied.

5. Reboot the client system.

6. After the reboot bring your client system up to date by patching.

7. On the System Details page you will notice the System Status message is System is upto date and under System Info Kernel: you will see the latest kGraft patch has beenapplied: Live patch: kgraft_patch_3_2_1 .

Important: CVE AvailabilityNot all CVEs are included in live patches. Some CVEs require a system reboot and aretherefore not included in the kgraft live patches. kGraft patches are always a subset ofthe full kernel patches.

This concludes Live Patching.

Page 102: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

93 Service Pack Migration SUSE Manager 3

11 Performing a Service Pack Migration

11.1 Service Pack MigrationSUSE Manager utilizes SLES12 SP1 as its underlying OS. Therefore Service Pack Migrations maybe performed in the same way as a typical SLES Migration.

SUSE offers a graphical and command line tool for upgrading to a new service pack.Comprehensive documentation for executing service pack migration scenarios located inthe following SUSE Linux Enterprise Server Documentation chapter: https://www.suse.com/

documentation/sles-12/book_sle_deployment/data/cha_update_spmigration.html

11.2 Migrating SUSE Manager Version 3.0 to 3.1For migrating SUSE Manager version  3.0 to 3.1, see the SUSE Manager  3.1 Best Practicesat https://www.suse.com/documentation/suse-manager-3/book_suma_best_practices_31/data/

bp_sp_migration_version.html .

Page 103: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

94 Introduction SUSE Manager 3

12 SUSE Manager Migration from Version 2.1 toVersion 3

12.1 IntroductionThe migration from SUSE Manager 2.1 to SUSE Manager 3 works quite the same as a migrationfrom Red Hat Satellite to SUSE Manager. The migration happens from the original machine to anew one. There is no in-place migration. While this has the drawback that you temporarily needtwo machines, it also has the advantage that the original machine will remain fully functionalin case something goes wrong.

Important: Migration ProcessThe whole process may be tricky, so it is strongly advised that the migration is done byan experienced consultant.

Given the complexity of the product, the migration is an “all-or-nothing” procedure—ifsomething goes wrong you will need to start all over. Error handling is very limited. Neverthelessit should work more or less out of the box if all the steps are carefully executed as documented.

Note: Time-Consuming OperationThe migration involves dumping the whole database on the source machine and restoringit on the target machine. Also all of the channels and packages need to be copied to thenew machine, so expect the whole migration to take several hours,

12.2 Prerequisites

Warning: Latest UpdatesThe source machine needs to run SUSE Manager 2.1 with all the latest updates applied.Before starting the migration process, make sure that the machine is up to date and allupdates have been installed sucessfully.

Page 104: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

95 Setup the Target Machine SUSE Manager 3

Only machines running with the embedded PostgreSQL database may be migrated. For themigration of an Oracle based installation, a two-step migration is required: First the installationneeds to get migrated from Oracle to PostgreSQL (by means of a separate tool) and afterwardsthe migration to SUSE Manager 3 can be performed as documented here. As SUSE Manager 3does no longer support Novell Customer Center but only SCC (SUSE Customer Center), you canmigrate a machine only after it has been switched to SCC. The migration script will check if theinstallation has already been switched to SCC and will terminate if this is not the case. Switchto SCC on the source machine and repeat the migration. During migration the database fromthe source machine needs to get dumped and this dump needs to be temporarily stored on thetarget system. The dump gets compressed with gzip using the default compression options(maximum compression only yields about 10% of space savings but costs a lot of runtime); socheck the disk usage of the database with:

# du -sch /var/lib/pgsql/data

This will ensure that you have at least 30% of this value available in /var/spacewalk/tmp .

These values from a test migration should aid in illustrating space requirements:

suma21:/var/lib/pgsql# du -sch data1,8G data1,8G totalsuma21:/var/spacewalk/tmp# ls -lh susemanager.dmp.gz-rw-r--r-- 1 root root 506M Jan 12 14:58 susemanager.dmp.gz

This is a small test installation; for bigger installations the ratio might be better (space requiredfor the database dump might be less than 30%). The dump will be written to the directory /var/spacewalk/tmp , the directory will be created if it does not exist yet. If you want the dumpto be stored somewhere else, change the definition of the variable $TMPDIR on the beginningof the script to suit your needs.

12.3 Setup the Target MachineTo prepare the target machine (with the example host name suma30 proceed as follows:

PROCEDURE 12.1: SETUP TARGET MACHINE

1. After the target machine has been installed with SUSE Linux Enterprise Server 12 SP3including the extension product “SUSE Manager”, run yast2 susemanager_setup as youwould normally do for an installation of SUSE Manager.

Page 105: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

96 Performing the Migration SUSE Manager 3

For more information about installing SUSE Manager, see Book “Getting Started”, Chapter 2

“JeOS Installation”.

2. On the first installation screen, ensure that Migrate a SUSE Manager compatible server ismarked instead of Set up SUSE Manager from scratch.

3. On the second screen, enter the name of the source system as Hostname of source SUSEManager Server as well as the domain name. Also enter the database credentials of thesource system.

4. On the next screen, you will need to specify the IP address of the SUSE Manager 3 targetsystem. Normally this value should be pre-set to the correct value and you only shouldneed to press Enter . Only in the case of multiple IP addresses you might need to specifythe one that should be used during migration.

Important: Faking the Host NameDuring the migration process, the target system will fake its host name to be thesame as the source system, this is necessary as the host name of a SUSE Managerinstallation is vital and should not be changed once set. Therefore do not beconfused when logging in to your systems during migration; they both will presentyou with the same host name.

5. Continue by following the normal installation steps: Specify the database parametersusing the same database parameters as the source system is recommended. Enter your SCCcredentials. After all the data has been gathered, YaST will terminate.

Important: Migration Must be Manually TriggeredThe actual migration will not start automatically but needs to be triggeredmanually.

12.4 Performing the MigrationA migration is performed by excecuting the following command:

/usr/lib/susemanager/bin/mgr-setup -m

Page 106: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

97 Speeding up the Migration SUSE Manager 3

This command reads the data gathered in the previous step, sets up SUSE Manager onto a newtarget machine and transfers all of the data from the source machine. As several operations needto be performed on the source machine via SSH, you will be prompted once for the root passwordof the source machine. A temporary SSH key named migration-key is created and installedon the source machine, so you need to give the root password only once. The temporary SSHkey will be deleted after successful migration. Ideally, this is all you will need to do.

Depending on the size of the installation, the actual migration will take up to several hours. Oncefinished, you will be prompted to shutdown the source machine, re-configure the network of thetarget machine to use the same IP address and host name as the original machine and restart it. Itshould now be a fully functional replacement for your previous SUSE Manager 2.1 installation.The following numbers illustrate the runtime for dumping and importing a small database:

14:53:37 Dumping remote database to /var/spacewalk/tmp/susemanager.dmp.gz on target system. Please wait...14:58:14 Database successfully dumped. Size is: 506M14:58:29 Importing database dump. Please wait...15:05:11 Database dump successfully imported.

For this example dumping the database takes around five minutes to complete. Importing thedump onto the target system will take an additional seven minutes. For big installations this cantake up to several hours. You should also account for the time it takes to copy all the packagedata to the new machine. Depending on your network infrastructure and hardware, this canalso take a significant amount of time.

12.5 Speeding up the Migration

A complete migration can consume a lot of time. This is caused by the ammount of data that mustbe copied. Total migration time can be greatly decreased by elminiating the need to copy dataprior to performing the migration (for example, channels, packages, auto-install images, andany additional data). You can gather all data via YaST by running the command mgr-setup -r .

Executing mgr-setup -r will copy the data from the old server to the new one. This commandmay be run at any time and your current server will remain fully functional. Once the migrationhas been initiated only data changed since running mgr-setup -r will need to be transferredwhich will significantly reduces downtime.

Page 107: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

98 Packages on External Storage SUSE Manager 3

On large installations transfering the database (which involves dumping the database onto thesource machine and then importing the dump onto the target system) will still take some time.During the database transfer no write operations should occurr therefore the migration scriptwill shutdown running SUSE Manager database services running on the source machine.

12.6 Packages on External StorageSome installations may store the package data on external storage (for example, NFS mount on/var/spacewalk/packages ). You do not need to copy this data to the new machine. Edit thescript located in /usr/lib/susemanager/bin/mgr-setup and remove the respective rsynccommand (located around line 345).

Important: Mounting External StorageMake sure your external storage is mounted on the new machine before starting thesystem for the first time. Analogue handling for /srv/www/htdocs/pub if appropriate.

In general, all needed files and directories, not copied by the migration tool, should becopied to the new server manually.

12.7 Troubleshooting a Broken Web UI afterMigrationIt is possible that the Web UI may break during migration. This behavior is not a bug, but abrowser caching issue. The new machine has the same host name and IP address as the oldmachine. This duplication can confuse some Web browsers. If you experience this issue reloadthe page. For example, in Firefox pressing the key combination Ctrl – F5 should resume normalfunctionality.

12.8 Example SessionThis is the output of a typical migration:

suma30# /usr/lib/susemanager/bin/mgr-setup -m Filesystem type for /var/spacewalk is ext4 - ok.

Page 108: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

99 Example Session SUSE Manager 3

Open needed firewall ports... Migration needs to execute several commands on the remote machine. Please enter the root password of the remote machine.Password: Remote machine is SUSE Manager Remote system is already migrated to SCC. Good. Shutting down remote spacewalk services... Shutting down spacewalk services... Stopping Taskomatic... Stopped Taskomatic. Stopping cobbler daemon: ..done Stopping rhn-search... Stopped rhn-search. Stopping MonitoringScout ... [ OK ] Stopping Monitoring ... [ OK ] Shutting down osa-dispatcher: ..done Shutting down httpd2 (waiting for all children to terminate) ..done Shutting down Tomcat (/usr/share/tomcat6) ..done Terminating jabberd processes... Stopping router ..done Stopping sm ..done Stopping c2s ..done Stopping s2s ..done Done. CREATE ROLE * Loading answer file: /root/spacewalk-answers. ** Database: Setting up database connection for PostgreSQL backend. ** Database: Populating database. ** Database: Skipping database population. * Configuring tomcat. * Setting up users and groups. ** GPG: Initializing GPG and importing key. * Performing initial configuration. * Configuring apache SSL virtual host. ** /etc/apache2/vhosts.d/vhost-ssl.conf has been backed up to vhost-ssl.conf-swsave * Configuring jabberd. * Creating SSL certificates. ** Skipping SSL certificate generation. * Deploying configuration files. * Setting up Cobbler.. * Setting up Salt Master. 11:26:47 Dumping remote database. Please wait... 11:26:50 Database successfully dumped.

Page 109: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

100 Example Session SUSE Manager 3

Copy remote database dump to local machine... Delete remote database dump... 11:26:50 Importing database dump. Please wait... 11:28:55 Database dump successfully imported. Schema upgrade: [susemanager-schema-2.1.50.14-3.2.devel21] -> [susemanager-schema-3.0.5-5.1.develHead] Searching for upgrade path to: [susemanager-schema-3.0.5-5.1] Searching for upgrade path to: [susemanager-schema-3.0.5] Searching for upgrade path to: [susemanager-schema-3.0] Searching for start path: [susemanager-schema-2.1.50.14-3.2] Searching for start path: [susemanager-schema-2.1.50.14] The path: [susemanager-schema-2.1.50.14] -> [susemanager-schema-2.1.50.15] -> [susemanager-schema-2.1.51] -> [susemanager-schema-3.0] Planning to run schema upgrade with dir '/var/log/spacewalk/schema-upgrade/schema-from-20160112-112856' Executing spacewalk-sql, the log is in [/var/log/spacewalk/schema-upgrade/schema-from-20160112-112856-to-susemanager-schema-3.0.log].(248/248) apply upgrade [schema-from-20160112-112856/99_9999-upgrade-end.sql] e-suse-channels-to-public-channel-family.sql.postgresql] The database schema was upgraded to version [susemanager-schema-3.0.5-5.1.develHead]. Copy files from old SUSE Manager... receiving incremental file list ./ packages/ sent 18 bytes received 66 bytes 168.00 bytes/sec total size is 0 speedup is 0.00 receiving incremental file list ./ RHN-ORG-TRUSTED-SSL-CERT res.key rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm suse-307E3D54.key suse-39DB7C82.key suse-9C800ACA.key bootstrap/ bootstrap/bootstrap.sh bootstrap/client-config-overrides.txt bootstrap/sm-client-tools.rpm sent 189 bytes received 66,701 bytes 44,593.33 bytes/sec total size is 72,427 speedup is 1.08 receiving incremental file list ./ .mtime lock web.ss

Page 110: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

101 Example Session SUSE Manager 3

config/ config/distros.d/ config/images.d/ config/profiles.d/ config/repos.d/ config/systems.d/ kickstarts/ kickstarts/autoyast_sample.xml loaders/ snippets/ triggers/ triggers/add/ triggers/add/distro/ triggers/add/distro/post/ triggers/add/distro/pre/ triggers/add/profile/ triggers/add/profile/post/ triggers/add/profile/pre/ triggers/add/repo/ triggers/add/repo/post/ triggers/add/repo/pre/ triggers/add/system/ triggers/add/system/post/ triggers/add/system/pre/ triggers/change/ triggers/delete/ triggers/delete/distro/ triggers/delete/distro/post/ triggers/delete/distro/pre/ triggers/delete/profile/ triggers/delete/profile/post/ triggers/delete/profile/pre/ triggers/delete/repo/ triggers/delete/repo/post/ triggers/delete/repo/pre/ triggers/delete/system/ triggers/delete/system/post/ triggers/delete/system/pre/ triggers/install/ triggers/install/post/ triggers/install/pre/ triggers/sync/ triggers/sync/post/ triggers/sync/pre/ sent 262 bytes received 3,446 bytes 7,416.00 bytes/sec total size is 70,742 speedup is 19.08

Page 111: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

102 Example Session SUSE Manager 3

receiving incremental file list kickstarts/ kickstarts/snippets/ kickstarts/snippets/default_motd kickstarts/snippets/keep_system_id kickstarts/snippets/post_delete_system kickstarts/snippets/post_reactivation_key kickstarts/snippets/redhat_register kickstarts/snippets/sles_no_signature_checks kickstarts/snippets/sles_register kickstarts/snippets/sles_register_script kickstarts/snippets/wait_for_networkmanager_script kickstarts/upload/ kickstarts/wizard/ sent 324 bytes received 1,063 bytes 2,774.00 bytes/sec total size is 12,133 speedup is 8.75 receiving incremental file list ssl-build/ ssl-build/RHN-ORG-PRIVATE-SSL-KEY ssl-build/RHN-ORG-TRUSTED-SSL-CERT ssl-build/index.txt ssl-build/index.txt.attr ssl-build/latest.txt ssl-build/rhn-ca-openssl.cnf ssl-build/rhn-ca-openssl.cnf.1 ssl-build/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm ssl-build/rhn-org-trusted-ssl-cert-1.0-1.src.rpm ssl-build/serial ssl-build/d248/ ssl-build/d248/latest.txt ssl-build/d248/rhn-org-httpd-ssl-archive-d248-1.0-1.tar ssl-build/d248/rhn-org-httpd-ssl-key-pair-d248-1.0-1.noarch.rpm ssl-build/d248/rhn-org-httpd-ssl-key-pair-d248-1.0-1.src.rpm ssl-build/d248/rhn-server-openssl.cnf ssl-build/d248/server.crt ssl-build/d248/server.csr ssl-build/d248/server.key ssl-build/d248/server.pem sent 380 bytes received 50,377 bytes 101,514.00 bytes/sec total size is 90,001 speedup is 1.77 SUSE Manager Database Control. Version 1.5.2 Copyright (c) 2012 by SUSE Linux Products GmbH INFO: Database configuration has been changed.

Page 112: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

103 Example Session SUSE Manager 3

INFO: Wrote new general configuration. Backup as /var/lib/pgsql/data/postgresql.2016-01-12-11-29-42.conf INFO: Wrote new client auth configuration. Backup as /var/lib/pgsql/data/pg_hba.2016-01-12-11-29-42.conf INFO: New configuration has been applied. Database is online System check finished ============================================================================ Migration complete. Please shut down the old SUSE Manager server now. Reboot the new server and make sure it uses the same IP address and hostname as the old SUSE Manager server!

IMPORTANT: Make sure, if applicable, that your external storage is mounted in the new server as well as the ISO images needed for distributions before rebooting the new server! ============================================================================

Page 113: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

104 Updating SUSE Manager SUSE Manager 3

13 Common Administration Tasks

This chapter contains common procedures for SUSE Manager administrators.

13.1 Updating SUSE ManagerThis section provides information on performing regular updates and running a spacewalk-schema-upgrade on your postgresql database.

PROCEDURE 13.1: UPDATING SUSE MANAGER

1. As the root user stop Spacewalk services:

spacewalk-service stop

2. Apply latest patches with:

zypper patch

3. You will be informed if a database schema was included in the latest patch. If the databaseis running on the same machine as your SUSE Manager server, start the database with:

rcpostgresql start

4. Perform the upgrade with:

spacewalk-schema-upgrade

5. Start Spacewalk services again with:

spacewalk-service start

Important: Restart of Services and ApplicationsServices affected by a package update are not automatically restarted after anupdate. You need to restart these services manually to avoid potential failures.

You may use zypper ps to check for any applications which may be using oldcode. Restart these applications.

Page 114: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

105 Files and Directories Requiring Backup SUSE Manager 3

14 Database Backup and Restoration

Backing up SUSE Manager can be done in several ways. Regardless of the method chosen, theassociated database also needs to be backed up.

14.1 Files and Directories Requiring BackupThe following files and directories should be backed up:

The location of your SUSE Manager database, for example: /var/spacewalk/db-backup

/etc/sysconfig/rhn/

/etc/rhn/

/etc/sudoers

/srv/www/htdocs/pub/

/var/spacewalk/packages/1 (/2, /3, for each additional organization using customRPMs)

/root/.gnupg/

/root/ssl-build/

/etc/dhcp.conf

/srv/tftpboot/

/etc/cobbler/

/var/lib/cobbler/

/var/lib/rhn/kickstarts/

/srv/www/cobbler

/root/.ssh (Backup is required when using ssh tunnel or ssh push. Keep in mind if youneed to reinstall the server and you do not have a copy of the id-susemanager key saved,you must perform a mgr-ssh-push-init again for all clients.lsls)

Page 115: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

106 Administering The SUSE Manager Database with (smdba) SUSE Manager 3

Directories containing your custom data (scripts, kickstart profiles, autoyast, custom rpms,etc) should be included in the backup.

If you have mountpoints to ISO's needed for distributions, these ISOs and the /etc/fstabshould be part of your backup.

SUSE recommends backing up the entire /var/spacewalk/ tree. In case of failure, this willsave you lengthy download/resync time. Since /var/spacewalk/ (more specifically /var/spacewalk/packages/NULL/ ) is primarily a duplicate of the package repository, it can beregenerated with mgr-sync .

If you are running SUSE Manager in a disconnected setup /var/spacewalk/ must be backed up.

Backing up only these files and directories requires reinstalling the SUSE Manager RPMs andre-registering SUSE Manager. In addition, packages need to be resynchronized using the mgr-sync tool. Finally, you have to reinstall the /root/ssl-build/rhn-org-httpd-ssl-key-pair-MACHINE_NAME-VER-REL.noarch.rpm .

Another method is to back up all the files and directories mentioned above but reinstall theSUSE Manager without re-registering it. During the installation, cancel or skip the registrationand SSL certificate generation sections.

The most comprehensive method is to back up the entire machine. This saves time indownloading and reinstalling but requires additional disk space and backup time.

NoteRegardless of the backup method used, when restoring SUSE Manager from a backup,you must run the following command to schedule the recreation of search indexes thenext time the rhn-search service is started:

rcrhn-search cleanindex

14.2 Administering The SUSE Manager Database with(smdba)

SUSE Manager provides the smdba command for managing the installed database.

Page 116: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

107 Starting and Stopping the Database SUSE Manager 3

The smdba command works on local databases only, not remote. This utility allows you todo several administrative tasks like backing up and restoring the database, everything fromcreating, verifying, and restoring backups to obtain the database status and restart the databaseif necessary. The smdba command supports postgres databases.

Important: Runningsmdba Relies on sudo EnablementRunning smdba relies on proper sudo configuration. sudo allows you to invoke smdbaas a regular user and thus, you are save from executing unwanted system changes.

For example, to allow the user admin (the “administrative UID”) to execute smdbacommands, and thus manipulating the underlying database with the “operative UID”,make sure something as follows is configured in /etc/sudoers :

admin ALL=(postgres) /usr/bin/smdba

With these settings admin user will be allowed to access the target database account( oracle or postgres ).

For configuring sudo and its security implications, see the sudo and sudoers manpagesand the extensive comments in the /etc/sudoers configuration file.

Find basic information about smdba in the smdba manpage.

Note: Restart Spacewalk Services When Connection is LostIf you have stopped or restarted the database, Spacewalk services connections may beinterrupted. In such a case, execute the following command:

spacewalk-service restart

14.3 Starting and Stopping the DatabaseThere are three commands to start, stop, or retrieve the status of the database. These commandswork with both databases. Use the following commands:

smdba db-statusChecking database core... online

Page 117: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

108 Backing up the Database SUSE Manager 3

smdba db-stopStopping the SUSE Manager database...Stopping core: done

smdba db-statusChecking database core... offline

smdba db-startStarting core... done

14.4 Backing up the Database

smdba

The smdba command performs a continuous archiving backup.

Hot Backup

The term hot backup refers to a backup performed when both the database and SUSEManager are running.

Cold Backup

The term cold backup refers to a backup performed when both the database and SUSEManager services are shutdown.

Important: Database Backup Space RequirementsFor both a running/hot database backup or an automated backup of the database usingcron you must have at least 3 times the amount of space of the current database. Checkcurrent database space usage with df -h on /var/spacewalk/ .

To perform a hot database backup for postgresql, do the following:

PROCEDURE 14.1: PERFORMING A HOT BACKUP

1. Allocate permanent space on your remote storage, which you use for general backups(NAS, iSCSI target, etc.). For example:

/var/spacewalk/db-backup

Page 118: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

109 Backing up the Database SUSE Manager 3

Note: Backup on NFS ShareA backup from the SUSE Manager server is not required when the mount point for/var/spacewalk is on an NFS share.

This directory should always be the same and never change. It will be a permanent targetto store new backups and restore from it during a disaster recovery.

2. Create a directory with the correct permissions in your target directory, e.g., with usingsudo :

sudo -u postgres mkdir /var/spacewalk/db-backup

Alternatively, as root :

install -d -o postgres /var/spacewalk/db-backup

Or:

mkdir /var/spacewalk/db-backupchown postgres:postgres /var/spacewalk/db-backup

3. If you want to create a backup for the first time, run:

smdba backup-hot --enable=on --backup-dir=/var/spacewalk/db-backup

This command performs a restart of the postgresql database. If you want to renew thebasic backup, use the same command.

4. Perform the hot database backup:

smdba backup-hot --backup-dir=/var/spacewalk/db-backup...

If the command exits without any errors, find the backup files in your /mnt/backup/database directory.

Page 119: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

110 Automatic Backup with cron SUSE Manager 3

Tip: Performing a Cold BackupWhen using smdba, you should never require a cold backup. You may perform a coldbackup once after initial SUSE Manager installation and configuration. SUSE recommendscreating a full-backup once a month or weekly and an additional incremental backup forsingle days. Moving /var/spacewalk to an NFS share that is centrally backed-up, willsave you alot of time when a restore is required. The NFS share may also be used duringthe migration from SUSE Manager 2.1 to SUSE Manager 3.

14.5 Automatic Backup with cron

It is important to ensure your SUSE Manager database is backed up within a regularly definedschedule. You can do this with a cron job. The following procedure describes this process.

Important: Database Backup Space RequirementsFor a hot database backup, automated backup of the database using cron or a colddatabase backup, you must have at least 3 times the amount of space of the currentdatabase. Check current database space usage with df -h on /var/spacewalk/ .

PROCEDURE 14.2: AUTOMATIC BACKUP WITH CRON

1. If you have not created a backup directory do so now:

# mkdir /var/spacewalk/db-backup

2. Set the correct user and rights permissions to the directory:

# chown -R postgres:postgres /var/spacewalk/db-backup

# chmod 700 /var/spacewalk/db-backup

3. Add the following line to the cron job at /etc/cron.d/db-backup-mgr :

0 2 * * * root /usr/bin/smdba backup-hot --enable=on --backup-dir=/var/spacewalk/db-backup

Page 120: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

111 Restoring a Database Backup SUSE Manager 3

14.6 Restoring a Database Backup

Use smdba backup-restore to restore to an earlier point in time. To restore the backup,proceed as follows:

1. Shutdown the database:

smdba db-stop

2. Start the restore process:

smdba backup-restore start

3. Restart the database:

smdba db-start

4. Run spacewalk-data-fsck to check if there are differences between the RPMs and thedatabase.

The above steps can be combined with:

smdba backup-restore force

In this case it will select the most recent backup and purge the rest. Every time you create anew backup, it also purges the previous backups.

Note: Restoring the Most Recent Backup OnlyBecause smdba makes automatic running database backups, it allows restoration of onlythe most recent backup, which includes merging of current archive logs.

14.7 Archive Log Settings

In SUSE Manager with an embedded database, archive logging is enabled by default. This featureallows the database management tool smdba to perform hot backups.

Page 121: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

112 Retrieving an Overview of Occupied Database Space SUSE Manager 3

With archive log enabled, even more data is stored on the hard disk:

Postgresql maintains a limited number of archive logs. Using the default configuration,approx. 64 files with a size of 16 MiB are stored.

Creating a user and syncing the channels:

SLES12-SP1-Pool-x86_64

SLES12-SP1-Updates-x86_64

SLE-Manager-Tools12-Pool-x86_64-SP1

SLE-Manager-Tools12-Updates-x86_64-SP1

Postgresql will generate an additional ~1 GB of data. So it is important to think about a backupstrategy and create a backups in a regular way.

Archive logs are stored at:

/var/lib/pgsql/data/pg_xlog/ (postgresql)

14.8 Retrieving an Overview of Occupied DatabaseSpaceDatabase administrators may use the subcommand space-overview to get a report aboutoccupied table spaces, for example:

smdba space-overviewSUSE Manager Database Control. Version 1.5.2Copyright (c) 2012 by SUSE Linux Products GmbH

Tablespace | Size (Mb) | Avail (Mb) | Use %------------+-----------+------------+------postgres | 7 | 49168 | 0.013susemanager | 776 | 48399 | 1.602

The following command is available for Postgresql. For a more detailed report, use the space-tables subcommand. It lists the table and its size, for example:

smdba space-tables

Page 122: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

113 Moving the Database SUSE Manager 3

SUSE Manager Database Control. Version 1.5.2Copyright (c) 2012 by SUSE Linux Products GmbH

Table | Size --------------------------------------+-----------public.all_primary_keys | 0 bytes public.all_tab_columns | 0 bytes public.allserverkeywordsincereboot | 0 bytes public.dblink_pkey_results | 0 bytes public.dual | 8192 bytespublic.evr_t | 0 bytes public.log | 32 kB ...

14.9 Moving the DatabaseIt is possible to move the database to another location. For example if your database storagespace is running low. The following procedure will guide you through moving the database toa new location for use by SUSE Manager.

PROCEDURE 14.3: MOVING THE DATABASE

1. The default storage location for SUSE Manager is: /var/lib/pgsql/ . You would like tomove it, for example to: /storage/postgres/ . To begin, stop the running database with:

# rcpostgresql stop

Shutdown running spacewalk services with:

# spacewalk-service stop

2. Copy the current working directory structure with the following syntax:

cp [OPTION]... SOURCE... DIRECTORY

using the -a, --archive option. For example:

# cp -a /var/lib/pgsql/ /storage/postgres/

This command will copy the contents of /var/lib/pgsql/ to /storage/postgres/pgsql/ .

Page 123: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

114 Recovering from a Crashed Root Partition SUSE Manager 3

ImportantThe contents of the /var/lib/pgsql needs to remain the same or the SUSE Managerdatabase may malfunction. You also should ensure there is enough available diskspace.

3. Mount the new database directory with:

# mount /storage/postgres/pgsql

4. Make sure ownership is postgres:postgres and not root:root by changing to the newdirectory and running the following command:

/var/lib/pgsql/ # cd /storage/postgres/pgsql//storage/postgres/pgsql/ # ltotal 8drwxr-x--- 4 postgres postgres 47 Jun 2 14:35 ./

5. Start the database with:

# rcpostgresql start

Start spacewalk-services with:

# spacewalk-service start

14.10 Recovering from a Crashed Root PartitionThis section provides guidance on restoring your server after its root partition has crashed. Thissection assumes you have setup your server similar to the procedure explained in Getting Startedguide with separate partitions for the database and for channels mounted at /var/lib/pgsqland /var/spacewalk/ .

PROCEDURE 14.4: RECOVERING FROM A CRASHED ROOT PARTITION

1. Start by installing SLES12 SP1 and the SUSE Manager Extension. Do not mount the /var/spacewalk and /var/lib/pgsql partitions.

2. Once installation of SUSE Manager has completed shutdown services with spacewalk-service shutdown and the database with rcpostgresql stop .

Page 124: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

115 Database Connection Information SUSE Manager 3

3. Mount your /var/spacewalk and /var/lib/pgsql partitions and restore the directorieslisted in section one.

4. Start SUSE Manager services and the database with spacewalk-services start andrcpostgresql start

5. SUSE Manager should now operate normally without loss of your database or syncedchannels.

14.11 Database Connection InformationThe information for connecting to the SUSE Manager database is located in /etc/rhn/rhn.conf :

db_backend = postgresqldb_user = susemanagerdb_password = susemanagerdb_name = susemanagerdb_host = localhostdb_port = 5432db_ssl_enabled =

Page 125: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

116 Prerequisites SUSE Manager 3

15 Using a Custom SSL Certificate

The following section will guide you through using a custom certificate with SUSE Manager 3and SUSE Manager Proxy 3.

15.1 PrerequisitesThe following list contains the requirements for using a customer certificate.

A Certificate Authority SSL public certificate file

A Web server SSL private key file

A Web server SSL public certificate file

Key and Certificate files must be in PEM format

Warning: Hostname and SSL KeysThe hostname of the web server's SSL keys and relevant certificate files must match thehostname of the machine which they will be deployed on.

After completing the yast firstboot procedures you need to export your current environmentvariables and point them to the correct SSL files that will be imported. Keep in mindrunning these commands will make the default certificate obsolete after executing theyast2 susemanager_setup command. More informtation on YaST firstboot can befound here: https://www.suse.com/documentation/suse-manager-3/singlehtml/suse_manager21/

book_susemanager_install/book_susemanager_install.html#sec.manager.inst.installation

1. Export the environment variables and point to the SSL files to be imported:

export CA_CERT= path to CA certificate file

export SERVER_KEY= path to web server key

export SERVER_CERT= path to web server certificate

2. Execute SUSE Manager setup with yast2 susemanager_setup . Proceed with the defaultsetup. Upon reaching the Certificate Setup window during yast installation, fill in randomvalues, as these will be overridden by the commands executed in step 1.

Page 126: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

117 Using a Custom Certificate with SUSE Manager Proxy 3 SUSE Manager 3

Note: Shell RequirementsMake sure that you execute yast2 susemanager_setup from within the same shellthe environment variables were exported from.

15.2 Using a Custom Certificate with SUSE ManagerProxy 3After completing the installation with yast found in Book “Advanced Topics”, Chapter  2 “SUSE

Manager 3 Proxy” continue with a modified Book “Advanced Topics”, Chapter 2 “SUSE Manager 3 Proxy”,

Section 2.4 “Running configure-proxy.sh” procedure:

1. Execute configure-proxy.sh .

2. When prompted with:

Do you want to import existing certificates?

Answer using: y .

3. Continue by following the script prompts.

Page 127: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

118 Implementing PAM Authentication SUSE Manager 3

16 System Auditing and Security Management

16.1 Implementing PAM Authentication

As security measures become increasingly complex, SUSE Manager supports network-basedauthentication systems via Pluggable Authentication Modules (PAM). PAM is a suite of librariesthat allows to integrate SUSE Manager with a centralized authentication mechanism, thuseliminating the need to remember multiple passwords.

SUSE Manager supports LDAP, Kerberos, and other network-based authentication systems viaPAM. To enable SUSE Manager to use PAM in your organization's authentication infrastructure,set up a PAM service file and make SUSE Manager use it. Follow the steps below.

1. On a SUSE Linux Enterprise Server 12 SP1 system, a typical generic PAM service file couldlook as follows (save it as /etc/pam.d/susemanager to make it work with the settingsbelow):

#%PAM-1.0 auth include common-auth account include common-account password include common-password session include common-session

2. Make SUSE Manager use this service file ( /etc/pam.d/susemanager ) by adding thefollowing line to /etc/rhn/rhn.conf :

pam_auth_service = susemanager

3. Restart Spacewalk services to enable the new configuration with:

spacewalk-service restart

4. To enable a user to authenticate against PAM, on the SUSE Manager Web interface goto the Create User page and select the checkbox labeled Pluggable Authentication Modules(PAM) positioned below the password and password confirmation fields.

5. Then finally YaST can be used to configure PAM when packages such as yast2-

ldap-client and yast2-kerberos-client are installed; for detailed informationon configuring PAM, see SUSE Linux Enterprise 12 SP1 Security (https://www.suse.com/

Page 128: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

119 Implementing PAM Authentication SUSE Manager 3

documentation/sles-12/book_security/data/cha_pam.html) . This example is not limitedto Kerberos; it is a generic example and uses the current server configuration. Note thatonly network-based authentication services are supported.

Note: Changing PasswordsChanging the password on the SUSE Manager Web interface changes only the localpassword on the SUSE Manager server. But this password may not be used at all if PAMis enabled for that user. In the above example, for instance, the Kerberos password willnot be changed.

For more information, see SUSE Manager Authentication (http://wiki.novell.com/index.php/

SUSE_Manager/Authentication)

Page 129: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

120 Registering Cloned Salt Systems (minions) SUSE Manager 3

17 Troubleshooting

17.1 Registering Cloned Salt Systems (minions)

This chapter provides guidance on registering cloned systems with SUSE Manager. This includesboth Salt and Traditional clients.

PROCEDURE 17.1: REGISTERING A CLONED SYSTEM WITH SUSE MANAGER (SALT)

1. Clone your system (for example using the existing cloning mechanism of your favoriteHypervisor)

Note: Quick TipsEach step in this section is performed on the cloned system, this procedure doesnot manipulate the original system, which will still be registered to SUSE Manager.The cloned virtual machine should have a different UUID from the original (thisUUID is generated by your hypervisor) or SUSE Manager will overwrite the originalsystem data with the new one.

2. Make sure your machines have different hostnames and IP addresses, also check that /etc/hosts contains the changes you made and the correct host entries.

3. Stop rhnsd daemon with:

# /etc/init.d/rhnsd stop

or alternativly:

# rcrhnsd stop

4. Stop osad with:

# /etc/init.d/osad stop

or alternativly:

# rcosad stop

Page 130: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

121 Registering Cloned Salt Systems (minions) SUSE Manager 3

5. Remove the osad authentication configuration file and the systemid with:

# rm -f /etc/sysconfig/rhn/{osad-auth.conf,systemid}

The next step you take will depend on the Operating System of the clone.

In case the following scenario occurs: If you see only one of your cloned Salt minions on theSystem Overview page after having accepted all minions keys from the Salt Onboarding page,then this is likely due to these machines being clones of the original and utilizing a duplicatemachine-id. Perform the following steps to resolve this conflict.

PROCEDURE 17.2: REGISTERING SALT CLONES: SLES 12

SLES 12: If your machines have the same machine ids then delete the file on each minionand recreate it:

# cat /etc/machine-id# rm /etc/machine-id# systemd-machine-id-setup

PROCEDURE 17.3: REGISTERING SALT CLONES: SLES 11

SLES 11: As there is no systemd machine id, generate one from dbus:

# cat /var/lib/dbus/machine-id# rm /var/lib/dbus/machine-id# dbus-uuidgen --ensure

If your machines still have the same minion id then delete the minion_id file on each minion(FQDN will be used when it is regenerated on minion restart):

# rm /etc/salt/minion_id

Finally delete accepted keys from Onboarding page and system profile from SUSE Manager, andrestart the minion with:

# systemctl restart salt-minion

You should be able to re-register them again, but each minion will use a different '/etc/machine-id' and should now be correctly displayed on the System Overview page.

Page 131: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

122 Registering Cloned Traditional Systems SUSE Manager 3

17.2 Registering Cloned Traditional SystemsThis section provides guidance on troubleshooting cloned traditional systems registered viabootstrap.

PROCEDURE 17.4: REGISTERING A CLONED SYSTEM WITH SUSE MANAGER (TRADITIONAL SYSTEMS)

1. Clone your system (using your favorite hypervisor.)

Note: Quick TipsEach step in this section is performed on the cloned system, this procedure doesnot manipulate the original system, which will still be registered to SUSE Manager.The cloned virtual machine should have a different UUID from the original (thisUUID is generated by your hypervisor) or SUSE Manager will overwrite the originalsystem data with the new one.

2. Change the Hostname and IP addresses, also make sure /etc/hosts contains the changesyou made and the correct host entries.

3. Stop rhnsd daemon with:

# /etc/init.d/rhnsd stop

or alternativly:

# rcrhnsd stop

4. Stop osad with:

# /etc/init.d/osad stop

or alternativly:

# rcosad stop

5. Remove the osad authentifcation configuration file and the systemid with:

# rm -f /etc/sysconfig/rhn/{osad-auth.conf,systemid}

The next step you take will depend on the Operating System of the clone.

Page 132: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

123 Registering Cloned Traditional Systems SUSE Manager 3

PROCEDURE 17.5: REGISTERING A CLONED TRADITIONAL SYSTEM: SLES 12

1. Remove the following credential files:

# rm -f /etc/zypp/credentials.d/{SCCcredentials,NCCcredentials}

2. Re-run the bootstrap script. You should now see the cloned system in SUSE Managerwithout overwriting the system it was cloned from.

PROCEDURE 17.6: REGISTERING A CLONED TRADITIONAL SYSTEM: SLES 11

1. Continued from section 1 step 5:

# suse_register -E

(--erase-local-regdata, Erase all local files created from a previous executed registration.This option make the system look like never registered)

2. Re-run the bootstrap script. You should now see the cloned system in SUSE Managerwithout overwriting the system it was cloned from.

PROCEDURE 17.7: REGISTERING A CLONED TRADITIONAL SYSTEM: SLES 10

1. Continued from section 1 step 5:

# rm -rf /etc/{zmd,zypp}

2. # rm -rf /var/lib/zypp/ # ¡¡¡¡¡ except /var/lib/zypp/db/products/ !!!!!

3. # rm -rf /var/lib/zmd/

4. Re-run the bootstrap script. You should now see the cloned system in SUSE Managerwithout overwriting the system it was cloned from.

PROCEDURE 17.8: RHEL 5,6 AND 7

1. Continued from section 1 step 5:

# rm -f /etc/NCCcredentials

2. Re-run the bootstrap script. You should now see the cloned system in SUSE Managerwithout overwriting the system it was cloned from.

Page 133: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

124 Typical OSAD/jabberd Challenges SUSE Manager 3

17.3 Typical OSAD/jabberd ChallengesThis section provides answers for typical issues regarding OSAD and jabberd.

17.3.1 Open File Count Exceeded

SYMPTOMS : OSAD clients cannot contact the SUSE Manager Server, and jabberd requires longperiods of time to respond on port 5222.

CAUSE : The number of maximum files that a jabber user can open is lower than the numberof connected clients. Each client requires one permanently open TCP connection and eachconnection requires one file handler. The result is jabberd begins to queue and refuseconnections.

CURE : Edit the /etc/security/limits.conf to something similar to the following:jabbersoftnofile<#clients + 100> jabberhardnofile<#clients + 1000>

This will vary according to your setup. For example in the case of 5000 clients:jabbersoftnofile5100 jabberhardnofile6000

Ensure you update the /etc/jabberd/c2s.xml max_fds parameter as well. For example:<max_fds>6000</max_fds>

EXPLANATION : The soft file limit is the limit of the maximum number of open files for a singleprocess. In SUSE Manager the highest consuming process is c2s, which opens a connection perclient. 100 additional files are added, here, to accommodate for any non-connection file thatc2s requires to work correctly. The hard limit applies to all processes belonging to the jabberuser, and accounts for open files from the router, s2s and sm processes additionally.

17.3.2 jabberd Database Corruption

SYMPTOMS : After a disk is full error or a disk crash event, the jabberd database may have becomecorrupted. jabberd may then fail to start during spacewalk-service start:

Starting spacewalk services... Initializing jabberd processes... Starting router done Starting sm startproc: exit status of parent of /usr/bin/sm: 2 failed Terminating jabberd processes...

Page 134: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

125 Capturing XMPP Network Data for Debugging Purposes SUSE Manager 3

/var/log/messages shows more details:

jabberd/sm[31445]: starting upjabberd/sm[31445]: process id is 31445, written to /var/lib/jabberd/pid/sm.pidjabberd/sm[31445]: loading 'db' storage modulejabberd/sm[31445]: db: corruption detected! close all jabberd processes and run db_recoverjabberd/router[31437]: shutting down

CURE : Remove the jabberd database and restart. Jabberd will automatically re-create thedatabase:

spacewalk-service stop rm -Rf /var/lib/jabberd/db/* spacewalk-service start

An alternative approach would be to test another database, but SUSE Manager does not deliverdrivers for this:

rcosa-dispatcher stop rcjabberd stop cd /var/lib/jabberd/db rm * cp /usr/share/doc/packages/jabberd/db-setup.sqlite . sqlite3 sqlite.db < db-setup.sqlite chown jabber:jabber * rcjabberd start rcosa-dispatcher start

17.3.3 Capturing XMPP Network Data for Debugging Purposes

If you are experiencing bugs regarding OSAD, it can be useful to dump network messages inorder to help with debugging. The following procedures provide information on capturing datafrom both the client and server side.

PROCEDURE 17.9: SERVER SIDE CAPTURE

1. Install the tcpdump package on the SUSE Manager Server as root: zypper in tcpdump

2. Stop the OSA dispatcher and Jabber processes with rcosa-dispatcher stop andrcjabberd stop.

3. Start data capture on port 5222: tcpdump -s 0 port 5222 -w server_dump.pcap

Page 135: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

126 Engineering Notes: Analyzing Captured Data SUSE Manager 3

4. Start the OSA dispatcher and Jabber processes: rcosa-dispatcher start andrcjabberd start .

5. Open a second terminal and execute the following commands: rcosa-dispatcher startand rcjabberd start .

6. Operate the SUSE Manager server and clients so the bug you formerly experienced isreproduced.

7. One you have finished your capture re-open terminal 1 and stop the capture of data with:CTRL – c

PROCEDURE 17.10: CLIENT SIDE CAPTURE

1. Install the tcpdump package on your client as root: zypper in tcpdump

2. Stop the OSA process: rcosad stop .

3. Begin data capture on port 5222: tcpdump -s 0 port 5222 -wclient_client_dump.pcap

4. Open a second terminal and start the OSA process: rcosad start

5. Operate the SUSE Manager server and clients so the bug you formerly experienced isreproduced.

6. Once you have finished your capture re-open terminal 1 and stop the capture of data with:CTRL – c

17.3.4 Engineering Notes: Analyzing Captured Data

This section provides information on analyzing the previously captured data from client andserver.

1. Obtain the certificate file from your SUSE Manager server: /etc/pki/spacewalk/jabberd/server.pem

2. Edit the certificate file removing all lines before ----BEGIN RSA PRIVATE KEY----- ,save it as key.pem

3. Install Wireshark as root with: zypper in wireshark

4. Open the captured file in wireshark.

Page 136: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

127 Engineering Notes: Analyzing Captured Data SUSE Manager 3

5. From EidtPreferences select SSL from the left pane.

6. Select RSA keys list: EditNew

IP Address any

Port: 5222

Protocol: xmpp

Key File: open the key.pem file previously edited.

Password: leave blank

For more information see also:

https://wiki.wireshark.org/SSL

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3444

Page 137: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

128 Learning YAML Syntax for Salt States SUSE Manager 3

18 Additional Resources

This chapter contains links to helpful resources.

18.1 Learning YAML Syntax for Salt StatesLearn how to write states and pillars with YAML.

https://docs.saltstack.com/en/latest/topics/yaml/index.html

http://yaml-online-parser.appspot.com/

18.2 Getting Started with Jinja TemplatesLearn how to begin writing templates in Jinja

https://docs.saltstack.com/en/latest/topics/jinja/index.html

http://jinja.pocoo.org/docs/dev/

18.3 Salt Best PracticesBest practices from the Salt team.

https://docs.saltstack.com/en/latest/topics/best_practices.html

Page 138: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

129 SUSE Manager 3

A GNU LicensesThis appendix contains the GNU FreeDocumentation License version 1.2.

GNU Free Documentation License

Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor,Boston, MA 02110-1301 USA. Everyone is permitted to copy and distribute verbatim copiesof this license document, but changing it is not allowed.

0. PREAMBLE

The purpose of this License is to make a manual, textbook, or other functional and usefuldocument "free" in the sense of freedom: to assure everyone the effective freedom to copyand redistribute it, with or without modifying it, either commercially or noncommercially.Secondarily, this License preserves for the author and publisher a way to get credit for theirwork, while not being considered responsible for modifications made by others.

This License is a kind of "copyleft", which means that derivative works of the document mustthemselves be free in the same sense. It complements the GNU General Public License, whichis a copyleft license designed for free software.

We have designed this License in order to use it for manuals for free software, because freesoftware needs free documentation: a free program should come with manuals providing thesame freedoms that the software does. But this License is not limited to software manuals; itcan be used for any textual work, regardless of subject matter or whether it is published as aprinted book. We recommend this License principally for works whose purpose is instructionor reference.

1. APPLICABILITY AND DEFINITIONS

This License applies to any manual or other work, in any medium, that contains a notice placedby the copyright holder saying it can be distributed under the terms of this License. Such anotice grants a world-wide, royalty-free license, unlimited in duration, to use that work underthe conditions stated herein. The "Document", below, refers to any such manual or work. Anymember of the public is a licensee, and is addressed as "you". You accept the license if youcopy, modify or distribute the work in a way requiring permission under copyright law.

A "Modified Version" of the Document means any work containing the Document or a portionof it, either copied verbatim, or with modifications and/or translated into another language.

A "Secondary Section" is a named appendix or a front-matter section of the Document thatdeals exclusively with the relationship of the publishers or authors of the Document to theDocument's overall subject (or to related matters) and contains nothing that could fall directlywithin that overall subject. (Thus, if the Document is in part a textbook of mathematics, aSecondary Section may not explain any mathematics.) The relationship could be a matterof historical connection with the subject or with related matters, or of legal, commercial,philosophical, ethical or political position regarding them.

The "Invariant Sections" are certain Secondary Sections whose titles are designated, as beingthose of Invariant Sections, in the notice that says that the Document is released under thisLicense. If a section does not fit the above definition of Secondary then it is not allowed to bedesignated as Invariant. The Document may contain zero Invariant Sections. If the Documentdoes not identify any Invariant Sections then there are none.

The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts orBack-Cover Texts, in the notice that says that the Document is released under this License. AFront-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.

A "Transparent" copy of the Document means a machine-readable copy, represented in aformat whose specification is available to the general public, that is suitable for revisingthe document straightforwardly with generic text editors or (for images composed of pixels)generic paint programs or (for drawings) some widely available drawing editor, and thatis suitable for input to text formatters or for automatic translation to a variety of formatssuitable for input to text formatters. A copy made in an otherwise Transparent file formatwhose markup, or absence of markup, has been arranged to thwart or discourage subsequentmodification by readers is not Transparent. An image format is not Transparent if used forany substantial amount of text. A copy that is not "Transparent" is called "Opaque".

Examples of suitable formats for Transparent copies include plain ASCII without markup,Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD,and standard-conforming simple HTML, PostScript or PDF designed for human modification.Examples of transparent image formats include PNG, XCF and JPG. Opaque formats includeproprietary formats that can be read and edited only by proprietary word processors, SGML or

XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposesonly.

The "Title Page" means, for a printed book, the title page itself, plus such following pages asare needed to hold, legibly, the material this License requires to appear in the title page. Forworks in formats which do not have any title page as such, "Title Page" means the text near themost prominent appearance of the work's title, preceding the beginning of the body of the text.

A section "Entitled XYZ" means a named subunit of the Document whose title either is preciselyXYZ or contains XYZ in parentheses following text that translates XYZ in another language.(Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements","Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section whenyou modify the Document means that it remains a section "Entitled XYZ" according to thisdefinition.

The Document may include Warranty Disclaimers next to the notice which states that thisLicense applies to the Document. These Warranty Disclaimers are considered to be includedby reference in this License, but only as regards disclaiming warranties: any other implicationthat these Warranty Disclaimers may have is void and has no effect on the meaning of thisLicense.

2. VERBATIM COPYING

You may copy and distribute the Document in any medium, either commercially ornoncommercially, provided that this License, the copyright notices, and the license noticesaying this License applies to the Document are reproduced in all copies, and that you addno other conditions whatsoever to those of this License. You may not use technical measuresto obstruct or control the reading or further copying of the copies you make or distribute.However, you may accept compensation in exchange for copies. If you distribute a largeenough number of copies you must also follow the conditions in section 3.

You may also lend copies, under the same conditions stated above, and you may publiclydisplay copies.

3. COPYING IN QUANTITY

If you publish printed copies (or copies in media that commonly have printed covers) of theDocument, numbering more than 100, and the Document's license notice requires Cover Texts,you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts:Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both coversmust also clearly and legibly identify you as the publisher of these copies. The front covermust present the full title with all words of the title equally prominent and visible. You mayadd other material on the covers in addition. Copying with changes limited to the covers, aslong as they preserve the title of the Document and satisfy these conditions, can be treatedas verbatim copying in other respects.

If the required texts for either cover are too voluminous to fit legibly, you should put thefirst ones listed (as many as fit reasonably) on the actual cover, and continue the rest ontoadjacent pages.

If you publish or distribute Opaque copies of the Document numbering more than 100, youmust either include a machine-readable Transparent copy along with each Opaque copy,or state in or with each Opaque copy a computer-network location from which the generalnetwork-using public has access to download using public-standard network protocols acomplete Transparent copy of the Document, free of added material. If you use the latteroption, you must take reasonably prudent steps, when you begin distribution of Opaque copiesin quantity, to ensure that this Transparent copy will remain thus accessible at the statedlocation until at least one year after the last time you distribute an Opaque copy (directly orthrough your agents or retailers) of that edition to the public.

It is requested, but not required, that you contact the authors of the Document well beforeredistributing any large number of copies, to give them a chance to provide you with anupdated version of the Document.

Page 139: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

130 SUSE Manager 3

4. MODIFICATIONS

You may copy and distribute a Modified Version of the Document under the conditions ofsections 2 and 3 above, provided that you release the Modified Version under precisely thisLicense, with the Modified Version filling the role of the Document, thus licensing distributionand modification of the Modified Version to whoever possesses a copy of it. In addition, youmust do these things in the Modified Version:

A. Use in the Title Page (and on the covers, if any) a title distinct from that of theDocument, and from those of previous versions (which should, if there were any,be listed in the History section of the Document). You may use the same title as aprevious version if the original publisher of that version gives permission.

B. List on the Title Page, as authors, one or more persons or entities responsible forauthorship of the modifications in the Modified Version, together with at least fiveof the principal authors of the Document (all of its principal authors, if it has fewerthan five), unless they release you from this requirement.

C. State on the Title page the name of the publisher of the Modified Version, as thepublisher.

D. Preserve all the copyright notices of the Document.

E. Add an appropriate copyright notice for your modifications adjacent to the othercopyright notices.

F. Include, immediately after the copyright notices, a license notice giving the publicpermission to use the Modified Version under the terms of this License, in the formshown in the Addendum below.

G. Preserve in that license notice the full lists of Invariant Sections and required CoverTexts given in the Document's license notice.

H. Include an unaltered copy of this License.

I. Preserve the section Entitled "History", Preserve its Title, and add to it an itemstating at least the title, year, new authors, and publisher of the Modified Versionas given on the Title Page. If there is no section Entitled "History" in the Document,create one stating the title, year, authors, and publisher of the Document as givenon its Title Page, then add an item describing the Modified Version as stated inthe previous sentence.

J. Preserve the network location, if any, given in the Document for public access toa Transparent copy of the Document, and likewise the network locations given inthe Document for previous versions it was based on. These may be placed in the"History" section. You may omit a network location for a work that was publishedat least four years before the Document itself, or if the original publisher of theversion it refers to gives permission.

K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Titleof the section, and preserve in the section all the substance and tone of each of thecontributor acknowledgements and/or dedications given therein.

L. Preserve all the Invariant Sections of the Document, unaltered in their text andin their titles. Section numbers or the equivalent are not considered part of thesection titles.

M. Delete any section Entitled "Endorsements". Such a section may not be includedin the Modified Version.

N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict intitle with any Invariant Section.

O. Preserve any Warranty Disclaimers.

If the Modified Version includes new front-matter sections or appendices that qualify asSecondary Sections and contain no material copied from the Document, you may at youroption designate some or all of these sections as invariant. To do this, add their titles to thelist of Invariant Sections in the Modified Version's license notice. These titles must be distinctfrom any other section titles.

You may add a section Entitled "Endorsements", provided it contains nothing butendorsements of your Modified Version by various parties--for example, statements of peerreview or that the text has been approved by an organization as the authoritative definitionof a standard.

You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Onlyone passage of Front-Cover Text and one of Back-Cover Text may be added by (or througharrangements made by) any one entity. If the Document already includes a cover text for thesame cover, previously added by you or by arrangement made by the same entity you areacting on behalf of, you may not add another; but you may replace the old one, on explicitpermission from the previous publisher that added the old one.

The author(s) and publisher(s) of the Document do not by this License give permission to usetheir names for publicity for or to assert or imply endorsement of any Modified Version.

5. COMBINING DOCUMENTS

You may combine the Document with other documents released under this License, underthe terms defined in section 4 above for modified versions, provided that you include in thecombination all of the Invariant Sections of all of the original documents, unmodified, andlist them all as Invariant Sections of your combined work in its license notice, and that youpreserve all their Warranty Disclaimers.

The combined work need only contain one copy of this License, and multiple identicalInvariant Sections may be replaced with a single copy. If there are multiple Invariant Sectionswith the same name but different contents, make the title of each such section unique byadding at the end of it, in parentheses, the name of the original author or publisher of thatsection if known, or else a unique number. Make the same adjustment to the section titles inthe list of Invariant Sections in the license notice of the combined work.

In the combination, you must combine any sections Entitled "History" in the various originaldocuments, forming one section Entitled "History"; likewise combine any sections Entitled"Acknowledgements", and any sections Entitled "Dedications". You must delete all sectionsEntitled "Endorsements".

6. COLLECTIONS OF DOCUMENTS

You may make a collection consisting of the Document and other documents released underthis License, and replace the individual copies of this License in the various documents with asingle copy that is included in the collection, provided that you follow the rules of this Licensefor verbatim copying of each of the documents in all other respects.

You may extract a single document from such a collection, and distribute it individually underthis License, provided you insert a copy of this License into the extracted document, and followthis License in all other respects regarding verbatim copying of that document.

7. AGGREGATION WITH INDEPENDENT WORKS

A compilation of the Document or its derivatives with other separate and independentdocuments or works, in or on a volume of a storage or distribution medium, is called an"aggregate" if the copyright resulting from the compilation is not used to limit the legal rightsof the compilation's users beyond what the individual works permit. When the Document isincluded in an aggregate, this License does not apply to the other works in the aggregatewhich are not themselves derivative works of the Document.

If the Cover Text requirement of section 3 is applicable to these copies of the Document, thenif the Document is less than one half of the entire aggregate, the Document's Cover Textsmay be placed on covers that bracket the Document within the aggregate, or the electronicequivalent of covers if the Document is in electronic form. Otherwise they must appear onprinted covers that bracket the whole aggregate.

8. TRANSLATION

Translation is considered a kind of modification, so you may distribute translations of theDocument under the terms of section 4. Replacing Invariant Sections with translations requiresspecial permission from their copyright holders, but you may include translations of someor all Invariant Sections in addition to the original versions of these Invariant Sections. Youmay include a translation of this License, and all the license notices in the Document, andany Warranty Disclaimers, provided that you also include the original English version of thisLicense and the original versions of those notices and disclaimers. In case of a disagreementbetween the translation and the original version of this License or a notice or disclaimer, theoriginal version will prevail.

If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", therequirement (section 4) to Preserve its Title (section 1) will typically require changing theactual title.

9. TERMINATION

You may not copy, modify, sublicense, or distribute the Document except as expresslyprovided for under this License. Any other attempt to copy, modify, sublicense or distribute theDocument is void, and will automatically terminate your rights under this License. However,parties who have received copies, or rights, from you under this License will not have theirlicenses terminated so long as such parties remain in full compliance.

Page 140: Best Practices - SUSE Manager 3€¦ · Best Practices SUSE Manager 3 Joseph Cayouette ... guarantee complete accuracy. ... RES salt-minions with SUSE Manager 16 • Register a Salt

131 SUSE Manager 3

10. FUTURE REVISIONS OF THIS LICENSE

The Free Software Foundation may publish new, revised versions of the GNU FreeDocumentation License from time to time. Such new versions will be similar in spirit to thepresent version, but may differ in detail to address new problems or concerns. See http://

www.gnu.org/copyleft/ .

Each version of the License is given a distinguishing version number. If the Document specifiesthat a particular numbered version of this License "or any later version" applies to it, you havethe option of following the terms and conditions either of that specified version or of anylater version that has been published (not as a draft) by the Free Software Foundation. If theDocument does not specify a version number of this License, you may choose any version everpublished (not as a draft) by the Free Software Foundation.

ADDENDUM: How to use this License for your documents

Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License”.

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the“with...Texts.” line with this:

with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.

If you have Invariant Sections without Cover Texts, or some other combination of the three,merge those two alternatives to suit the situation.

If your document contains nontrivial examples of program code, we recommend releasingthese examples in parallel under your choice of free software license, such as the GNU GeneralPublic License, to permit their use in free software.