Samba 4.0で必要なポートとRHEL用iptables設定


Samba 4.0で必要なポートについて、Sambaの公式wiki「Samba port usage」を参考に設定を作成した。

とりあえず、上記のページから必要なポートについて引用

Service Port protocol
DNS 53 tcp/udp
Kerberos 88 tcp/udp
End Point Mapper (DCE/RPC Locator Service) 135 tcp
NetBIOS Name Service 137 udp
NetBIOS Datagram 138 udp
NetBIOS Session 139 tcp
LDAP 389 tcp/udp
SMB over TCP 445 tcp
Kerberos kpasswd 464 tcp/udp
LDAPS (only if “tls enabled = yes”) 636 tcp
Global Cataloge 3268 tcp
Global Cataloge SSL (only if “tls enabled = yes”) 3269 tcp
Multicast DNS 5353 tcp/udp

また、Microsoft公式の「Windows のサービス概要およびネットワーク ポート要件」も参照して、必要そうなポートについて、以下のように設定した。

# for DNS
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
# for Kerberos
-A INPUT -p udp -m udp --dport 88 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 88 -j ACCEPT
-A INPUT -p udp -m udp --dport 464 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 464 -j ACCEPT
# for LDAP
-A INPUT -p udp -m udp --dport 389 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 389 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 636 -j ACCEPT
# for SMB
#-A INPUT -p udp -m udp --dport 137 -j ACCEPT
#-A INPUT -p udp -m udp --dport 138 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 139 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 445 -j ACCEPT
# for RPC and SYSVOL
-A INPUT -p tcp -m tcp --dport 135 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5722 -j ACCEPT
# for Global Catalog
-A INPUT -p tcp -m tcp --dport 3268 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 3269 -j ACCEPT
# for Multicast DNS
-A INPUT -p udp -m udp --dport 5353 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 5353 -j ACCEPT

上記をRHEL/CentOSの/etc/sysconfig/iptablesの適切な位置に追加する。

for SMBのUDP 137,138については、samba wikiの方にいるポートとして記載されているが、無くても動くようなのでコメントにしている。

Samba 4.xでActive Directoryを1から立てる


このコンテンツの更新版として「Samba 4.7.xでActive Directoryを1から立てる」(2018/03/02)を公開しています。


LinuxでActive Directoryサーバを立てることにした。
アプライアンスとして作られているものがあるのは知ってるけど、あえて、それは使わないことにし、CentOS6で環境を作ることにした。

メリットについて上げてみる。
・samba 4.xでは、DNSサーバ/LDAPサーバ機能を統合してしまっているので
 sambaの設定をするだけでおしまい
・Active Directoryユーザの作成などは、ADに参加しているWindowsマシンに管理者ユーザでログオンし
 その端末にインストールしたActive Directory管理ツールから行える。

えぇ、bindの設定とかopenldapの設定とか、気にしなくていいんです。
(ただし、小規模の場合。大規模になると、パフォーマンスの問題でbindも使った方がいいらしい。openldapは機能が足らないせいでお役御免です)
(追記: WindowsServer2012のクラスタリングのためには使えませんでした)


では、「Samba AD DC HOWTO」を見ながらセットアップ。

1. 関連ソフトウェアパッケージのインストール
Sambaをセットアップするにあたり必要な周辺ソフトウェア群の準備を行う。
Samba 4/OS Requirements」を参考にパッケージをインストールしていく。

CentOS6.5の最小インストール状態なので、いろいろ追加していくことになる。

設定中、sshセッションが切れたりすることがあるかもしれないので「screen」を追加。

# yum install screen 

Requirementsに記載されているパッケージを追加。

# yum install gcc libacl-devel libblkid-devel gnutls-devel \
   readline-devel python-devel gdb pkgconfig krb5-workstation \
   zlib-devel setroubleshoot-server libaio-devel \
   setroubleshoot-plugins policycoreutils-python \
   libsemanage-python setools-libs-python setools-libs \
   popt-devel libpcap-devel sqlite-devel libidn-devel \
   libxml2-devel libacl-devel libsepol-devel libattr-devel \
   keyutils-libs-devel cyrus-sasl-devel cups-devel bind-utils

ドキュメントの製作で使うらしい以下のパッケージも追加

# yum install docbook-style-xsl libxslt

2. ファイルシステムのマウントオプション調整
Sambaで利用したいファイルシステムのマウントオプションを調整する。
Samba 4/OS Requirements」の「File System Support」に記載されているようにext3/ext4の場合、「user_xattr,acl,barrier=1」オプションをつけてマウントしろ、とのこと。

CentOS6の場合、標準状態では、以下のように/etc/fstabで指定されていた。

UUID=080add24-43d7-4502-aa31-2e7a4b9116d5 /home                   ext4    defaults        1 2

この場合、/proc/mountsで確認できるマウント状況は、以下の様になっている。

/dev/sdb1 /home ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0

「user_xattr,acl」が足らないようなので/etc/fstabを以下のように書き換えた。

UUID=080add24-43d7-4502-aa31-2e7a4b9116d5 /home                   ext4    user_xattr,acl,barrier=1         1 2

が、/proc/mounts は同じ状態。

/dev/sdb1 /home ext4 rw,seclabel,relatime,barrier=1,data=ordered 0 0

mount -vではきちんと反映されているように見えるという点が非常に謎。

/dev/sdb1 on /home type ext4 (rw,user_xattr,acl,barrier=1)

以下の様にテストを実行し、このような出力結果が出れば問題ない、とのことなので、上記のマウントの件は問題なし、とした。

# touch test.txt
# setfattr -n user.test -v test test.txt
# setfattr -n security.test -v test2 test.txt
# getfattr -d test.txt
# file: test.txt
user.test="test"

# getfattr -n security.test -d test.txt
# file: test.txt
security.test="test2"

# touch test3.txt
# setfacl -m g:adm:rwx test3.txt
# getfacl test3.txt
# file: test3.txt
# owner: root
# group: root
user::rw-
group::r--
group:adm:rwx
mask::rwx
other::r--

#

3. ソース取得
wgetでsamba 4.1.5のソースを取得。

# wget http://ftp.samba.org/pub/samba/samba-4.1.5.tar.gz

4. configure

# tar xfz samba-4.1.5.tar.gz
# cd samba-4.1.5
# ./configure

で構成情報取得。

Requirementにある以外に必要となったもの。

# yum install perl openldap-devel

以下はあったほうがいいのかなぁ?という感じのもの。

# yum install pam-devel

ちなみに「openldap-devel」をインストールしないと、以下のメッセージが出て、Active Directory機能が使えないので注意。

# ./configure
<略>
Active Directory support not available: LDAP support ist not available.
Building without Active Directory support.
<略>
#

5. make & make install

# make
<略>
# make install
<略>
#

6.インストール完了確認
sambaのバージョン確認

# /usr/local/samba/sbin/samba -V
Version 4.1.5
#

7. Active Directoryのセットアップ
ドメイン「adosakana.local」を作成します。
また、sambaの機能を使ってAD DNSを構築するので「SAMBA_INTERNAL」を選択します。

# /usr/local/samba/bin/samba-tool domain provision --use-rfc2307 --interactive
Realm: adosakana.local
 Domain [adosakana]:
 Server Role (dc, member, standalone) [dc]:
 DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE) [SAMBA_INTERNAL]:
 DNS forwarder IP address (write 'none' to disable forwarding) [172.30.50.100]:
Administrator password:
Retype password:
Looking up IPv4 addresses
Looking up IPv6 addresses
No IPv6 address will be assigned
Setting up share.ldb
Setting up secrets.ldb
Setting up the registry
Setting up the privileges database
Setting up idmap db
Setting up SAM db
Setting up sam.ldb partitions and settings
Setting up sam.ldb rootDSE
Pre-loading the Samba 4 and AD schema
Adding DomainDN: DC=adosakana,DC=local
Adding configuration container
Setting up sam.ldb schema
Setting up sam.ldb configuration data
Setting up display specifiers
Modifying display specifiers
Adding users container
Modifying users container
Adding computers container
Modifying computers container
Setting up sam.ldb data
Setting up well known security principals
Setting up sam.ldb users and groups
Setting up self join
Adding DNS accounts
Creating CN=MicrosoftDNS,CN=System,DC=adosakana,DC=local
Creating DomainDnsZones and ForestDnsZones partitions
Populating DomainDnsZones and ForestDnsZones partitions
Setting up sam.ldb rootDSE marking as synchronized
Fixing provision GUIDs
A Kerberos configuration suitable for Samba 4 has been generated at /usr/local/samba/private/krb5.conf
Setting up fake yp server settings
Once the above files are installed, your Samba4 server will be ready to use
Server Role:           active directory domain controller
Hostname:              adcent6
NetBIOS Domain:        ADOSAKANA
DNS Domain:            adosakana.local
DOMAIN SID:            S-1-5-21-3559328066-3556283577-2939567822
#

8. sambaを起動

# /usr/local/samba/sbin/samba
# ps -ef|grep samba
root      5516     1  4 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5517  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5518  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5519  5517  4 11:08 ?        00:00:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground
root      5520  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5521  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5522  5516  6 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5523  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5524  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5525  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5526  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5527  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5528  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5529  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5530  5516  0 11:08 ?        00:00:00 /usr/local/samba/sbin/samba
root      5534  5519  0 11:08 ?        00:00:00 /usr/local/samba/sbin/smbd -D --option=server role check:inhibit=yes --foreground
root      5537  1081  0 11:08 pts/1    00:00:00 grep samba
#

9. 動作確認
CentOS内部からSMB接続を行うテストを実施。

# /usr/local/samba/bin/smbclient --version
Version 4.1.5
# /usr/local/samba/bin/smbclient -L localhost -U%
Domain=[ADOSAKANA] OS=[Unix] Server=[Samba 4.1.5]

        Sharename       Type      Comment
        ---------       ----      -------
        netlogon        Disk
        sysvol          Disk
        IPC$            IPC       IPC Service (Samba 4.1.5)
Domain=[ADOSAKANA] OS=[Unix] Server=[Samba 4.1.5]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
#

もう1つ。
netlogon共有にAdministrator権限でアクセスできるか確認。

# /usr/local/samba/bin/smbclient //localhost/netlogon -UAdministrator -c 'ls'
Enter Administrator's password:
Domain=[ADOSAKANA] OS=[Unix] Server=[Samba 4.1.5]
  .                                   D        0  Tue Feb 25 11:06:38 2014
  ..                                  D        0  Tue Feb 25 11:06:48 2014

                35275 blocks of size 524288. 31250 blocks available
#

10.AD DNSの動作テスト
AD DNSが想定通りに動作しているかテストします。

まず、どんなzoneが登録されているのか確認

# /usr/local/samba/bin/samba-tool dns zonelist 127.0.0.1 -U Administrator
Password for [ADOSAKANA\Administrator]:
  2 zone(s) found

  pszZoneName                 : adosakana.local
  Flags                       : DNS_RPC_ZONE_DSINTEGRATED DNS_RPC_ZONE_UPDATE_SECURE
  ZoneType                    : DNS_ZONE_TYPE_PRIMARY
  Version                     : 50
  dwDpFlags                   : DNS_DP_AUTOCREATED DNS_DP_DOMAIN_DEFAULT DNS_DP_ENLISTED
  pszDpFqdn                   : DomainDnsZones.adosakana.local

  pszZoneName                 : _msdcs.adosakana.local
  Flags                       : DNS_RPC_ZONE_DSINTEGRATED DNS_RPC_ZONE_UPDATE_SECURE
  ZoneType                    : DNS_ZONE_TYPE_PRIMARY
  Version                     : 50
  dwDpFlags                   : DNS_DP_AUTOCREATED DNS_DP_FOREST_DEFAULT DNS_DP_ENLISTED
  pszDpFqdn                   : ForestDnsZones.adosakana.local
#

Active Directoryで使用するDNSのSRVレコードが登録されているか確認。

# host -t SRV _ldap._tcp.adosakana.local 127.0.0.1
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

_ldap._tcp.adosakana.local has SRV record 0 100 389 adcent6.adosakana.local.
# host -t SRV _kerberos._udp.adosakana.local 127.0.0.1
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

_kerberos._udp.adosakana.local has SRV record 0 100 88 adcent6.adosakana.local.
#

ADサーバのホスト名が登録されているか確認

# host -t A adcent6.adosakana.local 127.0.0.1
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

adcent6.adosakana.local has address 172.17.44.216
#

11. DNSサーバの変更
ADサーバの/etc/resolv.confを、ADサーバ自身を使う様に書き換え

12. /etc/krb5.conf の変更
/usr/local/samba/private/krb5.conf にあるので、それを使用する。

# cat /usr/local/samba/private/krb5.conf
[libdefaults]
        default_realm = ADOSAKANA.LOCAL
        dns_lookup_realm = false
        dns_lookup_kdc = true
# cp /usr/local/samba/private/krb5.conf /etc/krb5.conf
cp: `/etc/krb5.conf' を上書きしてもよろしいですか(yes/no)? y
#

13. Kerberosの動作確認

# kinit administrator@ADOSAKANA.LOCAL
Password for administrator@ADOSAKANA.LOCAL:
Warning: Your password will expire in 41 days on Tue Apr  8 11:06:46 2014
#

正常に設定されていれば、Administratorユーザのパスワード有効期限が表示されます。

例えば、DNSサーバの指定が誤っていると、以下のエラーとなります。

# kinit administrator@ADOSAKANA.LOCAL
kinit: Cannot resolve servers for KDC in realm "ADOSAKANA.LOCAL" while getting initial credentials
#

これは、kinitは、DNSサーバに登録されているkerberos関連のSRVレコードを読みにいくためです。

# kinit administrator@adosakana.local
kinit: KDC reply did not match expectations while getting initial credentials
#

こっちのメッセージがでる場合は、ドメイン名を小文字で指定していることが原因です。
大文字で指定し直します。

なお、kinitではなく、「klist」コマンドで一覧表示も可能です。

# klist
Ticket cache: FILE:/tmp/krb5cc_0
Default principal: administrator@ADOSAKANA.LOCAL

Valid starting     Expires            Service principal
02/25/14 11:42:49  02/25/14 21:42:49  krbtgt/ADOSAKANA.LOCAL@ADOSAKANA.LOCAL
        renew until 03/04/14 11:42:46
#

以上で、Active Directoryサーバとしての設定は終了でした。

このあと、Windows Server 2012を、この作成したばかりのADOSAKANA.LOCALに参加させたところ、正常に参加できました。


2014/05/08追記

この手順で作成した場合、ドメイン/フォレストの機能レベルは「Windows Server 2003」になります。
samba 4.1.7においては、「Windows Server 2008 R2」まで上げることができます。
手順については、「samba 4.xでドメイン/フォレストの機能レベルを変更する」にて解説しています。

hpe ProLiantをLinuxで使う場合にインストールするService Pack for ProLiantについて 2024/02/27修正


2024/02/27修正

hpe ProLiant DL360Gen10サーバにLinuxをインストールする機会があったので検証した

設定するレポジトリについて

最初に確認すべきWeb「hpe Software Delivery Repository一覧

HPE特有の管理ソフトについては「Service Pack for ProLiantレポジトリ(spp)」か「Management Component Packレポジトリ(mcp)」を使う。

sppはRHEL純正かSLES純正。mcpはそれ以外のLinux向けとなる。

mcpで対応してるLinuxについてはmcpレポジトリツリー を開き、存在しているディレクトリを確認する。AlmaLInux, CentOS, Debian, OracleLinux, Rocky Linux, Ubuntuはmcpを使う。

sppとmcpでの大きな違いはfirmwareアップデートを行うSUMはsppのみで提供、というところ。

ただ、試してみたところ、spp、SUMともにAlmaLinuxに対して適用自体は可能だった。

Service Pack for ProLiant(spp)レポジトリ

RHEL純正、SLES純正の場合に使用するのがService Pack for ProLiant(spp)

Gen10サーバ RHEL8だったら/etc/yum.repos.d/spp.repoは

[spp]
name=Service Pack for ProLiant
baseurl=https://downloads.linux.hpe.com/SDR/repo/spp-gen10/redhat/8/x86_64/current/
enabled=1
gpgcheck=1
gpgkey=https://downloads.linux.hpe.com/repo/spp/GPG-KEY-spp

Gen10サーバ RHEL9だったら/etc/yum.repos.d/spp.repoは

[spp]
name=Service Pack for ProLiant
baseurl=https://downloads.linux.hpe.com/SDR/repo/spp-gen10/redhat/9/x86_64/current/
enabled=1
gpgcheck=1
gpgkey=https://downloads.linux.hpe.com/repo/spp/GPG-KEY-spp

sppレポジトリだとProLiantサーバのBIOSやiLOなどのfirmware アップデート系も提供されているが、firmware適用の仕組みはこちらでは提供されず、SUMレポジトリにあるsmartupdateコマンドを使う・・・模様

Management Component Pack(mcp)レポジトリ

sppに対応していないLinuxディストリビューションはManagement Component Pack(mcp)を使う

説明にかかれているbaseurlはhttpで指定されているが、httpsでも問題ないので、いま設定するのであればhttpsにしておくべきかと思われる

AlmaLinux9の場合の/etc/yum.repos.d/mcp.repo

[mcp]
name=Management Component Pack
baseurl=https://downloads.linux.hpe.com/repo/mcp/Alma/9/x86_64/current/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/GPG-KEY-mcp

RockyLinux 9の場合の/etc/yum.repos.d/mcp.repo

[mcp]
name=Management Component Pack
baseurl=https://downloads.linux.hpe.com/repo/mcp/Rocky/9/x86_64/current/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/GPG-KEY-mcp

Smart Update Manager(sum)レポジトリとFirmware Pack for ProLiant(fwpp)レポジトリ

ProLiantサーバのfirmwareを含むソフトウェア管理ソフトのUIがSmart Update Manager(sum/hpsum)

数ヶ月ごとにリリースされるISOでfirmware一括提供されているが、コマンドとして提供されているのもある。

コマンドとして使う場合に組み合わせて使うのがFirmware Pack for ProLiant(fwpp)レポジトリ

RHEL9の /etc/yum.repos.d/sum.repo

[sum]
name=HPE Smart Update Manager
baseurl=http://downloads.linux.hpe.com/repo/sum/rhel/9/x86_64/current/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/GPG-KEY-sum

RHELでgen10サーバ向けの /etc/yum.repos.d/fwpp.repo

[fwpp]
name=Firmware Pack for ProLiant
baseurl=https://downloads.linux.hpe.com/SDR/repo/fwpp-gen10/current/
enabled=1
gpgcheck=1
gpgkey=https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub

各パッケージの動作

いろいろあるが、おそらくインストールした方がよいコマンドについて

Gen10以降のサーバであれば以下のパッケージで、これらはspp,mcpレポジトリ共通
・hponcfg iLOの管理コマンド
・amsd iLOとOS間の情報連携サービス
・ssacli SmartArrayの管理コマンド
・ssaducli SmartArrayの管理コマンドdiag系
・ssa SmartArrayの管理サービス
・storcli MegaRAIDの管理コマンド

RHEL純正の場合でfirmwareアップデートもコマンドである程度できるようにした場合はsumレポジトリで提供される
・sum SmartUpdateManager関連(smartupdateコマンド)

また、hpeの監視ソフトOneViewと連携する場合、sppレポジトリで提供される下記もあった方がよい?
・sut OneView向けコマンド

OS側のパッケージについて

OS側のパッケージで必要となるものがいくつかあったので、セットアップ時に追加しておくとよいもの

# dnf install tar gzip unzip net-tools pciutils yum-utils

NFSマウントする場合に追加するパッケージ

# dnf install nfs-utils

amsd

ProLiant Gen9以降でiLOとOS間で情報連携を行うために使用するのがHPE Agentless Management Service(amsd)

amsdはsppとmcpで提供されている。

これがインストールされていない場合、例えば[システム情報]-[ネットワーク]で下記のような表示となる。

amsdをインストールして起動すると表示が変わる。

[root@src78bccafcd ~]# dnf install amsd
サブスクリプション管理リポジトリーを更新しています。
コンシューマー識別子を読み込めません

このシステムは、エンタイトルメントサーバーに登録されていません。subscription-manager で登録できます。

メタデータの期限切れの最終確認: 3:58:41 前の 2024年02月26日 15時14分46秒 に実施 しました。
依存関係が解決しました。
================================================================================
 パッケージ    Arch            バージョン                    リポジトリー サイズ
================================================================================
インストール:
 amsd          x86_64          3.3.0-1773.7.rhel9            spp          2.2 M

トランザクションの概要
================================================================================
インストール  1 パッケージ

ダウンロードサイズの合計: 2.2 M
インストール後のサイズ: 4.5 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
amsd-3.3.0-1773.7.rhel9.x86_64.rpm               28 kB/s | 2.2 MB     01:19
--------------------------------------------------------------------------------
合計                                             28 kB/s | 2.2 MB     01:19
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1
  scriptletの実行中: amsd-3.3.0-1773.7.rhel9.x86_64                         1/1
  インストール中   : amsd-3.3.0-1773.7.rhel9.x86_64                         1/1
  scriptletの実行中: amsd-3.3.0-1773.7.rhel9.x86_64                         1/1
Please read the Licence Agreement for this software at

         /opt/amsd/amsd.license

By not removing this package, you are accepting the terms
of the "Software End User License Agreement".

  検証             : amsd-3.3.0-1773.7.rhel9.x86_64                         1/1
インストール済みの製品が更新されています。

インストール済み:
  amsd-3.3.0-1773.7.rhel9.x86_64

完了しました!
[root@src78bccafcd ~]# systemctl status amsd
● amsd.service - Agentless Management Service daemon
     Loaded: loaded (/usr/lib/systemd/system/amsd.service; enabled; preset: ena>
     Active: active (running) since Mon 2024-02-26 19:15:14 EST; 22s ago
   Main PID: 80680 (amsd)
      Tasks: 1 (limit: 1644913)
     Memory: 9.5M
        CPU: 203ms
     CGroup: /system.slice/amsd.service
             mq80680 /sbin/amsd -f

 2月 26 19:15:14 src78bccafcd systemd[1]: Starting Agentless Management Service>
 2月 26 19:15:14 src78bccafcd amsd[80680]: amsd Started . .
 2月 26 19:15:14 src78bccafcd systemd[1]: Started Agentless Management Service >
[root@src78bccafcd ~]#

amsd起動後、すぐにiLO Webに反映されるわけではないようで、1分ぐらいかかった

smartupdateコマンド

sumレポジトリで提供されるsumパッケージのコマンドsmartupdate

RHELとSLES専用とあるが、2024年2月27時点ではAlmaLinuxでもそれなりに動作していた。

レポジトリ説明ページにはFirmware Pack for ProLiantと組み合わせ以下を実行する、とある

# yum install $(smartupdate requires)
# smartupdate list
# smartupdate upgrade

ただ、こちらの環境で試した限りでは「yum install $(smartupdate requires)」ではパッケージのインストールには失敗していた。

「smartupdate requires」で出力される内容と「dnf –disablerepo=”*” –enablerepo=”fwpp” list available」で出力されるfwppレポジトリで提供されるパッケージ一覧を比較すると、別にそれほど選別してパッケージを選んでいるわけでもなかったので、以下をインストールした。

まず、ProLiantサーバのROMの番号?を「smartupdate list」コマンドを実行して確認

[root@src78bccafcd ~]# smartupdate list
sum : Smart Update Manager Version 10.6.3
Model: ProLiant DL360 Gen10, ROM: U32, ROM Version: 07/20/2023
-------------------------------------------------------------------------------------------------------------------
Searching for firmware
ERROR   :
No firmware found
Did you install software using using yum/zypper/apt
ERROR   :
No firmware found
Did you install software using using yum/zypper/apt
ERROR   :
No firmware found
Did you install software using using yum/zypper/apt
ERROR   :
No firmware found
Did you install software using using yum/zypper/apt
[root@src78bccafcd ~]#

「ROM: U32」とあるので、「dnf info firmware-system-u32」と実行してパッケージがあっているか確認

[root@src78bccafcd ~]# dnf info firmware-system-u32
サブスクリプション管理リポジトリーを更新しています。
コンシューマー識別子を読み込めません

このシステムは、エンタイトルメントサーバーに登録されていません。subscription-manager で登録できます。

メタデータの期限切れの最終確認: 0:13:02 前の 2024年02月26日 19時51分12秒 に実施しました。
インストール済みパッケージ
名前         : firmware-system-u32
バージョン   : 2.90_2023_07_20
リリース     : 1.1
Arch         : x86_64
サイズ       : 33 M
ソース       : firmware-system-u32-2.90_2023_07_20-1.1.src.rpm
リポジトリー : @System
repo から    : spp
概要         : HPE ProLiant DL360 Gen10 (U32) Servers firmware
URL          : http://www.hpe.com/info/proliantlinux
ライセンス   : 2012 Hewlett Packard Enterprise Development LP
説明         : This package contains the HPE ProLiant DL360 Gen10 (U32) Servers firmware

[root@src78bccafcd ~]#

きちんとProLiant DL360 Gen10サーバであることを確認できた。このほか、firmwareのダウンロード時間を考慮しないのであれば、下記のようにアスタリスク指定でとりあえず全部インストールしてしまってもよいかもしれない

# dnf install firmware-system-u32
# dnf install  firmware-ilo5 firmware-sps* firmware-nic* firmware-powerpic* firmware-smartarray* firmware-hdd*

インストールが終わってから「smartupdate list」を実行すると下記のような表示となる

# smartupdate list
sum : Smart Update Manager Version 10.6.3
Model: ProLiant DL360 Gen10, ROM: U32, ROM Version: 07/20/2023
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Searching for firmware............................................................................................................................................
Analyzing results............................................................................................................................................

ifr-1  | system-u32                          | 2.90_07-20-2023 | 2.90_07.20.2023    | system         |
ierd1  | spsgen10                            | 04.01.05.002 | (details below) | sps            |
       | - SPS_Gen10                         |              |                 |                |
       | --> SPS                             | 04.01.05.002 | 4.1.5.2         |                |
ifRU1  | powerpic-gen10                      | 1.1.0        | (details below) | powerpic       |
       | - PowerPIC-Gen10                    |              |                 |                |
       | --> PMC                             | 1.1.0        | 1.0.8           |                |
ifr-1  | iegen10                             | 0.2.3.0      | (details below) | ie             |
       | - IE-Gen10                          |              |                 |                |
       | --> IE                              | 0.2.3.0      | 0.2.3.0         |                |
ifRU1  | smartarray-f7c07bdbbd               | 6.52         | (details below) | smartarray     |
       | - AC_2814397937                     |              |                 |                |
       | --> firmware                        | 6.52         | 6.22            |                |
ifr--  | nic-is-intel                        | 1.29.0       |                 | nic            |
ifRU1  | nic-intel                           | 1.29.0       | (details below) | intel_nic      |
       | - eno5                              |              |                 |                |
       | --> EPROM                           | 0.0.800011A1 | 0.0.800011A1    |                |
       | --> EPROM                           | 0.0.800011A1 | 0.0.800011A1    |                |
if-U1  | ilo5                                | 3.01         | (details below) | ilo5           |
       | - RI11                              |              |                 |                |
       | --> iLO                             | 3.01         | 2.98 (10/10/2023)    |                |
#

ただ、実験した環境では下記のようにエラーとなり、アップデートの実施には失敗した。

# smartupdate upgrade
sum : Smart Update Manager Version 10.6.3
Model: ProLiant DL360 Gen10, ROM: U32, ROM Version: 07/20/2023
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Searching for firmware............................................................................................................................................
Analyzing results............................................................................................................................................

unable to download http://ftp.iij.ad.jp/pub/linux/almalinux/9.3/AppStream/x86_64/os/ get_sdr_url
unable to download http://ftp.iij.ad.jp/pub/linux/almalinux/9.3/BaseOS/x86_64/os/ get_sdr_url
unable to download http://ftp.iij.ad.jp/pub/linux/almalinux/9.3/extras/x86_64/os/ get_sdr_url
unable to download https://downloads.linux.hpe.com/repo/spp-gen10/redhat/9/x86_64/current/ get_sdr_url
unable to download https://downloads.linux.hpe.com/repo/sum/rhel/9/x86_64/current/ get_sdr_url
Unable to download pre-requisite component 'firmware-ilo5-sha512-3.01-1.1.x86_64'
Unable to download pre-requisite component 'firmware-ilo5-1.48-1.1.x86_64'
Unable to download pre-requisite component 'firmware-ilo5-1.45-1.1.x86_64'
Unable to download pre-requisite component 'firmware-ilo5-1.40-1.1.x86_64'
Warning: Installing the latest available iLO version requires the minimum iLO 1.4x version and sha512-2.x component to be installed on the server which is not available in the currently configured repo.
 Warning - Firmware update is being performed on the target system whose OS is not supported by SPP baseline. Proceeding further may result in potential issues. It is not recommended to continue with the updates using this baseline. Please select a different supported baseline for this server. To proceed with the updates using this baseline at your own risk, select Ignore Warnings option.

To allow SUM to proceed, use: smartupdate upgrade --ignore-warnings
# smartupdate upgrade --ignore-warnings
sum : Smart Update Manager Version 10.6.3
Model: ProLiant DL360 Gen10, ROM: U32, ROM Version: 07/20/2023
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Searching for firmware............................................................................................................................................
Analyzing results............................................................................................................................................

unable to download http://ftp.iij.ad.jp/pub/linux/almalinux/9.3/AppStream/x86_64/os/ get_sdr_url
unable to download http://ftp.iij.ad.jp/pub/linux/almalinux/9.3/BaseOS/x86_64/os/ get_sdr_url
unable to download http://ftp.iij.ad.jp/pub/linux/almalinux/9.3/extras/x86_64/os/ get_sdr_url
unable to download https://downloads.linux.hpe.com/repo/spp-gen10/redhat/9/x86_64/current/ get_sdr_url
unable to download https://downloads.linux.hpe.com/repo/sum/rhel/9/x86_64/current/ get_sdr_url
Unable to download pre-requisite component 'firmware-ilo5-sha512-3.01-1.1.x86_64'
Unable to download pre-requisite component 'firmware-ilo5-1.48-1.1.x86_64'
Unable to download pre-requisite component 'firmware-ilo5-1.45-1.1.x86_64'
Unable to download pre-requisite component 'firmware-ilo5-1.40-1.1.x86_64'
Warning: Installing the latest available iLO version requires the minimum iLO 1.4x version and sha512-2.x component to be installed on the server which is not available in the currently configured repo.

The following firmware will be applied:
    Online ROM Flash Component for Linux - HPE Integrated Lights-Out 5   [3.01]
    HPE Intel Online Firmware Upgrade Utility Linux x86_64 for HPE ProLiant Gen9 and Gen10 server series Only.   [1.29.0]


The following firmware will be skipped (Use --downgrade or use --rewrite to apply.)
    Online ROM Flash Component for Linux - HPE ProLiant DL360 Gen10 (U32) Servers   [U32 2.90 - (07/20/2023)]
    Online ROM Flash for Linux - HPE Gen10 Innovation Engine Firmware for HPE Gen10 Servers   [0.2.3.0]
    Online ROM Flash for Linux - Server Platform Services (SPS) Firmware for HPE Gen10 Servers   [04.01.05.002]
Do you want to apply them? [y] : y

Deploy accepted successfully.

ERROR: Deployment failed to complete. Check SUM logs for more details...
#

firmwareの手動適用は /usr/lib/x86_64-linux-gnu/ に firmware-??? というディレクトリが作成されているので、各ディレクトリの中にある「hpsetup」を実行することでアップデートが実施できる

たとえば、firmware-powerpic-gen10-1.1.0-1.1 をアップデートした場合

[root@xxxxx x86_64-linux-gnu]# cd firmware-powerpic-gen10-1.1.0-1.1
[root@xxxxx firmware-powerpic-gen10-1.1.0-1.1]# ls
CP057798.xml  FultonHdr.signed.hex  LICENSE.txt  hpsetup  payload.json  setup
[root@xxxxx firmware-powerpic-gen10-1.1.0-1.1]# ./hpsetup
Flash Engine Version: 2.5.0.0

Name: Online ROM Flash for Linux - Advanced Power Capping Microcontroller Firmware for HPE Gen10 and Gen10 Plus Servers
New Version: 1.1.0

Current Version: 1.0.8

The software is installed but is not up to date.

Do you want to upgrade the software to a newer version (y/n) ?y

Flash in progress -- Do not interrupt or your system may become unusable.
Working..............................................................................

The installation procedure completed successfully.
[root@xxxxx firmware-powerpic-gen10-1.1.0-1.1]#



2023/10/02修正

hp ProLiantをLinuxで使う場合にインストールする管理ソフトウェア集について、HPE公式でいくつか記事が書かれていた

・「HPE Linux技術情報サイトの歩き方~CentOS代替ディストビューション情報について~
・「Linux用管理ツールについての技術情報

RHELではなく、RockLinux, AlmaLinux, OracleLinuxなどで、RHEL向け管理ソフトを使ってよいのか?ということについて記載されている。

管理ソフトウェアについては「MCP – Management Component Pack」(英語 SDR Management Component Pack)を使用する。
こちらについてはHPE Support契約は必要がなく使える。

ドライバについては「Service Pack for ProLiant」に含まれているドライバを使用することもできるが、手動でrpmをインストールする必要がある
ISOとしてのSPPは「Gen11 Service Pack for ProLiant」「Gen10 Service Pack for ProLiant」からダウンロードできるが、サポート契約が必要

firmwareアップデートについては「Service Pack for ProLiant」を使用するが、SPPメディアで起動してアップデートを行うオフライン方式で対応

RHELユーザの場合はSDR Service Pack for ProLiant が使える。以前はサポート登録が必要だったが、2023/10現在「Software Delivery Repositoryのプロジェクト一覧」で「auth req’d」表示が無くなっているということは登録しなくても使えるようになった?

Firmware Pack for ProLiant (gen11), Firmware Pack for ProLiant (gen10) にもauth req’dがないから使える?

GUIでfirmwareアップデートを行うためのSmart Update Manager(SUM)については「Smart Update Manager(SUM)についての技術情報


以下は資料用の古い内容


2021/08/02 リンク先修正

hp ProLiantをLinuxで使う場合、Service Pack for ProLiantという追加ドライバ&管理ソフトウェア集をインストールする・・・ということになっている。

製品ページ:Service Pack for ProLiant(SPP) / Smart Update Manager(SUM) v6.x
Service Pack for ProLiant(SPP) / Smart Update Manager(SUM) v8

基本的にはisoイメージで配布されており、ディストリビューション特化型の縮小版がtar.gzでも配布されている。
それぞれ、中に「hpsum」というパッケージインストール用フロントエンドプログラム(Smart Update Manager/SUM)が入っているので、それを実行して、インストールを行うことになる。

詳細についてはSUM: Smart Update Manager hpsum v6.2対応環境とインストール方法についてSUM: Smart Update Manager hpsum v6.3.1対応環境とインストール方法について」「Service Pack for ProLiant 2021.04.0/05.0対応環境とインストール方法について」を参照のこと。

で・・・hp USAのページを見ていたらhp Software Delivery RepositoryHPE Software Delivery Repository」なんてものを発見。

RHEL/CentOSであれば、yumコマンドでhpの管理系ソフトウェアがインストールできるようになるらしい。
対応している管理ソフトウェアは、以下のものらしい。

Browse repository Project & subscription information Contents
spp Service Pack for ProLiant Drivers, agent software, firmware for RedHat and SLES
mcp Management Component Pack for ProLiant Agent software for Ubuntu, Oracle and community distros
isp Integrity Support Pack Agent software for RedHat and SLES on IA64
iwbem Integrity WBEM Providers WBEM providers for RedHat and SLES on IA64
mlnx_ofed Mellanox OFED VPI Drivers and Utilities Mellanox OFED VPI for RedHat and SLES
vibsdepot VMware® ESXi bundles Drivers and vibs for VMWare®
hpsum HP Smart Update Manager Software to update firmware and drivers on RedHat and SLES
stk HP ProLiant Scripting Toolkit Useful commands for scripting/automating ProLiant hardware

このレポジトリを使って、Service Pack for ProLiantをインストールする手順はSubscribe your system to the spp repositorySubscribe your system to the spp repository」か、もしくはLinux best practices using HP Service Pack for ProLiant (SPP) and Software Delivery Repository (SDR)Linux best practices using HP Service Pack for ProLiant (SPP) and Software Delivery Repository (SDR)」 で紹介されている。

RHEL6でUpdateのバージョンを固定するには?


2022/09/02追記: AlmaLinux / Rocky Linuxのリリースバージョン固定方法Oracle Linux 8でリリースバージョン固定する方法

RedHat Enterprise Linux (RHEL) version6にて、Updateバージョンを固定する方法として「/etc/yum/vars/releasever」に値を指定する、もしくは、yumコマンド実行時に「–releasever=値」オプションを付加して実行する、というものがある。

が・・・
うちの環境で、これらを指定しても、常に最新のUpdate5まで上がってしまうという現象が発生していた。

原因
RHEL6環境でのreleaseverオプションは、subscription-manager(Red Hat Subscription Management)経由でサブスクリプションを登録した時のみ有効となる。

rhn_register(RHN Classic)で登録した場合は、使用できない。

RHN Classicで登録してしまっている場合は、Subscription Managementに切り替える必要がある。

RHN Classic と Red Hat Subscription Management の違いは何ですか?」に移行方法や各コマンドの対応表が掲載されていますが、releaseverオプションの制約事項について、Googleの見える範囲で公開されているような感じは無い模様・・・
隠し仕様すぎじゃないですかねぇ^^;;


この件について、根拠を聞かれた・・・

`yum –releasever` オプションの利用方法」(英語版:「How to use `yum –releasever` option」)

上記にて言及されているようですよ


おまけ
subscription-managerの使用方法

1. proxyを使う場合は設定

# subscription-manager config --server.proxy_hostname=IPアドレス --server.proxy_port=ポート番号
#

設定値の確認は以下で行う

#

2. システムをアカウントに登録

# subscription-manager register
ユーザー名: ユーザ名
パスワード: パスワード
システムは id で登録されています: <ID>
#

3. 登録状態を確認

# subscription-manager list
+-------------------------------------------+
インストールしている製品の状態
+-------------------------------------------+
製品名:                 Red Hat Enterprise Linux Server
製品 ID:                69
バージョン:                     6.5
アーキテクチャ:                         x86_64
状態:                   サブスクライブしていません
開始日:
終了日:
#

4. 利用できるサブスクリプション一覧を表示

#subscription-manager list --available
+-------------------------------------------+
    利用可能なサブスクリプション
+-------------------------------------------+
サブスクリプション名:           Red Hat Enterprise Linux Server, Premium (1-2 sockets)
                        (Up to 4 guests)
SKU:                    RH0<ID>
プール Id:                      <ID>
数量:                   7
サービスレベル:         PREMIUM
サービスタイプ:                 L1-L3
複数エンタイトルメント:         No
終了日:                         2015年02月02日
システムのタイプ:               物理

サブスクリプション名:           Red Hat Enterprise Linux Server, Premium (1-2 sockets)
                        (Unlimited guests)
SKU:                    RH0<ID>
プール Id:                      <ID>
数量:                   1
サービスレベル:         PREMIUM
サービスタイプ:                 L1-L3
複数エンタイトルメント:         No
終了日:                         2015年02月02日
システムのタイプ:               物理

サブスクリプション名:           Red Hat Enterprise Linux Server, Premium (1-2 sockets)
                        (Up to 1 guest)
SKU:                    RH0<ID>
プール Id:                      <ID>
数量:                   4
サービスレベル:         PREMIUM
サービスタイプ:                 L1-L3
複数エンタイトルメント:         No
終了日:                         2015年02月02日
システムのタイプ:               物理
#

5. サブスクリプションの割り当て実施
上記の一覧から使用したいものを選び、その「プールId」を指定してattachを実行します。

# subscription-manager attach --pool <ID>
サブスクリプションが正しく割り当てられました: Red Hat Enterprise Linux Server, Premium (1-2 sockets) (Up to 1 guest)
#

6. 登録されたことを確認
「状態: サブスクライブ済み」となっていることを確認

# subscription-manager list
+-------------------------------------------+
インストールしている製品の状態
+-------------------------------------------+
製品名:                 Red Hat Enterprise Linux Server
製品 ID:                69
バージョン:                     6.5
アーキテクチャ:                         x86_64
状態:                   サブスクライブ済み
開始日:                 2014年02月02日
終了日:                         2015年02月02日
#

7. 完了

CentOS6ベースでカスタムLiveCDを作る



CentOS6ベースでカスタムLiveCDを作ろうとして、何点か悩んだ。
(「CentOS6でカスタムインストールDVD作成」という記事もあります)

BIOSブートで悩んだ点
・ブートオプションに「quiet rhgb」がついていると画面がちゃんと表示されない
  → isolinux/isolinux.cfg を編集して対処

EFIブートで悩んだ点
・grubより先に進まない
001
上記の画面のまま進まない。

ブート選択を表示させてから、「b」でブートしようとすると、黒画面になるが、キーを何か入力するとgrubに戻る状態

→ LiveCDのisoファイルのEFI/BOOT/grub.confを見るとgrub.conf内の指定が「EFI/boot/~」
 大文字小文字の違いにより必要なファイルがとってこれていない模様

そんな訳で、最終的に作成できたKickStart用ファイルは以下となります。

lang en_US.UTF-8
#keyboard us
keyboard jp106
#timezone US/Eastern
timezone --utc Asia/Tokyo
auth --useshadow --enablemd5
selinux --enforcing
firewall --disabled
rootpw --plaintext password

#repo --name=base   --baseurl=ftp://ftp.redhat.com/pub/redhat/rhel/beta/6Server-beta2/$basearch/os/
#repo --name=base   --baseurl=http://mirror.centos.org/centos/6/os/$basearch
repo --name=base   --baseurl=http://ftp.riken.jp/Linux/centos/6/os/$basearch
repo --name=update --baseurl=http://ftp.riken.jp/Linux/centos/6/updates/$basearch
repo --name=epel   --baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch

%packages
@core
anaconda-runtime
bash
kernel
syslinux
passwd
policycoreutils
chkconfig
authconfig
rootfiles

%end

%post --nochroot

cat > /root/postnochroot-install << EOF_postnochroot
sed -i "s/ quiet / /"             \$LIVE_ROOT/isolinux/isolinux.cfg
sed -i "s/ rhgb / /"              \$LIVE_ROOT/isolinux/isolinux.cfg
#
sed -i "s/ quiet / /"             \$LIVE_ROOT/EFI/BOOT/isolinux.cfg
sed -i "s/ rhgb / /"              \$LIVE_ROOT/EFI/BOOT/isolinux.cfg
sed -i "s/\/EFI\/boot\//\/EFI\/BOOT\//"    \$LIVE_ROOT/EFI/BOOT/isolinux.cfg
sed -i "s/ quiet / /"             \$LIVE_ROOT/EFI/BOOT/grub.conf
sed -i "s/ rhgb / /"              \$LIVE_ROOT/EFI/BOOT/grub.conf
sed -i "s/\/EFI\/boot\//\/EFI\/BOOT\//"    \$LIVE_ROOT/EFI/BOOT/grub.conf
sed -i "s/ quiet / /"             \$LIVE_ROOT/EFI/BOOT/BOOTX64.conf
sed -i "s/ rhgb / /"              \$LIVE_ROOT/EFI/BOOT/BOOTX64.conf
sed -i "s/\/EFI\/boot\//\/EFI\/BOOT\//"    \$LIVE_ROOT/EFI/BOOT/BOOTX64.conf

EOF_postnochroot

/bin/bash -x /root/postnochroot-install 2>&1 | tee /root/postnochroot-install.log

%end

このファイルの原型は「https://projects.centos.org/trac/livecd/browser/trunk/CentOS6」にあるrhel6beta-livecd-minimal.ksです。
「post –nochroot」のところはrhel6beta-livecd-desktop.ksを参考にしています。

主な変更点
・レポジトリ指定をCentOS+EPEL
・rootパスワードは「password」とする
・タイムゾーンとキーボードを日本向け
・langは、コンソールで使うため英語のまま

isoイメージ作成の手法については「Creating a LiveCD image」にあるとおり。

# LANG=C livecd-creator --config=livecd.ks --fslabel=CentOS-minimal

で実行しています。