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

で実行しています。

USB電力計 サンワサプライ TAP-TST10をLinuxで使ってみた

サンワサプライから発売された「ワットモニターUSB TAP-TST10」というUSB接続タイプの電力計をLinuxで使ってみた。

埜中公博さんの「SANWA SUPPLY TAP-TST10 control tool」を使ってデータ取得しました。
githubにある「taptst10ctl.py」をCentOS6で動作させてみました。
(2013/11/19: 公開場所が変わりました「https://github.com/nonakap/taptst10ctl」。USBのデバイスへのアクセス手法の違いで「taptst10ctl.py」と「taptst10ctl0.py」があります)

# python taptst10ctl.py
Traceback (most recent call last):
  File "taptst10ctl.py", line 42, in <module>
    import usb.core
ImportError: No module named usb.core
#

あー・・・pyusbが入ってないからか・・・
pyusb-1.0.0a2.zipをダウンロードしてきて「python setup.py install」

# python taptst10ctl.py
Traceback (most recent call last):
  File "taptst10ctl.py", line 60, in <module>
    dev.set_configuration()
  File "/usr/lib/python2.6/site-packages/usb/core.py", line 547, in set_configuration
    self._ctx.managed_set_configuration(self, configuration)
  File "/usr/lib/python2.6/site-packages/usb/core.py", line 92, in managed_set_configuration
    self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
  File "/usr/lib/python2.6/site-packages/usb/backend/libusb10.py", line 503, in set_configuration
    _check(_lib.libusb_set_configuration(dev_handle, config_value))
  File "/usr/lib/python2.6/site-packages/usb/backend/libusb10.py", line 403, in _check
    raise USBError(_str_error[ret], ret, _libusb_errno[ret])
usb.core.USBError: [Errno 16] Resource busy
#

「Resource busy」と何か別のプログラムが使っているらしい。

USBRH driver for Linux を CentOS 5 で使う」で紹介されている手法、手動でusbhidの認識を解除してみる方法を行ってみた。

# cd /sys/bus/usb/drivers/usbhid
#  ls -l
lrwxrwxrwx 1 root root    0  7月 17 09:38 2013 4-2:1.0 -> ../../../../devices/pci0000:00/0000:00:12.1/usb4/4-2/4-2:1.0
--w------- 1 root root 4096  7月 17 09:25 2013 bind
lrwxrwxrwx 1 root root    0  7月 17 09:25 2013 module -> ../../../../module/usbhid
--w------- 1 root root 4096  7月 17 09:25 2013 new_id
--w------- 1 root root 4096  7月 17 09:25 2013 remove_id
--w------- 1 root root 4096  7月 17 09:25 2013 uevent
--w------- 1 root root 4096  7月 17 09:25 2013 unbind
# echo "4-2:1.0" > unbind
# ls
bind  module  new_id  remove_id  uevent  unbind
#

これでusbhidを解除できたので、改めて実行。

# .taptst10ctl.py
No.,DateTime,Watt,kWh
1,2013/07/13 07:50,0.0,0.00
2,2013/07/13 08:00,47.0,0.00
3,2013/07/13 08:10,44.8,0.01
4,2013/07/13 08:20,18.5,0.01
5,2013/07/13 08:30,18.5,0.01
6,2013/07/13 08:40,18.1,0.02
<略>
637,2013/07/17 18:00,87.4,2.76
638,2013/07/17 18:10,83.8,2.78
639,2013/07/17 18:20,83.3,2.79
640,2013/07/17 18:30,82.8,2.80
641,2013/07/17 18:40,80.9,2.82
#

ちなみに、時々、以下のような感じで実行に失敗します。
その場合は、再実行すれば、だいたい大丈夫です。

# ./taptst10ctl.py
Traceback (most recent call last):
  File "./taptst10ctl.py", line 92, in <module>
    data = dev.read(ENDPOINT, 17, intf, 1000)
  File "/usr/lib/python2.6/site-packages/usb/core.py", line 654, in read
    self.__get_timeout(timeout)
  File "/usr/lib/python2.6/site-packages/usb/backend/libusb10.py", line 559, in intr_read
    timeout)
  File "/usr/lib/python2.6/site-packages/usb/backend/libusb10.py", line 641, in __read
    timeout))
  File "/usr/lib/python2.6/site-packages/usb/backend/libusb10.py", line 403, in _check
    raise USBError(_str_error[ret], ret, _libusb_errno[ret])
usb.core.USBError: [Errno 110] Operation timed out
#

USB電力計 サンワサプライ TAP-TST10をLinuxにつなげてみた

サンワサプライから発売された「ワットモニターUSB TAP-TST10」というUSB接続タイプの電力計っぽいのをAmazonで購入した。

ちょうどタイミングが良かったらしく、送料込みで 6082円でした。
(Amazonマーケットプレイス:NANOS-S。青森県弘前発送。発注から発送まで2日弱、到着まで+1日)

Windows8につなげたら、標準のHIDドライバだけで認識。
専用アプリを使うと、測定済みのデータが収集できる、という感じのものだった。
リアルタイム計測の表示は、専用アプリ内には見当たらなかった。

さて・・・Linuxにつなげてみますか!!

# dmesg | tail -4
usb 2-2: new full speed USB device using uhci_hcd and address 2
usb 2-2: configuration #1 chosen from 1 choice
drivers/usb/input/hid-core.c: timeout initializing reports
hiddev96,hidraw96: USB HID v1.10 Device [Weltrent Semiconductor, Inc. HID Device] on usb-0000:00:1d.0-2
# lsusb | grep Weltrend
Bus 002 Device 002: ID 040b:2201 Weltrend Semiconductor
#

なぜか「Weltrend Semiconductor」と「Weltrent Semiconductor」の2種類の表記がある。
さらに詳細をlsusb -vで見てみると下記の通りだが、検索してみたところ「Weltrend Semiconductor」が正当のようだ。

# lsusb -v -s 002:002

Bus 002 Device 002: ID 040b:2201 Weltrend Semiconductor
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x040b Weltrend Semiconductor
  idProduct          0x2201
  bcdDevice            0.02
  iManufacturer           1 Weltrent Semiconductor, Inc.
  iProduct                2 HID Device
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           50
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xa0
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      71
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
        UNRECOGNIZED:  09 21 00 01 00 01 22 47 00
#

単純にUSBで接続するにあたり、「USB HID Controller WT65xxシリーズ」を使っているだけのようで、このベンダは電力計とは直接つながりはなさそうな感じである。

# cat /proc/bus/usb/devices
<略>
T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=040b ProdID=2201 Rev= 0.02
S:  Manufacturer=Weltrent Semiconductor, Inc.
S:  Product=HID Device
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
E:  Ad=01(O) Atr=03(Int.) MxPS=  64 Ivl=1ms
<略>
#

ざっと検索してみたところ、「ID 040b:2201」というデバイスの例は見当たらないようだ。
(ID 040b:2011とかはある)

USBプロトコル解析とかになると、機材無いからできないねん・・・