Skip to content

antony@notes:~/suse$ cat "安裝-SUSE-Manager-5.0.md"

安裝 SUSE Manager 5.0

2025-04-08· suse

安裝 SUSE Manager 5.0

1. 安裝要求

1.1. 硬體要求

硬體項目詳細資訊建議規格
CPUx86-64, ARM, ppc64le, or s390x至少 4 顆 64-bit 專用核心
RAM最少16 GB
RAM建議32 GB
磁碟空間/ 根目錄20 GB
磁碟空間/var/lib/containers/storage/volumes至少 150 GB (依產品數量而異)
磁碟空間/var/lib/containers/storage/volumes/var-pgsql PostgreSQL 資料目錄至少 50 GB

1.2. 網路要求

  • SUSE Manager 伺服器必須能正確解析其完整網域名稱(FQDN)。如果無法解析這個 FQDN,可能會對多個不同的元件造成嚴重問題。
  • 為了確保 SUSE Manager 的網域名稱能被其客戶端正確解析,伺服器與客戶端主機都必須連接到一個正常運作的 DNS 伺服器。你同時也需要確保 reverse lookups 已正確設定。
# 1. 透過變數定義 SUSE Manager 5.0 的 FQDN
$ SUMA_FQDN='antony-suma.example.com.'

# 2. 透過變數定義 SUSE Manager 5.0 的 IP 位址
$ SUMA_IP='192.168.11.9'

# 3. 透過變數定義 DNS Server 的 IP 位址
$ DNS_Server_IP='192.168.11.11'

# 4. 解析 SUSE Manager 5.0 的 FQDN
$ dig ${SUMA_FQDN} @${DNS_Server_IP} +short
192.168.11.9

# 5. 反向解析 SUSE Manager 5.0 的 IP
$ dig -x ${SUMA_IP} @${DNS_Server_IP} +short
antony-suma.example.com.

1.3. 所需網路連接埠

請參考 SUSE Manager 官網連結 :

https://documentation.suse.com/suma/5.0/en/suse-manager/installation-and-upgrade/network-requirements.html#ports

1.4. 安裝 ISO

SUSE 的官網 下載以下 ISO 檔案

SUSE-Manager-Server.x86_64-5.0.2-SelfInstall-2024.12.install.iso

2. 開始安裝 SUSE Manager 5.0

:::info

本文章測試的 VM 規格如下 :

  • CPU : 4 Core
  • RAM : 16 GiB
  • Hard Disk : 一顆 70 G 當 OS 碟,另一顆 200 G 當專門儲存 SUSE Manager 資料的硬碟

:::

  1. 透過 ISO 將 VM 開機
  2. 按一下 Enter 鍵 「Install SUSE Manager 5.0 Server」。 image
  3. 選擇要將 OS 安裝到哪顆硬碟,確認好後按 Enterimage
  4. 清除硬碟中的所有資料,確認好後按 Enterimage
  5. 等系統安裝 OS,安裝好後系統會重新開機 image
  6. 在 JeOS Firstboot 畫面上選擇開始繼續,確認好後按 Enterimage
  7. 選擇鍵盤規格,確認好後按 Enterimage
  8. 接受許可協議,確認好後按 EnterimageYES 後按 Enterimage
  9. 選擇時區 Asia/Taipei (在 66% 左右),確認好後按 Enterimage
  10. 設定 root 的密碼 image 二次確認密碼沒打錯 image
  11. 這邊會有教你怎麼註冊的指令,直接按 Enterimage
  12. 使用 root 身分登入,輸入帳號密碼 image
  13. 設定網路資訊和主機名稱
# 如果主機有透過 DHCP 得到 IP 位址,可以先 SSH 連進主機
# 1. 透過變數定義 IP 位址並且包含 Subnetmask
$ IP='192.168.11.9/24'

$ 2. 透過變數定義 Default Gateway
$ GW='192.168.11.254'

# 3. 檢視乙太網卡的名稱
$ ip -4 a s
...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    altname enp0s18
    altname ens18
    inet 192.168.11.120/24 brd 192.168.11.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever

# 4. 透過變數定義要設定乙太網卡的 DEVICE 名稱
$ DEV='eth0'

# 5. 透過變數定義要設定的網卡的 connection 名稱
$ CNAME=$(nmcli -t -f NAME,DEVICE connection show | awk -v dev="${DEV}" -F: '$2 == dev {print $1}')

# 6. 透過變數定義 DNS Server IP 位址
$ DNS_Server_IP='192.168.11.11'

# 7. 設定靜態 IP、Default Gateway 和 DNS Server
$ nmcli connection modify "${CNAME}" \
  ipv4.method manual \
  ipv4.addresses "${IP}" \
  ipv4.gateway "${GW}" \
  ipv4.dns "${DNS_Server_IP}"

# 8. 透過變數定義主機名稱
$ HN='antony-suma.example.com.'

# 9. 設定主機名稱
$ hostnamectl set-hostname ${HN}

# 10. 重新開機
$ reboot
  1. 註冊 SLE Micro 和 SUSE Manager 5.0
# 1. 使用 root 身分 SSH 連線至 SUSE Manager 主機
$ ssh root@192.168.11.9

# 2. 進入 transactional-update shell
$ transactional-update shell

# 3. 註冊 SLE Micro 到 SCC
$ SUSEConnect -r <REGCODE> -e <your_email>

# 4. 註冊 SUSE Manager 5.0 到 SCC
$ SUSEConnect -p SUSE-Manager-Server/5.0/x86_64 -r <REGCODE>

# 5. 安裝 SUSE Manager 5.0
$ zypper -n install mgradm* mgrctl* suse-manager-5.0-$(uname -m)-server-*

# 6. 將所有已安裝套件更新到最新的版本
$ zypper -n update

# 7. 離開 transactional-update shell
$ exit

# 8. 重新開機
$ reboot
  1. 建立 LVM 並設定 Persistent Storage
# 1. 檢視當前的硬碟
# 將規劃 /dev/sda 為系統碟, /dev/sdb 為 SUSE Manager 儲存資料的硬碟
$ hwinfo --disk | grep -E "Device File:"
  Device File: /dev/sdb (/dev/sg1)
  Device File: /dev/sda (/dev/sg0)

# 2. 建立 PV
$ pvcreate /dev/sdb

# 3. 建立 VG
$ vgcreate suma /dev/sdb

# 4. 建立 LV
$ lvcreate -l +100%FREE -n data /dev/suma

# 5. 設定 SUMA 的永存目錄區,以下命令還會將 /var/lib/containers/storage/volumes 掛載至指定的 Device 上
$ mgr-storage-server /dev/suma/data
  1. 部署 SUSE Manager 5.0
$ mgradm install podman antony-suma.example.com

執行結果如下 : (要輸入 CA key 的密碼,以及 SUSE Manager Administrator 的密碼,各兩次)

5:34PM INF Welcome to mgradm
5:34PM INF Executing command: podman
Password for the CA key to generate:
Confirm the password:
Administrator password:
Confirm the password:
5:34PM INF Setting up the server with the FQDN 'antony-suma.example.com'
5:34PM INF Computed image name is registry.suse.com/suse/manager/5.0/x86_64/server:5.0.3
5:34PM INF Ensure image registry.suse.com/suse/manager/5.0/x86_64/server:5.0.3 is available
5:34PM INF Using the localhost/suse/manager/5.0/x86_64/server:5.0.3 image loaded from the RPM instead of its online version registry.suse.com/suse/manager/5.0/x86_64/server:5.0.3
5:34PM INF Setting up uyuni network
5:34PM INF Enabling system service
5:34PM INF Waiting for the server to start…
5:34PM INF Run setup command in the container
5:34PM ??? Asserting correct java version...
5:34PM ??? Skipping btrfs check in containers
Open needed firewall ports...
5:34PM ??? success
5:34PM ??? No swap found; trying to setup additional swap space...
5:34PM ??? Will *NOT* create swapfile in a container!
5:34PM ??? ===============================================================================
!
! This shell operates within a container environment, meaning that not all
! modifications will be permanently saved in volumes.
!
! Please exercise caution when making changes, as some alterations may not
! persist beyond the current session.
!
===============================================================================
5:34PM ??? CREATE ROLE
5:34PM ??? * Loading answer file: /root/spacewalk-answers.
5:34PM ??? ** Database: Setting up database connection for PostgreSQL backend.
5:34PM ??? ** Database: Populating database.
** Database: --clear-db option used.  Clearing database.
5:34PM ??? ** Database: Shutting down spacewalk services that may be using DB.
5:34PM ??? ** Database: Services stopped.  Clearing DB.
5:35PM ??? Running spacewalk-sql --select-mode-direct /usr/share/susemanager/db/postgres/deploy.sql
5:35PM ??? *** Progress: #
5:35PM ???
5:35PM ??? * Performing initial configuration.
5:35PM ??? * Configuring apache SSL virtual host.
5:35PM ??? * Creating SSL certificates.
5:35PM ??? ** SSL: Generating CA certificate.
5:35PM ??? ** SSL: Generating server certificate.
5:35PM ??? ** Database: Setting up report database.
5:35PM ??? ** Database: --clear-db option used.  Clearing report database.
5:35PM ??? Running /usr/bin/uyuni-setup-reportdb create --db reportdb --user pythia_susemanager --host localhost --address * --remote 0.0.0.0/0,::/0 --password <REDACTED>
*** Progress: #
5:35PM ???
5:35PM ??? ** Database: Installation complete.
* Report DB Configured.
* Update configuration in database.
5:35PM ??? * Setting up Cobbler..
5:35PM ??? * Deploying configuration files.
5:35PM ??? * Restarting services.
5:36PM ??? Installation complete.
5:36PM ??? INFO: Database configuration has been changed.
INFO: Wrote new general configuration. Backup as /var/lib/pgsql/data/postgresql.2025-04-08-17-36-04.conf
INFO: Wrote new client auth configuration. Backup as /var/lib/pgsql/data/pg_hba.2025-04-08-17-36-04.conf
INFO: New configuration has been applied.
Database is online
System check finished
5:36PM ??? Shutting down spacewalk services...
5:36PM ??? Done.
5:36PM ??? Starting spacewalk services...
5:36PM ???   Checking DB schema and running DB schema upgrade if needed. This may take a while.
  Call the following command to see progress: journalctl -f -u uyuni-check-database.service
5:36PM ??? Done.
5:36PM INF Copying the SSL CA certificate to the host
5:36PM INF Updating host trusted certificates
5:36PM INF Server set up, login on https://antony-suma.example.com with admin user
  1. 打開瀏覽器,輸入 SUSE Manager 的 FQDN

帳號 : admin 密碼 : 只有你自己知道

image

Registering SUSE Liberty Linux 8 Clients全離線安裝 SUSE Manager Server 4.3