PowerVC 2.1 レガシー・インストールの確認 (RHEL HA ライセンス不要のシングルノード・インストール)

### はじめに

PowerVC 2.1 が 2022年12月初旬にリリースされました。
PowerVC は IBM PowerSystems の 仮想化管理製品で VMプロビジョニング、ストレージ操作、VM管理等に使用します。
中身は OpenStack や Ansible といったOSSをベースに構成されており、OSSの進化に伴う変化の多い製品です。
(最近はストレージ周りの機能拡張が目覚ましいと思います)
IBM Cloud の PowerVS でのVMプロビジョニングにも使用されていると考えられます。



PowerVC 2.0 では シングルノードでもRHEL HA アドオン・ライセンスが必要でしたが、2.1 ではシングル・ノードでHAライセンスが不要なレガシー・インストールが可能となりました。
(一応、PoC環境等での使用推奨で本番構成には非推奨の旨がマニュアルに記載がありました。
 ただ、バージョン1.x系ではそもそもHAライセンスは不要だったので戻ってよかったと思います...)



下記の 2.0 の導入手順を元に、シングル・ノードでの導入方法の違いを確認します。

https://qiita.com/c_u/items/41e87f5d0e0417c74395


---
### PowerVC 2.1 新機能ピックアップ


新機能を一部抜粋します。全量、詳細はマニュアルをご確認ください。

・OpenStack は Yoga ベースです。
・RHEL 9.0 でPowerVCの導入をサポート
・「トポロジー」機能の追加　
　　仮想マシン - 　VIOS - ファブリック(SANスイッチ) - ストレージ までの接続が可視化されています。
・HMC の非hscrootでの登録が可能
・仮想マシン・ダンプ再始動のサポート
・RHEL HAライセンスが不要のレガシー・インストールのサポート 

:::note info
**レガシー・インストールはRHEL8.6(x86_64 or ppc64le)、SLES15 SP3 (ppc64le)のみサポートです。**
:::

https://www.ibm.com/docs/ja/powervc/2.1.0?topic=powervc-whats-new-in-version-210


---

### 検証環境


・PowerVC 管理サーバー　シングルノード　: RHEL 8.6 Server with GUI (on IBM PowerSystems S824)

　OS は RHEL での導入を確認します。

----

### 導入前に必要な設定

① dnf (yum) リポジトリの構成

"BaseOS"、"AppStream"、"Supplementary" を構成します。

:::note info
**Ansible が導入モジュールに含まれており、Ansibleのdnfリポジトリー設定または事前導入が不要です。**
:::

```
# dnf repolist
Updating Subscription Management repositories.

repo id                                         repo name
dvd-AppStream                                   RHEL8_AppStream
dvd-BaseOS                                      RHEL8_BaseOS
dvd-supplement                                  RHEL8_Supplement
```


② /etc/hosts への自サーバーのエントリー記載

自サーバーで名前解決できる必要があります。


③ /etc/resolv.conf ファイルの存在

導入実行中 /etc/resolv.conf が存在しないために一度導入に失敗しましたが、空のファイルを配置することで回避できました。

```
# touch /etc/resolv.conf
```


---

### Operation Manager(OpsMgr) セットアップ


(1) モジュール・ファイルの解凍

```
# gzip -d powervc-opsmgr-rhel-ppcle-2.1.0.tgz

# ls -ltr
-rwxr-xr-x. 1 root root 1861355520 Dec 22 22:13 powervc-opsmgr-rhel-ppcle-2.1.0.tar

# tar -xvf powervc-opsmgr-rhel-ppcle-2.1.0.tar
powervc-opsmgr-2.1.0/
powervc-opsmgr-2.1.0/images/
powervc-opsmgr-2.1.0/images/RPM-GPG-KEY-PowerVC
powervc-opsmgr-2.1.0/setup_opsmgr.sh
powervc-opsmgr-2.1.0/update_opsmgr.sh
powervc-opsmgr-2.1.0/uninstall-opsmgr.sh
powervc-opsmgr-2.1.0/opsmgr-version.properties
powervc-opsmgr-2.1.0/images/powervc-install-ppcle-rhel-2.1.0.tgz
powervc-opsmgr-2.1.0/images/powervc-opsmgr.tgz
powervc-opsmgr-2.1.0/images/powervc-hmc-computeplane-rhel-2.1.0.tgz

〜 省略 〜
```

解凍後の中身

```
# ls -l
drwxr-xr-x. 2 root root     150 Dec 22 22:22 images
drwxr-xr-x. 2 root root      24 Nov 24 10:58 lap
drwxr-xr-x. 2 root root      56 Nov 24 10:58 lib
drwxr-xr-x. 3 root root      22 Nov 24 10:58 license
-rwxr-xr-x. 1 root root      59 Nov 24 10:55 opsmgr-version.properties
drwxr-xr-x. 6 root root      61 Nov 24 10:58 packages
-rwxrwx---. 1 root root   36047 Nov 24 10:55 setup_opsmgr.sh
-rwxrwx---. 1 root root    3714 Nov 24 10:55 uninstall-opsmgr.sh
-rwxrwx---. 1 root root   34057 Nov 24 10:55 update_opsmgr.sh
-r--r--r--. 1 root root      38 Nov 24 10:19 version.properties

```

PowerVC Operation Manager (OpMgr) を導入します。

参考マニュアル：

https://www.ibm.com/docs/ja/powervc/2.1.0?topic=center-initiate-installation-through-powervc-operations-manager


```
# export LANG=C
# ./setup_opsmgr.sh
################################################################################
Starting the PowerVC:setup_prepnode 2.1.0 installation on:
2022-12-23T05:16:16-05:00
################################################################################

2022-12-23T05:16:18.36-05:00 [WARNING]:[] 2.1 opsmgr will install and set default python to 3.9 at system level
Would you like to proceed?yes
2022-12-23T05:16:21.03-05:00 [INFO]:[VALIDATION] BASE DIRECTORY : /opt/ibm/powervc-opsmgr
2022-12-23T05:16:21.03-05:00 [INFO]:[VALIDATION] INSTALL SCRIPT : /work/powervc-opsmgr-2.1.0/setup_opsmgr.sh
2022-12-23T05:16:21.03-05:00 [INFO]:[VALIDATION] LOG FILE : /opt/ibm/powervc-opsmgr/log/prep_node/prep_node_2022-12-23-0516.log
2022-12-23T05:16:21.05-05:00 [INFO]:[VALIDATION] OPERATING SYSTEM: Red Hat Enterprise Linux.
2022-12-23T05:16:21.05-05:00 [INFO]:[VALIDATION] User ID : root
International Program License Agreement

Part 1 - General Terms

BY DOWNLOADING, INSTALLING, COPYING, ACCESSING, CLICKING ON
AN "ACCEPT" BUTTON, OR OTHERWISE USING THE PROGRAM,
LICENSEE AGREES TO THE TERMS OF THIS AGREEMENT. IF YOU ARE
ACCEPTING THESE TERMS ON BEHALF OF LICENSEE, YOU REPRESENT
THAT YOU HAVE FULL AUTHORITY TO BIND LICENSEE TO THESE
TERMS.

IF YOU DO NOT AGREE TO THESE TERMS OR DO NOT HAVE
AUTHORITY: i) DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, CLICK
ON AN "ACCEPT" BUTTON, OR USE THE PROGRAM; AND ii) PROMPTLY
RETURN THE UNUSED MEDIA, DOCUMENTATION, AND PROOF OF

Press Enter to continue viewing the license agreement, or
enter "1" to accept the agreement, "2" to decline it, "3"
to print it, "4" to read non-IBM terms, or "99" to go back
to the previous screen.
1
2022-12-23T05:16:26.24-05:00 [INFO]:[VALIDATION] License accepted.
2022-12-23T05:16:26.26-05:00 [INFO]:[VALIDATION] Configuring Yum repository for PowerVC-Opsmgr...
2022-12-23T05:16:27.38-05:00 [INFO]:[VALIDATION] Configuring Yum repository for PowerVC-Opsmgr rhel8...
2022-12-23T05:16:50.38-05:00 [INFO]:[VALIDATION] Installing PowerVC Ops. Manager...
2022-12-23T05:16:50.39-05:00 [INFO]:[INSTALL_POWERVC_OPSMGR] POWERVC OPSMGR PACKAGES : sshpass python3-netaddr rsync python3-oslo-i18n python3-crudini python3-powervc-opsmgr
2022-12-23T05:18:26.56-05:00 [INFO]:[INSTALL_POWERVC_OPSMGR] PowerVC Opsmgr packages installed successfully.

################################################################################
PowerVC:setup_prepnode installation completed at 2022-12-23T05:18:26-05:00.
Refer to
/opt/ibm/powervc-opsmgr/log/prep_node/prep_node_2022-12-23-0516.log
for more details.
################################################################################
#
```

無事導入完了。
実行所要時間は 〜 3分くらいでした。

powervc-opsmgr コマンドが導入されていることを確認

```
# which powervc-opsmgr
/usr/bin/powervc-opsmgr

# powervc-opsmgr -h
usage: powervc-opsmgr [-h] {addnodes,apply-ifix,backup,config,install,inventory,monitoring,private_cloud,replacenode,restore,resync_node,uninstall,update}

PowerVC Operations Manager CLI

powervc-opsmgr subcommands:
  {addnodes,apply-ifix,backup,config,install,inventory,monitoring,private_cloud,replacenode,restore,resync_node,uninstall,update}

optional arguments:
  -h, --help            show this help message and exit

List of sub-commands available under powervc-opsmgr:
  addnodes                  Add nodes to existing PowerVC
  apply-ifix                Apply iFix against all/subset of nodes in management node cluster
  backup                    Backs up management plane configuration
  config                    Manage PowerVC Opsmgr configuration settings such as ip's, users etc
  install                   Installs PowerVC management plane
  inventory                 Captures and lists management node inventory details
  monitoring                Manages PowerVC monitoring components
  private_cloud             Upgrades IBM PowerVC to Private Cloud Edition
  replacenode               Replacing a node from PowerVC Cluster.
  restore                   Restores configuration against a PowerVC management plane
  resync_node               Re-Sync of Conf files for management and compute plane
  uninstall                 Uninstall PowerVC management plane
  update                    Updates PowerVC management plane
```

---

### 単一ノード での inventory 作成

単一ノードでのPowerVC inventory 作成を行います。

参考マニュアル

https://www.ibm.com/docs/ja/powervc/2.1.0?topic=manager-legacy-install-powervc


以下で設定します。

・クラスター名: pvc210 (任意の名前です)
・Private cloud edition での導入
・Firewall を構成
・Legacy install 


:::note info
**レガシー・インストールでは VIP(Virtual IP, 仮想IPアドレス)が不要です。 1つのIPアドレスで構成します。**
:::


```
# powervc-opsmgr inventory -c pvc210
+--------------------------------------------------------------------------------+
|                               PowerVC Inventory                                |
+--------------------------------------------------------------------------------+
   PowerVC Install options
	Install Private cloud edition(y/n)  : y
	Configure Firewall (y/n)            : y
	Legacy Installation (y/n)           : y
+--------------------------------------------------------------------------------+
   INFO:
     Legacy Method option
  	* Only one node will be part of PowerVC.
  	* No cluster will be installed during PowerVC installation.
     Sudo User
  	* Sudo user with same username and password across all nodes is required.
+--------------------------------------------------------------------------------+
   PowerVC Node(s) Information
     Node 1
	Enter IP/Hostname for Node 1        : xxx.xx.xx.xxx
	Enter Username for Node 1           : root
	Enter Password for Node 1           :
+--------------------------------------------------------------------------------+

+--------------------------------------------------------------------------------+
|                           PowerVC Inventory - pvc210                           |
+--------------------------------------------------------------------------------+
	Cluster Name              : pvc210
	Cluster ID                : b16a9f0d-6f79-41f8-8ab2-41c555511a6c
	Install Method            : legacy
	Edition                   : private_cloud
	Firewall Config           : True
	Login User                : root
	Virtual IP                : xxx.xx.xx.xxx
	Hosts                     : xxx.xx.xx.xxx
+--------------------------------------------------------------------------------+
|                   *** End of PowerVC Inventory - pvc210 ***                    |
+--------------------------------------------------------------------------------+
Establishing passwordless connection

PLAY [{{ playbook_task_names.configure_ssh_keys }}] ****************************

TASK [Gathering Facts] *********************************************************
Friday 23 December 2022  05:22:07 -0500 (0:00:00.074)       0:00:00.074 *******
[DEPRECATION WARNING]: Distribution rhel 8.6 on host xxx.xx.xx.xxx should use
/usr/libexec/platform-python, but is using /usr/bin/python for backward
compatibility with prior Ansible releases. A future Ansible release will
default to using the discovered platform python for this host. See https://docs
.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for
more information. This feature will be removed in version 2.12. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [xxx.xx.xx.xxx]

TASK [command] *****************************************************************
Friday 23 December 2022  05:22:10 -0500 (0:00:03.299)       0:00:03.374 *******
changed: [xxx.xx.xx.xxx]

TASK [include_vars] ************************************************************
Friday 23 December 2022  05:22:11 -0500 (0:00:00.964)       0:00:04.338 *******
ok: [xxx.xx.xx.xxx]


〜　長いので省略　〜


# localhost:22 SSH-2.0-OpenSSH_8.0
changed: [xxx.xx.xx.xxx] => (item=localhost)
# 127.0.0.1:22 SSH-2.0-OpenSSH_8.0
changed: [xxx.xx.xx.xxx] => (item=127.0.0.1)
xxx.xx.xx.xxx               : ok=16   changed=4    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0

PLAY RECAP *********************************************************************
xxx.xx.xx.xxx               : ok=16   changed=4    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0

Friday 23 December 2022  05:22:16 -0500 (0:00:01.079)       0:00:08.648 *******
===============================================================================
Gathering Facts --------------------------------------------------------- 3.30s
pvc_sshkeys : Make all Hosts known to each other - update known_hosts files --- 1.08s
command ----------------------------------------------------------------- 0.96s
pvc_sshkeys : Copy the keys to the authorized_keys file ----------------- 0.67s
{{ pvc_sshkeys_task_names.get_home_directory_for_ansible_user }} -------- 0.56s
pvc_sshkeys : Get the stat for ssh directory ---------------------------- 0.44s
pvc_sshkeys : Creates ssh directory /root/.ssh -------------------------- 0.42s
pvc_sshkeys : Generate ssh key pair ------------------------------------- 0.41s
pvc_sshkeys : Fetch public key ------------------------------------------ 0.38s
include_vars ------------------------------------------------------------ 0.04s
include_vars ------------------------------------------------------------ 0.04s
{{ pvc_sshkeys_task_names.set_home_directory_for_ansible_user }} -------- 0.03s
include_vars ------------------------------------------------------------ 0.03s
pvc_sshkeys : include_vars ---------------------------------------------- 0.03s
{{ pvc_utils_task_names.store_locale_variable }} ------------------------ 0.03s
include_vars ------------------------------------------------------------ 0.03s
pvc_sshkeys : Delete ssh is file or link -------------------------------- 0.03s
include_vars ------------------------------------------------------------ 0.03s
{{ pvc_utils_task_names.error_message_for_utils_nls }} ------------------ 0.03s
SSH Key exchange successfully completed at, 2022-12-23 05:22:16.,
 Refer to
 /opt/ibm/powervc-opsmgr/ansible/artifacts/powervc-opsmgr_pvc210_ssh_key_xchg_20221223_052206/stdout
 for more details.
Inventory file generated successfully at /opt/ibm/powervc-opsmgr/ansible/inventory/pvc210

+--------------------------------------------------------------------------------+
|                           PowerVC Inventory - pvc210                           |
+--------------------------------------------------------------------------------+
	Cluster Name              : pvc210
	Cluster ID                : b16a9f0d-6f79-41f8-8ab2-41c555511a6c
	Install Method            : legacy
	Edition                   : private_cloud
	Firewall Config           : True
	Login User                : root
	Virtual IP                : xxx.xx.xx.xxx
	Hosts                     : xxx.xx.xx.xxx
	Inventory Directory       : /opt/ibm/powervc-opsmgr/ansible/inventory/pvc210
+--------------------------------------------------------------------------------+
|                   *** End of PowerVC Inventory - pvc210 ***                    |
+--------------------------------------------------------------------------------+
#
```

インベントリーの作成を powervc-opsmgr コマンドでも確認できます。

```
# powervc-opsmgr inventory -l

+--------------------------------------------------------------------------------+
|                           PowerVC Inventory - pvc210                           |
+--------------------------------------------------------------------------------+
	Cluster Name              : pvc210
	Cluster ID                : b16a9f0d-6f79-41f8-8ab2-41c555511a6c
	Install Method            : legacy
	Edition                   : private_cloud
	Firewall Config           : True
	Login User                : root
	Virtual IP                : xxx.xx.xx.xxx
	Hosts                     : xxx.xx.xx.xxx
+--------------------------------------------------------------------------------+
|                   *** End of PowerVC Inventory - pvc210 ***                    |
+--------------------------------------------------------------------------------+
#
```

--- 
### PowerVC 2.1 インストール　

インストールを実行します。


```
# powervc-opsmgr install -c pvc210
Powervc-opsmgr install failed skipping precheck to rerun

PLAY [{{ playbook_task_names.powervc_legacy_installation }}] *******************
Friday 23 December 2022  05:32:00 -0500 (0:00:00.133)       0:00:00.133 *******
[DEPRECATION WARNING]: Distribution rhel 8.6 on host xxx.xx.xx.xxx should use
/usr/libexec/platform-python, but is using /usr/bin/python for backward
compatibility with prior Ansible releases. A future Ansible release will
default to using the discovered platform python for this host. See https://docs
.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for
more information. This feature will be removed in version 2.12. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [xxx.xx.xx.xxx]

TASK [Gathering Facts] *********************************************************
[DEPRECATION WARNING]: Distribution rhel 8.6 on host xxx.xx.xx.xxx should use
/usr/libexec/platform-python, but is using /usr/bin/python for backward
compatibility with prior Ansible releases. A future Ansible release will
default to using the discovered platform python for this host. See https://docs
.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for
more information. This feature will be removed in version 2.12. Deprecation
warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [xxx.xx.xx.xxx]
Friday 23 December 2022  05:32:02 -0500 (0:00:01.646)       0:00:01.779 *******
changed: [xxx.xx.xx.xxx]

TASK [command] *****************************************************************
changed: [xxx.xx.xx.xxx]
Friday 23 December 2022  05:32:03 -0500 (0:00:00.880)       0:00:02.660 *******
ok: [xxx.xx.xx.xxx]



~ Ansible の長いログが続きます。省略 ~




TASK [pvc_main : synchronize state file] ***************************************
ok: [xxx.xx.xx.xxx -> xxx.xx.xx.xxx] => (item=xxx.xx.xx.xxx)
Friday 23 December 2022  06:09:54 -0500 (0:00:00.998)       0:37:53.653 *******

TASK [pvc_main : synchronize inventory] ****************************************
ok: [xxx.xx.xx.xxx -> xxx.xx.xx.xxx] => (item=xxx.xx.xx.xxx)
Friday 23 December 2022  06:10:00 -0500 (0:00:06.054)       0:37:59.707 *******
ok: [xxx.xx.xx.xxx] => {
    "msg": "Play completed successfully"
}

TASK [pvc_main : Success message for play] *************************************
ok: [xxx.xx.xx.xxx] => {
    "msg": "Play completed successfully"
}
Friday 23 December 2022  06:10:00 -0500 (0:00:00.098)       0:37:59.806 *******
xxx.xx.xx.xxx               : ok=1786 changed=813  unreachable=0    failed=0    skipped=1818 rescued=0    ignored=3


PLAY RECAP *********************************************************************
xxx.xx.xx.xxx               : ok=1786 changed=813  unreachable=0    failed=0    skipped=1818 rescued=0    ignored=3

Friday 23 December 2022  06:10:00 -0500 (0:00:00.081)       0:37:59.887 *******
===============================================================================
pvc_utils : Install selinux packages ----------------------------------- 70.23s
pvc_bootstrap_keystone : install keystone packages --------------------- 63.60s
pvc_ui : Install UI server and client packages ------------------------- 39.06s
pvc_galera_new : Install mariadb --------------------------------------- 30.49s
pvc_reg_services : openstack create endpoints -------------------------- 30.12s
pvc_bootstrap_keystone : Create predefined roles ----------------------- 29.55s
pvc_utils : Install generic packages ----------------------------------- 29.48s
pvc_reverse_proxy : restart proxyserver -------------------------------- 28.92s
pvc_db_conn : Create DB credentials and grant permissions -------------- 26.23s
pvc_cinder : install hitachi packages ---------------------------------- 19.33s
pvc_firewalld : get service facts -------------------------------------- 17.90s
pvc_galera_new : Wait for 15 seconds to fully stop galera service ------ 15.47s
pvc_firewalld : Open rabbitmq tcp ports on firewall -------------------- 15.35s
pvc_ui : Install nodejs-14 --------------------------------------------- 15.34s
pvc_rabbitmq : Install rabbitmq ---------------------------------------- 15.13s
pvc_mongodb : Install MongoDB package ---------------------------------- 12.11s
pvc_reg_services : openstack create endpoints -------------------------- 10.98s
pvc_reg_services : openstack create endpoints -------------------------- 10.70s
pvc_common_config : Ensure permissions are right for glance at /etc/ --- 10.58s
pvc_reg_services : openstack create endpoints -------------------------- 10.54s
IBM PowerVC installation successfully completed at 2022-12-23 06:10:01.
 Refer to
 /opt/ibm/powervc-opsmgr/ansible/artifacts/powervc-opsmgr_pvc210_install_20221223_053159/stdout
 for more details.
Access PowerVC UI at https://xxx.xx.xx.xxx
#
```

およそ 40分弱で導入できました。

---

### 導入確認

バージョン・プロバティーで導入を確認します。

```
# cat /opt/ibm/powervc/version.properties
[2.1.0 Install]
name = IBM PowerVC
version = 2.1.0
build = 20221124-0912
oem = no
install-date = 2022-12-23
cloud_enabled = yes
offering = private_cloud
cluster = pvc210
install_method = legacy
#
```

GUI を確認します。


![スクリーンショット 2022-12-23 21.54.48.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/517421/f9849441-49ae-62c6-4a5a-32397ca4d4e9.png)


無事、ログインできました。

:::note info
**左レーンに「トポロジー」枠が加わっています。**
:::

![test2.gif](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/517421/da6d38db-38fe-9e99-e46e-f188e89f0b05.gif)



トポロジーではFCパスの全体像が確認できます。便利ですね。

https://www.ibm.com/docs/ja/powervc/2.1.0?topic=powervc-topology-overview

(参考図としてマニュアル抜粋)

![test3.gif](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/517421/84dc280a-7b8b-36c3-cebd-a7b3222f340e.gif)



---


以上です。