LoginSignup
1
1

PowerVC アンインストールで /etc/hosts から自身のエントリーが消える

Last updated at Posted at 2024-06-21

はじめに

PowerVC アンインストールを行ったのちに、/etc/hosts から自身のエントリーが消えていたことに気づいたログです。


環境

PowerVC 2.2.0 on RHEL ppc64le
 ホスト名 pvctest
 1 node クラスター構成

# cat /opt/ibm/powervc/version.properties
[2.2.0 Install]
name = IBM PowerVC
version = 2.2.0
build = 20231102-0930
oem = no
install-date = 2024-04-09
cloud_enabled = yes
cluster = pvc220
install_method = cluster

バージョン 2.2.0 で確認しましたが、別バージョン 2.0.2.1 でもアンインストール後に消えていました。


/etc/hosts でエントリー確認

# cat /etc/hosts 
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
xxx.xx.xxx.xxx	pvctest       #< PowerVC サーバー

pvctest がサーバー自分自身です。


アンインストールを実行

以下のコマンドでアンインストールを実行します。

# powervc-opsmgr uninstall -c pvc220

PowerVC docs: Uninstalling

ログは省略

アンインストール後の /etc/hosts 確認

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

対象のエントリーが消えていました...


uninstall playbook 確認

アンインストール処理で実行されていた下記の Ansible playbook 内に /etc/hosts エントリーを削除している箇所を見つけました。

/opt/ibm/powervc-opsmgr/ansible/core/roles/pvc_removenode/tasks/pvc_removenode_powervc_uninstall_cluster.yml

# cat /opt/ibm/powervc-opsmgr/ansible/core/roles/pvc_removenode/tasks/pvc_removenode_powervc_uninstall_cluster.yml

~ 省略 ~ 


- name: "{{ pvc_removenode_task_names.update_etchosts_after_remove_cluster }}"
  lineinfile:
    dest: '/etc/hosts'
    regexp: '{{ item }}'
    state: absent
  with_items: "{{ groups['controller'] }}"
  vars:
    ansible_python_interpreter: "{{ (ansible_distribution | lower in ['sles', 'sles_sap']) | ternary(python_36, ansible_python) }}"

with_items で groups['controller'] が指定されていますが、これがおそらくPowerVC管理ノード自身と思われます。


state: absent ...消去されていますね..

おわりに

アンインストール後に他の用途でサーバーを使用したい、再度PowerVC インストールを実行したいなどの場合にはお気をつけください。

1
1
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1