Skip to content

antony@notes:~/suse$ cat "SUMA-Server-Configration.md"

SUMA Server Configration

2024-05-14· suse ·SUSE Manager

SUMA Server Configration

:::warning

:::spoiler 目錄

[TOC]

:::

檢驗主機名稱

~> hostname -f && hostname -s && hostname -I

螢幕輸出

suma.example.com
suma
192.168.11.69

注意,第一個 hostname -f 命令須返回 FDQN FQDN,全名 : Fully Qualified Domain Name,一個網際網路上的完整網域名稱,包括主機名稱和完整的網域名稱

檢驗工作目錄

執行以下命令

ls -ld /var/lib/pgsql /var/spacewalk

有關權限的部分,螢幕輸出應該是要跟以下一樣

drwxr-x--- 1 postgres postgres /var/lib/pgsql
drwxrwxr-x 1 wwwrun   www      /var/spacewalk

如果需要,請用這些命令改變權限:

chmod 750 /var/lib/pgsql
chmod 775 /var/spacewalk

And owners with:

chown postgres:postgres /var/lib/pgsql
chown wwwrun:www /var/spacewalk

以下特定目錄容量要求是官網給的建議,可視情況客製化目錄大小

![](https://i.imgur.com/b4fGVAf.png =60%x)

執行以下命令,確認特定目錄的大小是否符合預期

~> lsblk

螢幕輸出


NAME                     MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda                        8:0    0  250G  0 disk
├─sda1                     8:1    0    8M  0 part
└─sda2                     8:2    0  250G  0 part
  ├─system-root          254:0    0   25G  0 lvm  /var
  │                                               /usr/local
  │                                               /tmp
  │                                               /opt
  │                                               /root
  │                                               /home
  │                                               /boot/grub2/i386-pc
  │                                               /boot/grub2/x86_64-efi
  │                                               /.snapshots
  │                                               /
  ├─system-swap          254:1    0    3G  0 lvm  [SWAP]
  ├─system-srv           254:2    0   44G  0 lvm  /srv
  ├─system-var_cache     254:3    0    6G  0 lvm  /var/cache
  ├─system-var_lib_pgsql 254:4    0   54G  0 lvm  /var/lib/pgsql
  └─system-var_spacewalk 254:5    0  118G  0 lvm  /var/spacewalk
sr0                       11:0    1 15.4G  0 ro

用戶端管理

SUMA 支援多種用戶端註冊管理方式(Traditional Clients / Salt Clients /SSH),下面以 Salt Client 方式為例,進行客戶端管理。 主要是以下步驟:

  1. 針對產品版本,創建“用戶端倉庫”
  2. 創建Activation Key
  3. 創建用戶端註冊腳本
  4. 用戶端上的註冊操作

創建用戶端倉庫

在軟體倉庫中完成了某個產品(如 SLES15-SP4 )通道的導入後, SUMA 即具備了創建此產品的用戶端倉庫的選項。

有時這個倉庫也會稱為啟動倉庫,提供用戶端接受SUMA管理的最小軟體元件集合。

使用以下命令創建指定產品的用戶端倉庫:

  1. 先檢查 SUMA 目前可用的用戶端倉庫
 mgr-create-bootstrap-repo -l

-l,列出可用的用戶端倉庫

螢幕輸出

1. SLE-12-SP5-x86_64
2. SLE-15-SP3-x86_64
3. SLE-15-SP4-x86_64
  1. 創建用戶端倉庫
mgr-create-bootstrap-repo --create SLE-15-SP4-x86_64

注意:必須完成軟體通道的導入後,才可創建,否則可能會因 rpm 檔不全而失敗!

螢幕輸出

Creating bootstrap repo for SLE-15-SP4-x86_64
copy 'dbus-1-glib-0.108-1.29.x86_64'
copy 'glib2-tools-2.70.5-150400.3.3.1.x86_64'

...中間省略

Directory walk started
Directory walk done - 81 packages
Temporary output repo path: /srv/www/htdocs/pub/repositories/sle/15/4/bootstrap.tmp/.repodata/
Preparing sqlite DBs
Pool started (with 5 workers)
Pool finished

創建 Activation_Key

Activation_Key 是一系列配置的集合,用來定義

用戶端在註冊時訂閱什麼軟體倉庫,需要額外定義什麼套裝軟體等

因此通常使用不同的 Activation_key 來區分不同的軟體倉庫,還可包括用戶端數量, 這一點對於合規性來說,也是很有用的。

比如, 用戶有 2 個 SLES 12 SP4 訂閱和 2 個 SLES 12 SP5 訂閱,分別用在 WEB 和 DB 兩類伺服器上,則可以生成:

  1. Activation_Key=“1-sles12-sp4-web”,包含基本產品通道,限制數量 = 2
  2. Activation_Key=“1-sles12-sp5-db”,包含基本產品通道,限制數量 = 2

創建註冊腳本範本

完整的操作分成兩步:

  1. 創建註冊腳本的範本,此範本不能直接運行。
  2. 創建註冊腳本的實例,根據 Activation_Key 綁定具體的訂閱。

在 4.3 版本的 SUMA 中,“Enable SSL” 的選項被移除 Bootstrap using Salt,此選項用於指定是否使用 Salt 進行用戶端管理

創建成功後,會在網頁的上緣顯示以下訊息

切換到工作目錄

# cd /srv/www/htdocs/pub/bootstrap/

檢視創建註冊腳本的範本

# ll
total 52
-rw-r--r-- 1 root root 39168 Apr 20 10:51 bootstrap.sh
-rw-r--r-- 1 root root   575 Apr 20 10:51 client-config-overrides.txt
-rwxr-xr-x 1 root root  6331 Jan 27 14:28 client_config_update.py

拷貝一份特定 Chanel 的註冊腳本

cp bootstrap.sh bootstrap-SLES15SP4.sh

編輯註冊腳本

88 ACTIVATION_KEYS=1-SLE-15-SP4

在第 88 行,填入對應的 ACTIVATION_KEYS

如果沒有 DNS 環境的處理

在 bootstrap 腳本的“HOSTNAME”下一行,增加以下腳本內容:

OLDIFS=$IFS
IFS=''
SUMAHOSTRECORD='192.168.11.69'$'\t'$HOSTNAME
grep $SUMAHOSTRECORD /etc/hosts > /dev/null || {
sed -i "/$HOSTNAME/d" /etc/hosts
echo $SUMAHOSTRECORD >> /etc/hosts
}
IFS=$OLDIFS

此腳本將在用戶端註冊時,在 Clients 端的 /etc/hosts 檔案中創建正確的 SUMA 伺服器項目,請注意 IP 位址不要寫錯

用戶端註冊操作

CentOS 8 客戶端為例

以下命令須以 root 身分執行以下命令

將 SUMA 的 Domain Name 加到 /etc/hosts

$ nano /etc/hosts

新增以下內容

192.168.11.69   suma.example.com

執行註冊腳本

$ curl -k https://suma.example.com/pub/bootstrap/bootstrap-centos-8-x86_64.sh | bash

正確的螢幕輸出

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0SUSE Manager Server Client bootstrap script v2022.08


MINOR MANUAL EDITING OF THIS FILE MAY BE REQUIRED!

If this bootstrap script was created during the initial installation
of a SUSE Manager Server, the ACTIVATION_KEYS, and ORG_GPG_KEY values will
probably *not* be set (see below). If this is the case, please do the
following:
  - copy this file to a name specific to its use.
    (e.g., to bootstrap-SOME_NAME.sh - like bootstrap-web-servers.sh.)
  - on the website create an activation key or keys for the system(s) to
    be registered.
  - edit the values of the VARIABLES below (in this script) as
    appropriate:
    - ACTIVATION_KEYS needs to reflect the activation key(s) value(s)
      from the website. XKEY or XKEY,YKEY
      Please note that if you are using this script to boostrap minions,
      only the FIRST activation key will be used. Multiple activation keys
      are not supported with salt
    - ORG_GPG_KEY needs to be set to the name(s) of the corporate public
      GPG key filename(s) (residing in /srv/www/htdocs/pub) if appropriate. XKEY or XKEY,YKEY
    - When reactivating Salt minion, use REACTIVATION_KEY variable
      Consider using environmental variable REACTIVATION_KEY for single use reactivation keys.

Verify that the script variable settings are correct:
    - CLIENT_OVERRIDES should be only set differently if a customized
      client-config-overrides-VER.txt file was created with a different
      name.
    - ensure the value of HOSTNAME is correct.
    - ensure the value of ORG_CA_CERT is correct.

Enable this script: comment (with #'s) this block (or, at least just
the exit below, if present)

100 39378  100 39378    0     0   610k      0 --:--:-- --:--:-- --:--:--  610k

UPDATING RHN_REGISTER/UP2DATE CONFIGURATION FILES
-------------------------------------------------
* downloading necessary files
  client_config_update.py...
2023-04-20 03:16:26 URL:https://suma.example.com/pub/bootstrap/client_config_update.py [6331/6331] -> "client_config_update.py" [1]
FINISHED --2023-04-20 03:16:26--
Total wall clock time: 0.07s
Downloaded: 1 files, 6.2K in 0s (159 MB/s)
  client-config-overrides.txt...
2023-04-20 03:16:26 URL:https://suma.example.com/pub/bootstrap/client-config-overrides.txt [575/575] -> "client-config-overrides.txt" [1]
FINISHED --2023-04-20 03:16:26--
Total wall clock time: 0.06s
Downloaded: 1 files, 575 in 0s (9.21 MB/s)

PREPARE GPG KEYS AND CORPORATE PUBLIC CA CERT
-------------------------------------------------
* no organizational GPG keys to import

* attempting to install corporate public CA cert
2023-04-20 03:16:27 URL:https://suma.example.com/pub/RHN-ORG-TRUSTED-SSL-CERT [1696/1696] -> "RHN-ORG-TRUSTED-SSL-CERT" [1]
FINISHED --2023-04-20 03:16:27--
Total wall clock time: 0.06s
Downloaded: 1 files, 1.7K in 0s (50.9 MB/s)
* update certificates

CLEANING UP OLD SUSE MANAGER REPOSITORIES
-------------------------------------------------

CHECKING THE REGISTRATION STACK
-------------------------------------------------
* check for necessary packages being installed...
* client codebase is centos-8
2023-04-20 03:16:27 URL:https://suma.example.com/pub/repositories/centos/8/bootstrap/repodata/repomd.xml [3087/3087] -> "repomd.xml.1" [1]
FINISHED --2023-04-20 03:16:27--
Total wall clock time: 0.05s
Downloaded: 1 files, 3.0K in 0s (94.5 MB/s)
 adding client software repository at https://suma.example.com/pub/repositories/centos/8/bootstrap
 adding 'module_hotfixes' flag to the repository config
2023-04-20 03:16:27 URL:https://suma.example.com/pub/repositories/centos/8/bootstrap/venv-enabled-x86_64.txt [113/113] -> "venv-enabled-x86_64.txt" [1]
FINISHED --2023-04-20 03:16:27--
Total wall clock time: 0.05s
Downloaded: 1 files, 113 in 0s (300 MB/s)
Bootstrap repo 'https://suma.example.com/pub/repositories/centos/8/bootstrap' contains salt bundle.
package venv-salt-minion is not installed
* going to install missing packages...
CentOS Linux 8 - AppStream                                                           6.1 MB/s | 8.4 MB     00:01
CentOS Linux 8 - BaseOS                                                              7.8 MB/s | 4.6 MB     00:00
CentOS Linux 8 - Extras                                                              106 kB/s |  10 kB     00:00
susemanager:bootstrap                                                                2.1 MB/s | 104 kB     00:00
Dependencies resolved.
=====================================================================================================================
 Package                       Architecture        Version                  Repository                          Size
=====================================================================================================================
Installing:
 venv-salt-minion              x86_64              3004-1.25.1              susemanager:bootstrap               26 M

Transaction Summary
=====================================================================================================================
Install  1 Package

Total download size: 26 M
Installed size: 103 M
Downloading Packages:
venv-salt-minion-3004-1.25.1.x86_64.rpm                                               33 MB/s |  26 MB     00:00
---------------------------------------------------------------------------------------------------------------------
Total                                                                                 33 MB/s |  26 MB     00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                             1/1
  Running scriptlet: venv-salt-minion-3004-1.25.1.x86_64                                                         1/1
  Installing       : venv-salt-minion-3004-1.25.1.x86_64                                                         1/1
  Running scriptlet: venv-salt-minion-3004-1.25.1.x86_64                                                         1/1
  Verifying        : venv-salt-minion-3004-1.25.1.x86_64                                                         1/1

Installed:
  venv-salt-minion-3004-1.25.1.x86_64

Complete!
venv-salt-minion-3004-1.25.1.x86_64
Last metadata expiration check: 0:00:37 ago on Thu 20 Apr 2023 03:16:33 AM EDT.
Dependencies resolved.
Nothing to do.
Complete!

REGISTRATION
------------
* registering
Using activation key: centos-8-x86_64
* removing TLS certificate used for bootstrap
  (will be re-added via salt state)
* starting salt daemon and enabling it during boot
Created symlink /etc/systemd/system/multi-user.target.wants/venv-salt-minion.service → /usr/lib/systemd/system/venv-salt-minion.service.
-bootstrap complete-

Trouble Shooting

錯誤訊息

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
package venv-salt-minion is not installed
ERROR: Failed to install all missing packages.

解決辦法

執行以下三行命令

$ cd /etc/yum.repos.d/

$ sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

$ sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

最後再跟 SUMA 註冊一次應該就成功了

$ curl -k https://suma.example.com/pub/bootstrap/bootstrap-centos-8-x86_64.sh | bash

SLES-12-SP5 為例

將 SUMA 的 Domain Name 加到 /etc/hosts

$ vim /etc/hosts

新增以下內容

192.168.11.69   suma.example.com

執行註冊腳本

$ curl -k https://suma.example.com/pub/bootstrap/bootstrap-SLE-12-SP5.sh | bash

正確的螢幕輸出

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 39380  100 39380    0     0  1373k      0 --:--:-- --SUSE Manager Server Client bootstrap script v2022.08
:--:-- --:--:-- 1373k


MINOR MANUAL EDITING OF THIS FILE MAY BE REQUIRED!

If this bootstrap script was created during the initial installation
of a SUSE Manager Server, the ACTIVATION_KEYS, and ORG_GPG_KEY values will
probably *not* be set (see below). If this is the case, please do the
following:
  - copy this file to a name specific to its use.
    (e.g., to bootstrap-SOME_NAME.sh - like bootstrap-web-servers.sh.)
  - on the website create an activation key or keys for the system(s) to
    be registered.
  - edit the values of the VARIABLES below (in this script) as
    appropriate:
    - ACTIVATION_KEYS needs to reflect the activation key(s) value(s)
      from the website. XKEY or XKEY,YKEY
      Please note that if you are using this script to boostrap minions,
      only the FIRST activation key will be used. Multiple activation keys
      are not supported with salt
    - ORG_GPG_KEY needs to be set to the name(s) of the corporate public
      GPG key filename(s) (residing in /srv/www/htdocs/pub) if appropriate. XKEY or XKEY,YKEY
    - When reactivating Salt minion, use REACTIVATION_KEY variable
      Consider using environmental variable REACTIVATION_KEY for single use reactivation keys.

Verify that the script variable settings are correct:
    - CLIENT_OVERRIDES should be only set differently if a customized
      client-config-overrides-VER.txt file was created with a different
      name.
    - ensure the value of HOSTNAME is correct.
    - ensure the value of ORG_CA_CERT is correct.

Enable this script: comment (with #'s) this block (or, at least just
the exit below, if present)

hostname: Name or service not known

UPDATING RHN_REGISTER/UP2DATE CONFIGURATION FILES
-------------------------------------------------
* downloading necessary files
  client_config_update.py...
WARNING: cannot verify suma.example.com's certificate, issued by ‘/C=TW/ST=Taiwan/L=Taipei City/O=Taishinbank/OU=IT/CN=suma.example.com’:
  Unable to locally verify the issuer's authority.
2023-04-20 15:01:10 URL:https://suma.example.com/pub/bootstrap/client_config_update.py [6331/6331] -> "client_config_update.py" [1]
FINISHED --2023-04-20 15:01:10--
Total wall clock time: 0.1s
Downloaded: 1 files, 6.2K in 0s (3.72 GB/s)
  client-config-overrides.txt...
WARNING: cannot verify suma.example.com's certificate, issued by ‘/C=TW/ST=Taiwan/L=Taipei City/O=Taishinbank/OU=IT/CN=suma.example.com’:
  Unable to locally verify the issuer's authority.
2023-04-20 15:01:10 URL:https://suma.example.com/pub/bootstrap/client-config-overrides.txt [575/575] -> "client-config-overrides.txt" [1]
FINISHED --2023-04-20 15:01:10--
Total wall clock time: 0.05s
Downloaded: 1 files, 575 in 0s (545 MB/s)

PREPARE GPG KEYS AND CORPORATE PUBLIC CA CERT
-------------------------------------------------
* no organizational GPG keys to import

* attempting to install corporate public CA cert
WARNING: cannot verify suma.example.com's certificate, issued by ‘/C=TW/ST=Taiwan/L=Taipei City/O=Taishinbank/OU=IT/CN=suma.example.com’:
  Unable to locally verify the issuer's authority.
2023-04-20 15:01:11 URL:https://suma.example.com/pub/RHN-ORG-TRUSTED-SSL-CERT [1696/1696] -> "RHN-ORG-TRUSTED-SSL-CERT" [1]
FINISHED --2023-04-20 15:01:11--
Total wall clock time: 0.05s
Downloaded: 1 files, 1.7K in 0s (547 MB/s)
* update certificates

CLEANING UP OLD SUSE MANAGER REPOSITORIES
-------------------------------------------------

CHECKING THE REGISTRATION STACK
-------------------------------------------------
* check for necessary packages being installed...
* client codebase is sle-12-sp5
2023-04-20 15:01:11 URL:https://suma.example.com/pub/repositories/sle/12/5/bootstrap/venv-enabled-x86_64.txt [113/113] -> "venv-enabled-x86_64.txt" [1]
FINISHED --2023-04-20 15:01:11--
Total wall clock time: 0.05s
Downloaded: 1 files, 113 in 0s (121 MB/s)
Bootstrap repo 'https://suma.example.com/pub/repositories/sle/12/5/bootstrap' contains salt bundle.
package venv-salt-minion is not installed
* going to install missing packages...
2023-04-20 15:01:11 URL:https://suma.example.com/pub/repositories/sle/12/5/bootstrap/repodata/repomd.xml [3095/3095] -> "repomd.xml" [1]
FINISHED --2023-04-20 15:01:11--
Total wall clock time: 0.05s
Downloaded: 1 files, 3.0K in 0s (995 MB/s)
 adding client software repository at https://suma.example.com/pub/repositories/sle/12/5/bootstrap
Retrieving repository 'susemanager:bootstrap' metadata ........................................................[done]
Building repository 'susemanager:bootstrap' cache .............................................................[done]
Specified repositories have been refreshed.
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  venv-salt-minion

The following package has no support information from it's vendor:
  venv-salt-minion

1 new package to install.
Overall download size: 21.9 MiB. Already cached: 0 B. After the operation, additional 100.6 MiB will be used.
Continue? [y/n/...? shows all options] (y): y
Retrieving package venv-salt-minion-3004-3.25.1.x86_64                          (1/1),  21.9 MiB (100.6 MiB unpacked)
Retrieving: venv-salt-minion-3004-3.25.1.x86_64.rpm ...............................................[done (7.4 MiB/s)]
Checking for file conflicts: ..................................................................................[done]
(1/1) Installing: venv-salt-minion-3004-3.25.1.x86_64 .........................................................[done]
venv-salt-minion-3004-3.25.1.x86_64
Loading repository data...
Reading installed packages...
No update candidate for 'openssl-1.0.2p-1.13.noarch'. The highest available version is already installed.
No update candidate for 'venv-salt-minion-3004-3.25.1.x86_64'. The highest available version is already installed.
Resolving package dependencies...

The following 3 packages are going to be upgraded:
  libsolv-tools libzypp zypper

The following 3 packages have no support information from their vendor:
  libsolv-tools libzypp zypper

3 packages to upgrade.
Overall download size: 3.8 MiB. Already cached: 0 B. After the operation, additional 126.8 KiB will be used.
Continue? [y/n/...? shows all options] (y): y
Retrieving package libsolv-tools-0.6.39-2.39.2.x86_64                           (1/3), 583.9 KiB (  4.7 MiB unpacked)
Retrieving: libsolv-tools-0.6.39-2.39.2.x86_64.rpm ............................................................[done]
Retrieving package libzypp-16.22.5-39.1.x86_64                                  (2/3),   2.0 MiB (  7.4 MiB unpacked)
Retrieving: libzypp-16.22.5-39.1.x86_64.rpm ...................................................................[done]
Retrieving package zypper-1.13.62-21.46.5.x86_64                                (3/3),   1.2 MiB (  6.8 MiB unpacked)
Retrieving: zypper-1.13.62-21.46.5.x86_64.rpm .................................................................[done]
Checking for file conflicts: ..................................................................................[done]
(1/3) Installing: libsolv-tools-0.6.39-2.39.2.x86_64 ..........................................................[done]
(2/3) Installing: libzypp-16.22.5-39.1.x86_64 .................................................................[done]
(3/3) Installing: zypper-1.13.62-21.46.5.x86_64 ...............................................................[done]

REGISTRATION
------------
* registering
Using activation key: SLE-12-SP5-x86_64
* removing TLS certificate used for bootstrap
  (will be re-added via salt state)
* starting salt daemon and enabling it during boot
Created symlink from /etc/systemd/system/multi-user.target.wants/venv-salt-minion.service to /usr/lib/systemd/system/venv-salt-minion.service.
-bootstrap complete-

Trouble Shooting

如果 Client 端的 VM 是複製出來的 Machine ID 會一樣,導致 Activation Key 激活後,擠掉同 Machine ID 的 VM,如果用 sudo journalctl -u venv-salt-minion.service,可以查看以下錯誤訊息

The Salt Master has cached the public key for this node, this salt minion will wait for 10 seconds before attempting to re-authenticate
...

解決辦法 :

在 Client 端上,執行以下命令

$ rm /etc/machine-id && \
rm /var/lib/dbus/machine-id && \
dbus-uuidgen --ensure && \
systemd-machine-id-setup

再去檢查 Machine ID 就會變成不一樣的了,此時再重啟服務

$ sudo systemctl restart venv-salt-minion.service

然後到 SUMA 去接受 Key 就 OK 拉 ~

Add Product 出現 sync failed

可以到 /var/log/rhn/reposync/ 目錄底下看 log 檔

suma 4.2.14 以上的版本,要加 SLES 15 SP3 的 Client 端,需要 LTSS 的 Channel,這樣在建立 Bootstrap Repo 才不會因為缺少套件而失敗

錯誤訊息如下

error: package "python3-looseversion" not found

SUMA Client 註冊失敗,並出現 the salt master has rejected this minion's public key 錯誤訊息

解決辦法 : 移除 Client 有關 Salt 的檔案,並停止 Salt-minion 的服務,到 SUMA 上清除 Client 的 Salt Key

接受 Salt 用戶端

在 SUMA 的 WEB 介面上,進入 [SUSE Manager] > Systems > System List > All 頁面,可以看到新註冊的用戶端系統。

如果是 Salt 用戶端,[SUSE Manager] > Salt > Keys,首先需要在 WEB 介面的 Salt 功能表,接受新的 Salt-Key 方能讓新用戶端系統進入 System 清單中。

示意圖

接受以後

最後就可以在 System OverView 上看到用戶端拉 ~

單個用戶端全量補丁

  1. ”Select All" ,按鈕選擇所有補丁
  2. “Apply Patchs” ,按鈕會提示升級補丁的時間安排:

選擇時間後,再提交操作請求。

提交後,可以到 Events 的 History 下,檢查 Patch 後的狀態

有關補丁的部分還可以完成

  1. 單個用戶端特定補丁
  2. 按特定 CVE 實施補丁
    • [SUSE Manager] > Audit > CVE Audit 頁面,在搜尋框輸入 CVE 編號
  3. 批量用戶端應用補丁

移除註冊 Client

1. 先在 SUMA Server 上執行

sudo spacecmd system_delete FQDN
sudo salt-key -d FQDN
spacecmd -- clear_caches

2. 在 Client 端上執行

請依 system type 選擇刪除方法

2.1 Salt Bundle Client - Manual Registration Cleanup

$ sudo systemctl stop venv-salt-minion.service; \
sudo rm /etc/zypp/repos.d/susemanager\:channels.repo /etc/venv-salt-minion/*; \
zypper rm -y venv-salt-minion; \
sudo rm -r /etc/venv-salt-minion/*

2.2 Deleting SLES 12 and 15 Salt Clients

$ systemctl stop salt-minion; \
rm /etc/zypp/repos.d/susemanager\:channels.repo; \
rm -r /etc/sysconfig/rhn/; \
rm -r /etc/salt/; \
zypper rm salt salt-minion python*-salt sle-manager-tools-release

透過 spacecmd 指令管理 SUMA

Login

$ spacecmd -- login

螢幕輸出 :

Spacewalk Username: admin
Spacewalk Password:
INFO: Connected to https://suma.example.com/rpc/api as admin
  • 填入 Username 和 Password (與 SUMA Web Console 登入的帳密相同)

列出 SUMA 中已安裝的 base channel

$ spacecmd -- softwarechannel_listbasechannels -v

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin
sle-product-sles15-sp3-pool-x86_64 : SUSE Linux Enterprise Server 15 SP3 x86_64
sle-product-sles15-sp4-pool-x86_64 : SUSE Linux Enterprise Server 15 SP4 x86_64
sle-product-sles15-sp5-pool-x86_64 : SUSE Linux Enterprise Server 15 SP5 x86_64

列出 SUMA 中已安裝的 Child Channel

$ spacecmd -- softwarechannel_listchildchannels sle-product-sles15-sp4-pool-x86_64 -v

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin
sle-manager-tools15-pool-x86_64-sp4 : SUSE Manager Client Tools for SLE 15 x86_64
sle-manager-tools15-updates-x86_64-sp4 : SUSE Manager Client Tools for SLE 15 x86_64
sle-module-basesystem15-sp4-pool-x86_64 : Basesystem Module 15 SP4 x86_64
sle-module-basesystem15-sp4-updates-x86_64 : Basesystem Module 15 SP4 x86_64
sle-module-containers15-sp4-pool-x86_64 : Containers Module 15 SP4 x86_64
sle-module-containers15-sp4-updates-x86_64 : Containers Module 15 SP4 x86_64
sle-module-desktop-applications15-sp4-pool-x86_64 : Desktop Applications Module 15 SP4 x86_64
sle-module-desktop-applications15-sp4-updates-x86_64 : Desktop Applications Module 15 SP4 x86_64
sle-module-packagehub-subpackages15-sp4-pool-x86_64 : SUSE Package Hub 15 SP4 x86_64
sle-module-packagehub-subpackages15-sp4-updates-x86_64 : SUSE Package Hub 15 SP4 x86_64
sle-module-python3-15-sp4-pool-x86_64 : Python 3 Module 15 SP4 x86_64
sle-module-python3-15-sp4-updates-x86_64 : Python 3 Module 15 SP4 x86_64
sle-module-server-applications15-sp4-pool-x86_64 : Server Applications Module 15 SP4 x86_64
sle-module-server-applications15-sp4-updates-x86_64 : Server Applications Module 15 SP4 x86_64
sle-module-transactional-server15-sp4-pool-x86_64 : Transactional Server Module 15 SP4 x86_64
sle-module-transactional-server15-sp4-updates-x86_64 : Transactional Server Module 15 SP4 x86_64
sle-product-sles15-sp4-updates-x86_64 : SUSE Linux Enterprise Server 15 SP4 x86_64
sle15-sp4-installer-updates-x86_64 : SUSE Linux Enterprise Server 15 SP4 x86_64
suse-packagehub-15-sp4-backports-pool-x86_64 : SUSE Package Hub 15 SP4 x86_64
suse-packagehub-15-sp4-pool-x86_64 : SUSE Package Hub 15 SP4 x86_64

創建 Activation key

usage: activationkey_create [options]

options:
  -n NAME
  -d DESCRIPTION
  -b BASE_CHANNEL
  -u set key as universal default
  -e [enterprise_entitled,virtualization_host]

Example

$ spacecmd -- activationkey_create \
-n sles-15-sp4 \
-d sles-15-sp4 \
-b sle-product-sles15-sp4-pool-x86_64 \
-e virtualization_host

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin
INFO: Created activation key 1-sles-15-sp4

Set the usage limit of an activation key

can be a number or unlimited.

usage: activationkey_setusagelimit KEY <usage limit>
usage: activationkey_setusagelimit KEY unlimited

Example

$ spacecmd -- activationkey_setusagelimit 1-sles-15-sp4 30

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin
INFO: Created activation key 1-sles-15-sp4

Set the base channel for an activation key

usage: activationkey_setbasechannel KEY CHANNEL

Example

$ spacecmd -- activationkey_setbasechannel sles-15-sp4 sle-product-sles15-sp4-pool-x86_64

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin

Add child channels to an activation key

usage: activationkey_addchildchannels KEY <CHANNEL ...>

Example

## Set a var which has include all child channel of sle 15 sp4 base channel
channel=$(spacecmd -- softwarechannel_listchildchannels sle-product-sles15-sp4-pool-x86_64 2> /dev/null)

$ spacecmd -- activationkey_addchildchannels 1-sles-15-sp4 $channel

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin

Remove child channels from an activation key

usage: activationkey_removechildchannels KEY <CHANNEL ...>

Example

$ spacecmd -- activationkey_removechildchannels 1-sles-15-sp4 sle-module-containers15-sp4-pool-x86_64 sle-module-containers15-sp4-updates-x86_64 sle-module-desktop-applications15-sp4-pool-x86_64 sle-module-desktop-applications15-sp4-updates-x86_64 sle-module-transactional-server15-sp4-pool-x86_64 sle-module-server-applications15-sp4-updates-x86_64

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin

List the base channel associated with an activation key

usage: activationkey_listbasechannel KEY

Example

$ spacecmd -- activationkey_listbasechannel 1-sles-15-sp4

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin
sle-product-sles15-sp4-pool-x86_64

List child channels associated with an activation key

usage: activationkey_listchildchannels KEY

Example

$ spacecmd -- activationkey_listchildchannels 1-sles-15-sp4

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin
sle-manager-tools15-pool-x86_64-sp4
sle-manager-tools15-updates-x86_64-sp4
sle-module-basesystem15-sp4-pool-x86_64
sle-module-basesystem15-sp4-updates-x86_64
sle-module-packagehub-subpackages15-sp4-pool-x86_64
sle-module-packagehub-subpackages15-sp4-updates-x86_64
sle-module-python3-15-sp4-pool-x86_64
sle-module-python3-15-sp4-updates-x86_64
sle-module-server-applications15-sp4-pool-x86_64
sle-module-transactional-server15-sp4-updates-x86_64
sle-product-sles15-sp4-updates-x86_64
sle15-sp4-installer-updates-x86_64
suse-packagehub-15-sp4-backports-pool-x86_64
suse-packagehub-15-sp4-pool-x86_64

Delete an existing activation key

usage: activationkey_delete KEY

Example

$ spacecmd -- activationkey_delete 1-sles-15-sp4

螢幕輸出 :

INFO: Connected to https://suma.example.com/rpc/api as admin
1-sles-15-sp4

Delete activation key(s) [y/N]: y

List all existing activation keys

usage: activationkey_list

Example

$ spacecmd -q -- activationkey_list

螢幕輸出 :

1-liberty-linux-centos-7
1-liberty-linux-rhel-7
1-oracle-linux-7

Set the contact method to use for systems registered with a specific key

usage: activationkey_setcontactmethod KEY CONTACT_METHOD

The following contact methods are available for use with traditional spacecmd: [‘default’, ‘ssh-push’, ‘ssh-push-tunnel’]

Example

$ spacecmd -q -- activationkey_setcontactmethod 1-liberty-linux-rhel-7 ssh-push
SUMA 從 SUSE Custom Center 同步 ProductsSetup SSH File Transfer Protocol on SLES 12