PowerVC 2.0.2 -> 2.0.3 へのアップデート


##### はじめに

PowerVC 2.0.3 が 2022年5月末にリリースされています。アップデート方法は2通りあります。

・[Upgrading to PowerVC 2.0.3](https://www.ibm.com/docs/en/powervc/2.0.3?topic=upgrading-powervc-203)


**① v2.0.2 の構成情報バックアップを取得し、2.0.3 環境にリストア**
__② ローリング・アップデート (2.0.2 or 2.0.2.1 のバージョンのみ可能)__

・[PowerVC rolling upgrade](https://www.ibm.com/docs/en/powervc/2.0.3?topic=powervc-rolling-upgrade)

>This topic explains the procedure for upgrading opsmgr utility and PowerVC on single node and multinode. You must have PowerVC 2.0.2 or 2.0.2.1 


当記事では、**"① v2.0.2 の構成情報バックアップ取得と 2.0.3 環境でのリストア"** を確認しました。

---

2.0.3 インストールについては以前の記事をご参考ください。

https://qiita.com/c_u/items/35273f752e6a2d39f0c2



----
##### 環境

・アップデート前：　PowerVC 2.0.2 (on RHEL 84, ppc64le)

```
# cat /opt/ibm/powervc/version.properties
[2.0.2 Install]
name = IBM PowerVC
version = 2.0.2
build = 20210911-0351
oem = no
install-date = 2022-06-28
cloud_enabled = yes
offering = private_cloud
cluster = pvc202
```

・アップデート後：　PowerVC 2.0.3 (on RHEL 84, ppc64le)   
　　-> 同一サーバーで v2.0.2 uninstall / v2.0.3 install を実行しています。

----
##### 作業


(1) 構成情報バックアップ

バックアップ・コマンドの確認

```
#  powervc-opsmgr backup --help
usage: powervc-opsmgr backup [-h] -c CLUSTER [-p BACKUP_PATH] [-m] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -c CLUSTER, --cluster CLUSTER
                        Specify cluster to take backup of
  -p BACKUP_PATH, --backup-path BACKUP_PATH
                        Use this option to provide path of backup. Default
                        path:/var/opt/ibm/powervc/backups/
  -m, --backup-monitoring
                        Use this option to backup monitoring services and data
                        if enabled. Default path: /elastic/latest/
  -v, --verbose         Standard verbose argument
```

バックアップの実行

```
# powervc-opsmgr backup -c pvc202 -v
Using /etc/ansible/ansible.cfg as config file

PLAY [Take PowerVC Backup] *****************************************************

TASK [Gathering Facts] *********************************************************
ok: [X.XXX.XXX.XXX]

TASK [command] *****************************************************************
changed: [X.XXX.XXX.XXX] => {"changed": true, "cmd": ["localectl", "status"], "delta": "0:00:00.777245", "end": "2022-06-28 18:48:39.138379", "rc": 0, "start": "2022-06-28 18:48:38.361134", "stderr": "", "stderr_lines": [], "stdout": "   System Locale: LANG=en_US.UTF-8\n       VC Keymap: us\n      X11 Layout: n/a", "stdout_lines": ["   System Locale: LANG=en_US.UTF-8", "       VC Keymap: us", "      X11 Layout: n/a"]}

TASK [Store Locale variable] ***************************************************
ok: [X.XXX.XXX.XXX] => {"ansible_facts": {"locale": "en_US.UTF-8"}, "changed": false}

TASK [include_vars] ************************************************************
ok: [X.XXX.XXX.XXX] => {"ansible_facts": {"pvc_utils_cert_sans": [], "pvc_utils_certs_cluster_group": "controller", "pvc_utils_certs_cluster_index": "0", "pvc_utils_default_primary_server": "{{ groups[pvc_utils_certs_cluster_group][(pvc_utils_certs_cluster_index|int) % (groups[pvc_utils_certs_cluster_group]|count|int)] }}", "pvc_utils_dir_permission": "0755", "pvc_utils_file_permission": "0640", "pvc_utils_group_pvcservices": "pvcservices", "pvc_utils_inventory_hosts": "{{ groups[pvc_utils_certs_cluster_group] }}", "pvc_utils_primary_server": "{{ primary_host | default(pvc_utils_default_primary_server) }}", "pvc_utils_root_user_group": "root,powervc-filter", "pvc_utils_rsync_ssh_args": "-e ssh -i {{ pvc_utils_ssh_key_path }} -o StrictHostKeyChecking=no", "pvc_utils_ssh_key_path": "{{ ansible_ssh_private_key_file | default('/root/.ssh/pvc_id_rsa') }}", "pvc_utils_user_group": ["pvcservices", "powervc-filter"]}, "ansible_included_var_files": ["/opt/ibm/powervc-opsmgr/ansible/core/roles/pvc_utils/tasks/../defaults/main.yml"], "changed": false}


~ 省略 ~ 


TASK [pvc_main : debug] ********************************************************
ok: [X.XXX.XXX.XXX] => {
    "msg": [
        "Play results ---------->",
        "Number of nodes        : 1",
        "List of nodes          : ['X.XXX.XXX.XXX']",
        "Number of failed nodes : 0",
        "List of failed nodes   : []"
    ]
}

TASK [pvc_main : failure message for play] *************************************
skipping: [X.XXX.XXX.XXX] => {"changed": false, "skip_reason": "Conditional result was False"}

PLAY RECAP *********************************************************************
X.XXX.XXX.XXX              : ok=52   changed=18   unreachable=0    failed=0    skipped=15   rescued=0    ignored=0


IBM PowerVC backup successfully completed at 2022-06-28 18:51:34. Backup path: /var/opt/ibm/powervc/backups/20220628T184836476622/powervc_backup.tar.gz
 Refer to /opt/ibm/powervc/log/backup/powervc-opsmgr_pvc202_backup_20220628_184831/stdout for more details.
#
```

バックアップ取得は当環境では 所要5分程度でした。(環境によって異なります)

取得したファイルを別環境に退避します。

```
$ scp -p root@X.XXX.XXX.XXX:/var/opt/ibm/powervc/backups/20220628T184836476622/powervc_backup.tar.gz .
root@X.XXX.XXX.XXX's password:
powervc_backup.tar.gz                                             100%  713KB 759.4KB/s   00:00
$
```



(2) v2.0.2 アンインストール

同一サーバーでの実行のため、v2.0.2 のアンインストールを実行します。

コマンドの確認

```
# powervc-opsmgr uninstall -h
usage: powervc-opsmgr uninstall [-h] -c CLUSTER [-f] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -c CLUSTER, --cluster CLUSTER
                        Specify cluster to uninstall
  -f, --force           Force Uninstall
  -v, --verbose         Standard verbose argument. Use this option to specify
                        verbosity while uninstalling PowerVC Multinode.
```

2.0.2 アンインストール実行

```
# powervc-opsmgr uninstall -c pvc202
Are you sure you want to uninstall?(y/N): y

PLAY [PowerVC Uninstallation] **************************************************

TASK [Gathering Facts] *********************************************************
Tuesday 28 June 2022  19:10:55 -0400 (0:00:00.054)       0:00:00.054 **********
ok: [X.XXX.XXX.XXX]


~ 途中省略　〜


TASK [pvc_main : set_fact] *****************************************************
Tuesday 28 June 2022  19:24:20 -0400 (0:00:00.267)       0:13:25.863 **********
ok: [X.XXX.XXX.XXX]

TASK [pvc_main : debug] ********************************************************
Tuesday 28 June 2022  19:24:21 -0400 (0:00:00.316)       0:13:26.179 **********
ok: [X.XXX.XXX.XXX] => {
    "msg": [
        "Play results ---------->",
        "Number of nodes        : 1",
        "List of nodes          : ['X.XXX.XXX.XXX']",
        "Number of failed nodes : 0",
        "List of failed nodes   : []"
    ]
}

TASK [pvc_main : Success message for play] *************************************
Tuesday 28 June 2022  19:24:22 -0400 (0:00:00.322)       0:13:27.544 **********
ok: [X.XXX.XXX.XXX] => {
    "msg": "Play completed successfully"
}

TASK [pvc_main : failure message for play] *************************************
Tuesday 28 June 2022  19:24:22 -0400 (0:00:00.272)       0:13:27.817 **********
skipping: [X.XXX.XXX.XXX]

PLAY RECAP *********************************************************************
X.XXX.XXX.XXX              : ok=136  changed=50   unreachable=0    failed=0    skipped=46   rescued=0    ignored=0

Tuesday 28 June 2022  19:24:23 -0400 (0:00:00.267)       0:13:28.084 **********
===============================================================================
{{ pvc_removenode_task_names.wait_and_check_for_package_list_script_execution }} - 266.68s
{{ pvc_removenode_task_names.wait_for_all_resource_to_stop }} --------- 143.34s
{{ pvc_removenode_task_names.remove_all_packages_without_dependency }} -- 96.63s
{{ pvc_removenode_task_names.add_wait_for_pacemaker_resources_to_stop }} -- 45.61s
{{ pvc_pacemaker_task_names.action_on_pacemaker_resources }} ----------- 21.56s
{{ pvc_removenode_task_names.stop_all_services_before_removenode }} ---- 19.17s
{{ pvc_pacemaker_task_names.action_on_pacemaker_resources }} ----------- 17.63s
{{ pvc_removenode_task_names.remove_user }} ---------------------------- 15.06s
{{ pvc_removenode_task_names.remove_powervc_files_if_any }} ------------ 12.58s
{{ pvc_pacemaker_task_names.action_on_pacemaker_cluster }} ------------- 10.75s
{{ pvc_removenode_task_names.remove_packages_list_from_all_roles_for_redhat }} --- 9.99s
{{ pvc_removenode_task_names.remove_python_binary_in_sitepackages }} ---- 8.11s
{{ pvc_removenode_task_names.get_all_service_facts_for_removenode }} ---- 6.39s
{{ pvc_removenode_task_names.remove_powervc_group }} -------------------- 6.39s
{{ pvc_removenode_task_names.remove_schema_packages }} ------------------ 6.24s
{{ pvc_removenode_task_names.remove_component_log_directory }} ---------- 5.98s
{{ pvc_removenode_task_names.get_all_service_facts_for_removenode }} ---- 5.85s
{{ pvc_removenode_task_names.test_for_all_packages_to_remove }} --------- 5.63s
{{ pvc_removenode_task_names.remove_user_home_directory }} -------------- 5.63s
{{ pvc_removenode_task_names.remove_component_config_directory }} ------- 5.03s
IBM PowerVC uninstallation successfully completed at, 2022-06-28 19:24:23.,
 Refer to
, /var/log/powervc-uninstall.log,
 for more details.
#
```

アンインストールの所要時間は14分程度でした。

インベントリーが消えていることを確認しています。

```
# powervc-opsmgr inventory -l
Error: No cluster/inventory found
```


(3) powervc-opsmgr アンインストール

powervc-opsmgr ユーティリティーも置き換える必要があるのでアンインストールを実行します。
こちらは、用意されているスクリプト "uninstall-opsmgr.sh" を使用します。

```
# cd <powervc-opsmgr モジュール・解凍フォルダ>
# ls -l
total 32
drwxr-xr-x. 2 root root   103 Jun 28 02:12 images
drwxr-xr-x. 2 root root    24 Sep 11  2021 lap
drwxr-xr-x. 2 root root    56 Sep 11  2021 lib
drwxr-xr-x. 3 root root    22 Sep 11  2021 license
-rw-r--r--. 1 root root    59 Sep 11  2021 opsmgr-version.properties
drwxr-xr-x. 4 root root    35 Sep 11  2021 packages
-rwxrwx---. 1 root root 17272 Sep 11  2021 setup_opsmgr.sh
-rwxrwx---. 1 root root  3658 Sep 11  2021 uninstall-opsmgr.sh
-r--r--r--. 1 root root    38 Sep 11  2021 version.properties
```


powervc-opsmgr アンインストール実行

```
# ./uninstall-opsmgr.sh

IBM PowerVC OPS manager uninstallation

Uninstallation was logged in /var/log/powervc-opsmgr-uninstall.log
```

ログ確認

```
# cat /var/log/powervc-opsmgr-uninstall.log
################################################################################
Starting the IBM PowerVC Operations Manager Uninstallation on:
2022-06-28T19:39:53-04:00
################################################################################
NAME="Red Hat Enterprise Linux"
VERSION="8.4 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.4 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.4:GA"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.4
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.4"
Installed packages
ansible powervc-opsmgr python3-powervc-opsmgr python3-oslo-i18n python3-netaddr sshpass
Updating Subscription Management repositories.
Unable to read consumer identity
Failed to set locale, defaulting to C.UTF-8
/usr/lib/python3.6/site-packages/dateutil/parser/_parser.py:70: UnicodeWarning: decode() called on unicode string, see https://bugzilla.redhat.com/show_bug.cgi?id=1693751
  instream = instream.decode()

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Dependencies resolved.
===========================================================================================================
 Package                       Arch     Version                              Repository                Size
===========================================================================================================
Removing:
 ansible                       noarch   2.9.27-1.el8                         @@commandline             96 M
 powervc-opsmgr                noarch   2.0.2-1.ibm.el8                      @pvc_ops_manager-noarch  6.3 M
 python3-netaddr               noarch   0.8.0-2.ibm.el8                      @pvc_ops_manager-noarch  7.9 M
 python3-oslo-i18n             noarch   5.0.1-1.ibm.el8                      @pvc_ops_manager-noarch  205 k
 python3-powervc-opsmgr        noarch   2.0.2-1.ibm.el8                      @pvc_ops_manager-noarch  508 k
 sshpass                       ppc64le  1.06-4.el8.ibm                       @powervc-ppc64le         122 k
Removing unused dependencies:
 libsodium                     ppc64le  1.0.18-1.ibm.el8                     @multiarch-ppc64le       1.8 M
 python3-PyNaCl                ppc64le  1.4.0-1.ibm.el8                      @multiarch-ppc64le       1.0 M
 python3-ansible-runner        noarch   1.4.6-1.ibm.el8                      @pvc_ops_manager-noarch  341 k
 python3-argparse              noarch   1.4.0-1.ibm                          @pvc_ops_manager-noarch  220 k
 python3-daemon                noarch   2.2.4-1.ibm.el8                      @pvc_ops_manager-noarch  104 k
 python3-docutils              noarch   0.14-12.module+el8.1.0+3334+5cb623d7 @dvd-AppStream           5.9 M
 python3-ecdsa                 noarch   0.15-1.ibm.el8                       @pvc_ops_manager-noarch  942 k
 python3-importlib-resources   noarch   5.1.2-1.ibm.el8                      @pvc_ops_manager-noarch  126 k
 python3-jinja2                noarch   2.11.3-1.ibm                         @powervc-noarch          1.0 M
 python3-jmespath              noarch   0.9.0-11.el8                         @dvd-AppStream           117 k
 python3-json-logger           noarch   2.0.1-1.ibm.el8                      @pvc_ops_manager-noarch   24 k
 python3-lockfile              noarch   0.12.2-2.ibm                         @pvc_ops_manager-noarch   81 k
 python3-paramiko              noarch   2.7.2-2.ibm.el8                      @pvc_ops_manager-noarch  1.3 M
 python3-passlib               noarch   1.7.4-1.ibm                          @pvc_ops_manager-noarch  3.8 M
 python3-pyasn1                noarch   0.4.8-3.ibm                          @pvc_ops_manager-noarch  616 k
 python3-pyasn1-modules        noarch   0.2.8-2.ibm                          @pvc_ops_manager-noarch  1.1 M

Transaction Summary
===========================================================================================================
Remove  22 Packages

Freed space: 130 M
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Erasing          : python3-powervc-opsmgr-2.0.2-1.ibm.el8.noarch         1/22
  
~ 省略 ~

  Verifying        : sshpass-1.06-4.el8.ibm.ppc64le                       22/22
Installed products updated.

Removed:
  ansible-2.9.27-1.el8.noarch

~ 省略 ~

  sshpass-1.06-4.el8.ibm.ppc64le

Complete!
"Uninstallation of IBM PowerVC Operations Manager Node completed."
################################################################################
Ending the IBM PowerVC Operations Managers Uninstallation on:
2022-06-28T19:40:08-04:00
################################################################################
################################################################################
Starting the IBM PowerVC Operations Manager Uninstallation on:
2022-06-28T19:41:02-04:00
################################################################################
NAME="Red Hat Enterprise Linux"
VERSION="8.4 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.4 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.4:GA"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.4
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.4"
Installed packages

Updating Subscription Management repositories.
Unable to read consumer identity
Failed to set locale, defaulting to C.UTF-8
/usr/lib/python3.6/site-packages/dateutil/parser/_parser.py:70: UnicodeWarning: decode() called on unicode string, see https://bugzilla.redhat.com/show_bug.cgi?id=1693751
  instream = instream.decode()


This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

No packages marked for removal.
Dependencies resolved.
Nothing to do.
Complete!
"Uninstallation of IBM PowerVC Operations Manager Node completed."
################################################################################
Ending the IBM PowerVC Operations Managers Uninstallation on:
2022-06-28T19:41:03-04:00
################################################################################

```

powervc-opsmgr と共に、ansible 等の導入前提モジュールが削除されています。


---

それでは新たに 2.0.3 の powervc-opsmgr インストールから開始します。
記載は省略しますが、事前に ansible を別途導入しました。

(4) PowerVC 2.0.3 powervc-opsmgr インストール

```
# export LANG=C

# ./setup_opsmgr.sh
################################################################################
Starting the PowerVC:setup_prepnode 2.0.3 installation on:
2022-06-28T19:58:49-04:00
################################################################################

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-06-28T19:58:53.24-04:00 [INFO]:[] License accepted.
2022-06-28T19:58:53.26-04:00 [INFO]:[] Configuring Yum repository for PowerVC-Opsmgr...
/usr/lib/python3.6/site-packages/dateutil/parser/_parser.py:70: UnicodeWarning: decode() called on unicode string, see https://bugzilla.redhat.com/show_bug.cgi?id=1693751
  instream = instream.decode()

/usr/lib/python3.6/site-packages/dateutil/parser/_parser.py:70: UnicodeWarning: decode() called on unicode string, see https://bugzilla.redhat.com/show_bug.cgi?id=1693751
  instream = instream.decode()

2022-06-28T19:59:09.44-04:00 [INFO]:[VALIDATION] BASE DIRECTORY : /opt/ibm/powervc-opsmgr
2022-06-28T19:59:09.44-04:00 [INFO]:[VALIDATION] INSTALL SCRIPT : /home/work/powervc203/powervc-opsmgr-2.0.3/setup_opsmgr.sh
2022-06-28T19:59:09.44-04:00 [INFO]:[VALIDATION] LOG FILE : /opt/ibm/powervc-opsmgr/log/prep_node/prep_node_2022-06-28-1958.log
2022-06-28T19:59:09.46-04:00 [INFO]:[VALIDATION] OPERATING SYSTEM: Red Hat Enterprise Linux.
2022-06-28T19:59:09.46-04:00 [INFO]:[VALIDATION] RHEL_VERSION : 84
2022-06-28T19:59:09.46-04:00 [INFO]:[VALIDATION] User ID : root
2022-06-28T19:59:09.48-04:00 [INFO]:[INSTALL_ANSIBLE] Ansible already installed.
2022-06-28T19:59:09.82-04:00 [INFO]:[INSTALL_ANSIBLE] ANSIBLE_VERSION_INSTALLED: 2.9.27.
/usr/lib/python3.6/site-packages/dateutil/parser/_parser.py:70: UnicodeWarning: decode() called on unicode string, see https://bugzilla.redhat.com/show_bug.cgi?id=1693751
  instream = instream.decode()

2022-06-28T19:59:14.67-04:00 [INFO]:[INSTALL_ANSIBLE] Ansible currently installed. ANSIBLE VERSION: 2.9
2022-06-28T19:59:14.67-04:00 [INFO]:[INSTALL_ANSIBLE] Installing PowerVC Ops. Manager...
2022-06-28T19:59:14.68-04:00 [INFO]:[INSTALL_POWERVC_OPSMGR] POWERVC OPSMGR PACKAGES : sshpass python3-netaddr rsync python3-oslo-i18n python3-powervc-opsmgr
2022-06-28T19:59:22.79-04:00 [INFO]:[INSTALL_POWERVC_OPSMGR] PowerVC Opsmgr packages installed successfully.

################################################################################
PowerVC:setup_prepnode installation completed at 2022-06-28T19:59:22-04:00.
Refer to
/opt/ibm/powervc-opsmgr/log/prep_node/prep_node_2022-06-28-1958.log
for more details.
################################################################################
#
```
powervc-opsmgr 導入は前提モジュールが既に導入状態であったため、1分程度で完了しました。


---
PowerVC 2.0.3 導入のためのインベントリーを作成します。

(5) PowerVC 2.0.3 用のインベントリーの作成

```
# powervc-opsmgr inventory -c pvc203
*********************************************************
Install Private cloud edition(y/n): y
Configure Firewall (y/n): y
*********************************************************
Enter the number of nodes: 1
*********************************************************
INFO: First node specified will be considered as primary or bootstrap host/node
INFO: A sudo user with same username and password across all nodes is required.
*******************************************************
Enter IP/Hostname for Node 1: X.XXX.XXX.XXX
Enter Username for Node 1: root
Enter Password for Node 1:
*********************************************************
Enter Virtual IP: X.XXX.XXX.XXY
Establishing passwordless connection

PLAY [Configure SSH Keys] ******************************************************

TASK [Gathering Facts] *********************************************************
Tuesday 28 June 2022  20:37:59 -0400 (0:00:00.036)       0:00:00.036 **********
ok: [X.XXX.XXX.XXX]

~ 省略 ~

ok: [X.XXX.XXX.XXX]

TASK [pvc_sshkeys : Copy the keys to the authorized_keys file] *****************
Tuesday 28 June 2022  20:38:05 -0400 (0:00:00.373)       0:00:05.976 **********
ok: [X.XXX.XXX.XXX] => (item=X.XXX.XXX.XXX)

TASK [pvc_sshkeys : Make all Hosts known to each other - update known_hosts files] ***
Tuesday 28 June 2022  20:38:05 -0400 (0:00:00.576)       0:00:06.552 **********
# X.XXX.XXX.XXX:22 SSH-2.0-OpenSSH_8.0
# X.XXX.XXX.XXX:22 SSH-2.0-OpenSSH_8.0
# X.XXX.XXX.XXX:22 SSH-2.0-OpenSSH_8.0
ok: [X.XXX.XXX.XXX] => (item=X.XXX.XXX.XXX)
# localhost:22 SSH-2.0-OpenSSH_8.0
# localhost:22 SSH-2.0-OpenSSH_8.0
# localhost:22 SSH-2.0-OpenSSH_8.0
changed: [X.XXX.XXX.XXX] => (item=localhost)
# 127.0.0.1:22 SSH-2.0-OpenSSH_8.0
# 127.0.0.1:22 SSH-2.0-OpenSSH_8.0
# 127.0.0.1:22 SSH-2.0-OpenSSH_8.0
changed: [X.XXX.XXX.XXX] => (item=127.0.0.1)
X.XXX.XXX.XXX              : ok=16   changed=2    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0

PLAY RECAP *********************************************************************
X.XXX.XXX.XXX              : ok=16   changed=2    unreachable=0    failed=0    skipped=3    rescued=0    ignored=0

Tuesday 28 June 2022  20:38:06 -0400 (0:00:01.102)       0:00:07.654 **********
===============================================================================
Gathering Facts --------------------------------------------------------- 2.07s
pvc_sshkeys : Make all Hosts known to each other - update known_hosts files --- 1.10s
command ----------------------------------------------------------------- 1.00s
pvc_sshkeys : Copy the keys to the authorized_keys file ----------------- 0.58s
pvc_sshkeys : get home directory for root ------------------------------- 0.46s
pvc_sshkeys : Creates ssh directory /root/.ssh -------------------------- 0.40s
pvc_sshkeys : Get the stat for ssh directory ---------------------------- 0.39s
pvc_sshkeys : Fetch public key ------------------------------------------ 0.37s
pvc_sshkeys : Generate ssh key pair ------------------------------------- 0.34s
pvc_sshkeys : include_vars ---------------------------------------------- 0.16s
include_vars ------------------------------------------------------------ 0.11s
Store Locale variable --------------------------------------------------- 0.10s
include_vars ------------------------------------------------------------ 0.10s
include_vars ------------------------------------------------------------ 0.10s
Error Message for utils nls --------------------------------------------- 0.10s
include_vars ------------------------------------------------------------ 0.09s
include_vars ------------------------------------------------------------ 0.05s
pvc_sshkeys : Delete ssh is file or link -------------------------------- 0.04s
pvc_sshkeys : set home directory for root ------------------------------- 0.04s
SSH Key exchange successfully completed at, 2022-06-28 20:38:06.,
 Refer to
 /opt/ibm/powervc-opsmgr/ansible/artifacts/powervc-opsmgr_pvc203_ssh_key_xchg_20220628_203758/stdout
 for more details.
Inventory file generated successfully at /opt/ibm/powervc-opsmgr/ansible/inventory/pvc203
#
```

以下のインベントリーが作成されました。


```
# powervc-opsmgr inventory -l
Cluster name: pvc203
Hosts: ['XX.XX.XXX.XXX']
Edition: private_cloud
Firewall Config: True
Monitoring: False
Primary or Bootstrap host: XX.XX.XXX.XXX
Virtual IP: XX.XX.XXX.XXY
---End of cluster pvc203---
```

そういえば、2.0.2 の時は、作成時にモニタリングの y or n を聞かれましたが、2.0.3 では聞かれなくなっています。
デフォルトは False (非導入) です。


---

(6) PowerVC 2.0.3 インストール

```
# export LANG=C
# powervc-opsmgr install -c pvc203
PLAY [Precheck] ****************************************************************
Tuesday 28 June 2022  21:03:41 -0400 (0:00:00.135)       0:00:00.135 **********
ok: [XX.XX.XXX.XXX]

TASK [Gathering Facts] *********************************************************
ok: [X.XXX.XXX.XXX]
Tuesday 28 June 2022  21:03:44 -0400 (0:00:02.996)       0:00:03.132 **********

~ 省略 ~ 

TASK [pvc_main : Success message for play] *************************************
ok: [X.XXX.XXX.XXX0] => {
    "msg": "Play completed successfully"
}
Tuesday 28 June 2022  22:18:13 -0400 (0:00:00.285)       1:05:18.256 **********
X.XXX.XXX.XXX0              : ok=2253 changed=1006 unreachable=0    failed=0    skipped=1962 rescued=0    ignored=2

PLAY RECAP *********************************************************************
X.XXX.XXX.XXX0              : ok=2253 changed=1006 unreachable=0    failed=0    skipped=1962 rescued=0    ignored=2

Tuesday 28 June 2022  22:18:13 -0400 (0:00:00.323)       1:05:18.579 **********
===============================================================================
pvc_bootstrap_keystone : install keystone packages --------------------- 66.34s
pvc_utils : Install selinux packages ----------------------------------- 63.61s
pvc_galera_new : Installing mariadb and galera packages ---------------- 58.51s
pvc_ui : Install UI server and client packages ------------------------- 40.54s
pvc_bootstrap_keystone : Create predefined roles ----------------------- 36.72s
pvc_reg_services : openstack create endpoints -------------------------- 35.63s
pvc_ansible : Unarchive tar images in remote node ---------------------- 33.84s
pvc_main : Httpd service restart --------------------------------------- 32.64s
pvc_galera_new : Wait for 30 seconds for WSREP become prepared state --- 30.55s
pvc_main : Wait for 30 seconds to have galera as resource active ------- 30.53s
pvc_galera_new : Wait for 30 seconds for WSREP become prepared state --- 30.52s
pvc_db_conn : Create DB credentials and grant permissions -------------- 29.75s
pvc_pacemaker : Wait untill cluster is online and ready ---------------- 25.20s
pvc_reg_services : openstack create endpoints -------------------------- 18.12s
pvc_reg_services : Get component list ---------------------------------- 17.73s
pvc_galera_new : Wait for 15 seconds to fully stop galera service ------ 15.80s
pvc_cinder : install hitachi packages ---------------------------------- 15.63s
pvc_galera_new : Wait for 15 seconds to fully stop galera service ------ 15.53s
pvc_rabbitmq : Install rabbitmq ---------------------------------------- 15.12s
pvc_utils : Install generic packages ----------------------------------- 13.77s
IBM PowerVC installation successfully completed at 2022-06-28 22:18:13.
 Refer to
 /opt/ibm/powervc-opsmgr/ansible/artifacts/powervc-opsmgr_pvc203_install_20220628_211253/stdout
 for more details.

~ 省略 ~

TASK [pvc_lock : Display Failed nodes if case of failure] **********************
ok: [X.XXX.XXX.XXY] => {
    "msg": [
        "Number of nodes        : 1",
        "List of Nodes          : ['X.XXX.XXX.XXY']",
        "Number of failed nodes : 0",
        "List of failed nodes   : [] "
    ]
}
X.XXX.XXX.XXY              : ok=20   changed=4    unreachable=0    failed=0    skipped=7    rescued=0    ignored=0

PLAY RECAP *********************************************************************
X.XXX.XXX.XXY              : ok=20   changed=4    unreachable=0    failed=0    skipped=7    rescued=0    ignored=0

Tuesday 28 June 2022  22:18:22 -0400 (0:00:00.049)       0:00:07.473 **********
===============================================================================
Gathering Facts --------------------------------------------------------- 2.10s
command ----------------------------------------------------------------- 1.27s
Check for active hosts -------------------------------------------------- 1.00s
pvc_lock : Acquire lock - Check for Lock file --------------------------- 0.50s
pvc_lock : Acquire lock - Create PowerVC Lock file ---------------------- 0.43s
pvc_lock : Release lock - Remove lock file ------------------------------ 0.28s
pvc_sync_inv : check for lock file -------------------------------------- 0.26s
pvc_lock : include_vars ------------------------------------------------- 0.16s
Store Locale variable --------------------------------------------------- 0.14s
include_vars ------------------------------------------------------------ 0.13s
set_fact ---------------------------------------------------------------- 0.13s
debug ------------------------------------------------------------------- 0.12s
include_vars ------------------------------------------------------------ 0.11s
Error Message for utils nls --------------------------------------------- 0.11s
pvc_lock : Configure lock facts based on all node ----------------------- 0.08s
pvc_sync_inv : Set fact for lock file based on all node ----------------- 0.07s
pvc_lock : Configure lock facts based on file --------------------------- 0.06s
pvc_lock : Display lock found message ----------------------------------- 0.06s
include_vars ------------------------------------------------------------ 0.06s
pvc_lock : Display Failed nodes if case of failure ---------------------- 0.05s
Inventory sync is successful
Access PowerVC UI at https://X.XXX.XXX.XXY
#
```


インストール所要時間は1時間10分弱程度でした。

バージョンの確認

```
# cat /opt/ibm/powervc/version.properties
[2.0.3 Install]
name = IBM PowerVC
version = 2.0.3
build = 20220520-0449
oem = no
install-date = 2022-06-28
cloud_enabled = yes
offering = private_cloud
cluster = pvc203
```


(7) 構成情報のリストア


構成情報の配置

```
# ls -l
total 716
-rw-------. 1 root root 730234 Jun 28 18:51 powervc_backup.tar.gz
```

コマンドの確認

```
# powervc-opsmgr restore -h
usage: powervc-opsmgr restore [-h] -c CLUSTER [-b BACKUPARCHIVE] [-r] [-m]
                              [-v]

optional arguments:
  -h, --help            show this help message and exit
  -c CLUSTER, --cluster CLUSTER
                        Specify cluster to restore
  -b BACKUPARCHIVE, --backuparchive BACKUPARCHIVE
                        Option to provide PowerVC backup file path. Default
                        value is /var/opt/ibm/powervc/backups/<most recent>
  -r, --rescuerestore   Rescue restore PowerVC env
  -m, --restore-monitoring
                        Use this option to restore monitoring services and
                        data if enabled. Default path: /elastic/latest/
  -v, --verbose         Standard verbose argument
```


実行

```
# powervc-opsmgr restore -c pvc203 -b /home/work/backup/powervc_backup.tar.gz
Using archive /home/work/backup/powervc_backup.tar.gz for the restore.

PLAY [PowerVC Restore Operation] ***********************************************

TASK [Gathering Facts] *********************************************************
Tuesday 28 June 2022  23:13:05 -0400 (0:00:00.074)       0:00:00.074 **********
ok: [X.XXX.XXX.XXX]

TASK [command] *****************************************************************
Tuesday 28 June 2022  23:13:07 -0400 (0:00:01.846)       0:00:01.920 **********
changed: [X.XXX.XXX.XXX]

TASK [include_vars] ************************************************************
Tuesday 28 June 2022  23:13:09 -0400 (0:00:01.317)       0:00:03.238 **********
ok: [X.XXX.XXX.XXX]
X.XXX.XXX.XXX

~ 省略 ~ 

TASK [pvc_main : failure message for play] *************************************
Tuesday 28 June 2022  23:28:58 -0400 (0:00:00.214)       0:15:52.816 ********** 
skipping: [9.188.124.230]
9.188.124.230              : ok=510  changed=180  unreachable=0    failed=0    skipped=176  rescued=0    ignored=1   

PLAY RECAP *********************************************************************
9.188.124.230              : ok=510  changed=180  unreachable=0    failed=0    skipped=176  rescued=0    ignored=1   

Tuesday 28 June 2022  23:28:58 -0400 (0:00:00.207)       0:15:53.024 ********** 
=============================================================================== 
pvc_restore : Stop non core services ---------------------------------- 122.22s
pvc_restore : Upgrade component --------------------------------------- 108.57s
pvc_restore : restart_powervc_services --------------------------------- 75.29s
pvc_restore : Restore componenet --------------------------------------- 74.28s
pvc_restore : Management System change --------------------------------- 70.20s
pvc_restore : restart keystone ----------------------------------------- 27.41s
pvc_restore : Backup the restore system conf files --------------------- 23.64s
pvc_restore : Restore the backup databases ----------------------------- 21.27s
{{ pvc_pacemaker_task_names.action_on_pacemaker_resources }} ----------- 19.09s
pvc_restore : Run db sync commands for component ----------------------- 14.47s
pvc_restore : Copy backup openstack conf files to standard paths of restore system -- 12.03s
pvc_restore : Clean databases ------------------------------------------ 11.46s
pvc_restore : Directory structure creation for backup restore system --- 10.45s
pvc_restore : Backup remote novalink conf file ------------------------- 10.07s
pvc_restore : openstack_pvc_internal_user_service_role_assignment_against_service --- 9.46s
pvc_main : synchronize inventory ---------------------------------------- 9.42s
pvc_restore : openstack_pvc_internal_user_admin_role_assignment_against_ibmdefault --- 9.26s
pvc_restore : replace old management node refrence ---------------------- 9.00s
pvc_restore : Run db sync commands for component ------------------------ 8.44s
pvc_restore : Run db sync commands for component ------------------------ 8.37s

IBM PowerVC restore operation successfully completed at 2022-06-28 23:29:02. 

Refer to /opt/ibm/powervc/log/restore/powervc-opsmgr_pvc203_restore_20220628_231304/stdout for more details.
```

構成情報のリストアは所要15分程度でした。


その後ログイン可能を確認しました。

![スクリーンショット 2022-06-29 14.13.09.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/517421/66e6d553-d455-7cb6-1bc6-3473854054e5.png)


---

##### おわりに

PowerVC 2.0.2 の構成情報バックアップを PowerVC 2.0.3 で戻すことによる v2.0.3 へのアップデートは確認できました。

<font color="Silver">Rolling Update は何度か試行していますがまだ成功していません..。成功すれば記事にできればと思います</font>


以上です。