初めてProxmox VEを試してみるのに構築したノードを、その後はノードも順調に増えてクラスタ構成になったことから、非力なこのノードをクラスタから離脱、退役させました。
これまでのいきさつ
余剰部品をかき集めて構築した初めてのProxmox VEノードは、IBM System x3250 M4は特にRAMが貧弱でした。
この機体で基礎を学んで、VMware ESXiハイパバイザを1機ずつProxmoxへ乗り換え、クラスタを構成するまでに。
サーバラックが手狭になってきたので、今回、立派に役目を終えた初号機をクラスタから離脱、スタンドアロンに戻してオフラインにしようと思います。
クラスタからノードを離脱
ノードにクラスタを作成したり、既存のクラスタにノードを参加させる工程は、WebUIで完結することができましたが、クラスタからのノード離脱に関する機能は、WebUI上には皆無。それでもCLIベースの手順は公式ドキュメントに解説されているので、今回はこの手順に沿って作業を進めます。
現在のProxmox VE ノードとクラスタの構成は以下の通りで、ノード pve77 をクラスタから離脱させます。
|
1 2 3 4 |
[Proxmox VE Cluster] ├─ Proxmox VE v8.2.7 Node : pve21 ├─ Proxmox VE v8.2.7 Node : pve25 └─ Proxmox VE v8.2.7 Node : pve27 ←離脱対象ノード |
まず、離脱対象以外のノード pve25 のターミナルに入って、クラスタの状態を確認。
|
1 2 3 4 5 6 7 |
root@pve25:~# pvecm nodes Membership information ---------------------- Nodeid Votes Name 1 1 pve77 2 1 pve21 3 1 pve25 (local) |
pvecm delnode コマンドを発行して、クラスタメンバの pve77 をクラスタから削除します。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
root@pve25:~# pvecm delnode pve77 Killing node 1 root@pve25:~# pvecm nodes Membership information ---------------------- Nodeid Votes Name 2 1 pve21 3 1 pve25 (local) root@pve25:~# systemctl status corosync.service ● corosync.service - Corosync Cluster Engine Loaded: loaded (/lib/systemd/system/corosync.service; enabled; preset: enabled) Active: active (running) since Fri 2024-11-15 06:37:24 HKT; 2 months 27 days ago Docs: man:corosync man:corosync.conf man:corosync_overview Main PID: 1621 (corosync) Tasks: 9 (limit: 76733) Memory: 135.2M CPU: 1d 5h 40min 11.634s CGroup: /system.slice/corosync.service └─1621 /usr/sbin/corosync -f Feb 11 09:39:41 pve25 corosync[1621]: [QUORUM] Sync members[2]: 2 3 Feb 11 09:39:41 pve25 corosync[1621]: [QUORUM] Sync left[1]: 1 Feb 11 09:39:41 pve25 corosync[1621]: [TOTEM ] A new membership (2.d3) was formed. Members left: 1 Feb 11 09:39:41 pve25 corosync[1621]: [TOTEM ] Failed to receive the leave message. failed: 1 Feb 11 09:39:41 pve25 corosync[1621]: [QUORUM] Members[2]: 2 3 Feb 11 09:39:41 pve25 corosync[1621]: [MAIN ] Completed service synchronization, ready to provide service. Feb 11 09:39:42 pve25 corosync[1621]: [CFG ] Config reload requested by node 3 Feb 11 09:39:42 pve25 corosync[1621]: [TOTEM ] Configuring link 0 Feb 11 09:39:42 pve25 corosync[1621]: [TOTEM ] Configured link number 0: local addr: 192.168.2.25, port=5405 Feb 11 09:39:42 pve25 corosync[1621]: [KNET ] pmtud: MTU manually set to: 0 |
クラスタに残っている pve25 のWebUIで確認すると、確かにノードが削除されました(左ペインの☓マークの付いたノードも、そのうち消えます)。
クラスタから離脱したノードの清掃
一方、クラスタから離脱したノードのWebUIでは、まだこのようにクラスタの亡霊が残ったまま。
上述の公式ドキュメントに、もしノードを再びこのクラスタへ参加させたい場合は、Proxmox VEのフレッシュ再インストールしなさい、とあるのも頷けます。
但し、その次の項で再インストールせずにノードを分離する手順が記載されているので、それを試してみます。
クラスタから切り離されてスタンドアローンになったノード、 pve77 のターミナルに入ります。
|
1 2 3 4 5 6 7 8 9 10 11 |
root@pve77:~# pvecm nodes Cannot initialize CMAP service root@pve77:~# pvecm status Cluster information ------------------- Name: pvecluster Config Version: 3 Transport: knet Secure auth: on Cannot initialize CMAP service |
そしてまず、クラスタ関連の2つのサービスを停止。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
root@pve77:~# systemctl stop pve-cluster root@pve77:~# systemctl stop corosync root@pve77:~# systemctl status pve-cluster ○ pve-cluster.service - The Proxmox VE cluster filesystem Loaded: loaded (/lib/systemd/system/pve-cluster.service; enabled; preset: enabled) Active: inactive (dead) since Tue 2025-02-11 09:47:22 HKT; 13s ago Duration: 3month 3w 17h 8min 55.047s Main PID: 988 (code=exited, status=0/SUCCESS) CPU: 3h 18min 39.913s Feb 11 09:47:20 pve77 systemd[1]: Stopping pve-cluster.service - The Proxmox VE cluster filesystem... Feb 11 09:47:20 pve77 pmxcfs[988]: [main] notice: teardown filesystem Feb 11 09:47:22 pve77 pmxcfs[988]: [quorum] crit: quorum_finalize failed: 9 Feb 11 09:47:22 pve77 pmxcfs[988]: [confdb] crit: cmap_track_delete nodelist failed: 9 Feb 11 09:47:22 pve77 pmxcfs[988]: [confdb] crit: cmap_track_delete version failed: 9 Feb 11 09:47:22 pve77 pmxcfs[988]: [confdb] crit: cmap_finalize failed: 9 Feb 11 09:47:22 pve77 pmxcfs[988]: [main] notice: exit proxmox configuration filesystem (0) Feb 11 09:47:22 pve77 systemd[1]: pve-cluster.service: Deactivated successfully. Feb 11 09:47:22 pve77 systemd[1]: Stopped pve-cluster.service - The Proxmox VE cluster filesystem. Feb 11 09:47:22 pve77 systemd[1]: pve-cluster.service: Consumed 3h 18min 39.913s CPU time. root@pve77:~#systemctl status corosync × corosync.service - Corosync Cluster Engine Loaded: loaded (/lib/systemd/system/corosync.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Tue 2025-02-11 09:39:33 HKT; 8min ago Duration: 3month 3w 17h 1min 7.842s Docs: man:corosync man:corosync.conf man:corosync_overview Process: 994 ExecStart=/usr/sbin/corosync -f $COROSYNC_OPTIONS (code=exited, status=255/EXCEPTION) Main PID: 994 (code=exited, status=255/EXCEPTION) CPU: 1d 8h 16min 27.327s Feb 07 08:06:55 pve77 corosync[994]: [KNET ] host: host: 3 (passive) best link: 0 (pri: 1) Feb 07 08:06:55 pve77 corosync[994]: [KNET ] host: host: 3 has no active links Feb 07 08:06:55 pve77 corosync[994]: [KNET ] link: Resetting MTU for link 0 because host 3 joined Feb 07 08:06:55 pve77 corosync[994]: [KNET ] host: host: 3 (passive) best link: 0 (pri: 1) Feb 07 08:06:55 pve77 corosync[994]: [KNET ] pmtud: Global data MTU changed to: 1397 Feb 11 09:39:33 pve77 corosync[994]: [CFG ] Killed by node 3 : Killed by corosync-cfgtool Feb 11 09:39:33 pve77 corosync[994]: [MAIN ] Corosync Cluster Engine exiting with status -1 at cfg.c:566. Feb 11 09:39:33 pve77 systemd[1]: corosync.service: Main process exited, code=exited, status=255/EXCEPTION Feb 11 09:39:33 pve77 systemd[1]: corosync.service: Failed with result 'exit-code'. Feb 11 09:39:33 pve77 systemd[1]: corosync.service: Consumed 1d 8h 16min 27.327s CPU time. |
次に、クラスタファイルシステムをローカルモードで再ロードします。
|
1 2 3 |
root@pve77:~# pmxcfs -l [main] notice: resolved node name 'pve77' to '192.168.2.77' for default node IP address [main] notice: forcing local mode (although corosync.conf exists) |
その上で、corosyncサービス関連の設定ファイルを削除します。
|
1 2 3 4 5 6 7 8 |
root@pve77:~# ls -l /etc/pve/corosync* -rw-r----- 1 root www-data 540 Oct 23 15:20 /etc/pve/corosync.conf root@pve77:~# ls -l /etc/corosync/* -r-------- 1 root root 256 Oct 18 11:44 /etc/corosync/authkey -rw-r--r-- 1 root root 540 Oct 23 15:20 /etc/corosync/corosync.conf root@pve77:~# rm /etc/pve/corosync.conf root@pve77:~# rm -r /etc/corosync/* |
ローカルモードで動いているクラスタファイルシステムを落として、クラスタモードに戻します。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
root@pve77:~# killall pmxcfs root@pve77:~# systemctl start pve-cluster root@pve77:~# systemctl status pve-cluster ● pve-cluster.service - The Proxmox VE cluster filesystem Loaded: loaded (/lib/systemd/system/pve-cluster.service; enabled; preset: enabled) Active: active (running) since Tue 2025-02-11 09:51:14 HKT; 7s ago Process: 4183107 ExecStart=/usr/bin/pmxcfs (code=exited, status=0/SUCCESS) Main PID: 4183108 (pmxcfs) Tasks: 5 (limit: 9438) Memory: 14.6M CPU: 30ms CGroup: /system.slice/pve-cluster.service └─4183108 /usr/bin/pmxcfs Feb 11 09:51:13 pve77 systemd[1]: Starting pve-cluster.service - The Proxmox VE cluster filesystem... Feb 11 09:51:13 pve77 pmxcfs[4183107]: [main] notice: resolved node name 'pve77' to '192.168.2.77' for default node IP address Feb 11 09:51:13 pve77 pmxcfs[4183107]: [main] notice: resolved node name 'pve77' to '192.168.2.77' for default node IP address Feb 11 09:51:14 pve77 systemd[1]: Started pve-cluster.service - The Proxmox VE cluster filesystem. |
そして、残ったクラスタ情報を削除、
|
1 2 3 4 |
root@pve77:~# ls -alF /var/lib/corosync/* -rw------- 1 root root 8 Dec 27 20:12 /var/lib/corosync/ringid_1 root@pve77:~# rm /var/lib/corosync/* |
離脱した自身以外のノード情報も削除します。
|
1 2 3 4 5 6 7 8 9 10 |
root@pve77:~# ls -l /etc/pve/nodes/ drwxr-xr-x 2 root www-data 0 Oct 18 11:48 pve21 drwxr-xr-x 2 root www-data 0 Oct 23 15:20 pve25 drwxr-xr-x 2 root www-data 0 Oct 10 00:11 pve77 root@pve77:~# rm -r /etc/pve/nodes/pve21 root@pve77:~# rm -r /etc/pve/nodes/pve25 root@pve77:~# ls -l /etc/pve/nodes/ drwxr-xr-x 2 root www-data 0 Oct 10 00:11 pve77 |
以上が、公式ドキュメントに解説に沿った作業手順でした。
WebUIから見える残存情報の削除
ここで、クラスタから離脱して独立したノード、 pve77 のWebUIをあらためて確認。 Datacenter → Backup や Storage にはクラスタ参加当時のオブジェクトがまだ残っていたので、WebUIから手作業で削除。
さらに、 Firewall にも多くのルールやエイリアス、IPセットなどのオブジェクトが全てがっつり残っています。
これらをWebUIで消してゆく作業は果てしないので、ターミナルで当該フォルダ /etc/pve/firewall/ の中身を丸ごとざっくり削除することに。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
root@pve77:~# pve-firewall stop root@pve77:~# ls -l /etc/pve/firewall/ -rw-r----- 1 root www-data 590 Dec 18 10:33 100.fw -rw-r----- 1 root www-data 633 Nov 4 13:42 101.fw -rw-r----- 1 root www-data 341 Nov 4 13:42 102.fw -rw-r----- 1 root www-data 205 Nov 4 13:42 103.fw -rw-r----- 1 root www-data 81 Nov 4 14:02 104.fw -rw-r----- 1 root www-data 81 Nov 7 11:27 105.fw -rw-r----- 1 root www-data 140 Feb 8 12:50 107.fw -rw-r----- 1 root www-data 264 Dec 4 13:15 110.fw -rw-r----- 1 root www-data 140 Feb 8 12:48 111.fw -rw-r----- 1 root www-data 850 Feb 12 09:18 cluster.fw root@pve77:~# rm -rf /etc/pve/firewall/* root@pve77:~# pve-firewall status Status: disabled/stopped |
本来ならば、この状態でクラスタへ再参加できるか試してみるべきなのですが、それは時間の都合上オミット。
クラスタ投票数の問題回避
クラスタ構築時に触れた通り、クラスタの安定動作に必要な最小ノード数は3つ。これは、各ノードが1の投票数を持っていて、クラスタ内のその総数が過半数を超えていないと正常とみなされないことに由来しており、2ノードクラスタのままでは冗長性が確保されません。
今後、移設工事により一時的に pve21 をオフラインにする予定があることから、残された pve25 の投票数を増やして、1ノードでもクラスタを維持できるように改ざんしてみます(本項はこちらを参考に)。
クラスタ内で最後まで残るノード、 pve25 のターミナルに入ってクラスタの状態と設定ファイル /etc/pve/corosync.conf の編集準備。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
root@pve25:~# pvecm status Cluster information ------------------- Name: pvecluster Config Version: 4 Transport: knet Secure auth: on Quorum information ------------------ Date: Tue Feb 11 10:25:07 2025 Quorum provider: corosync_votequorum Nodes: 2 Node ID: 0x00000003 Ring ID: 2.d3 Quorate: Yes Votequorum information ---------------------- Expected votes: 2 Highest expected: 2 Total votes: 2 Quorum: 2 Flags: Quorate Membership information ---------------------- Nodeid Votes Name 0x00000002 1 192.168.2.21 0x00000003 1 192.168.2.25 (local) root@pve25:~# cp /etc/pve/corosync.conf /etc/pve/corosync.new.conf root@pve25:~# ls -l /etc/pve/corosync* -rw-r----- 1 root www-data 448 Feb 11 09:39 corosync.conf -rw-r----- 1 root www-data 448 Feb 11 10:26 corosync.new.conf |
編集前の設定は次の通り、各ノードに等しく1の投票数が割り当てられています。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
logging { debug: off to_syslog: yes } nodelist { node { name: pve21 nodeid: 2 quorum_votes: 1 ring0_addr: 192.168.2.21 } node { name: pve25 nodeid: 3 quorum_votes: 1 ring0_addr: 192.168.2.25 } } quorum { provider: corosync_votequorum } totem { cluster_name: pvecluster config_version: 4 interface { linknumber: 0 } ip_version: ipv4-6 link_mode: passive secauth: on version: 2 } |
これを改ざん後のファイルでは、 pve25 の quorum_votes を 2 に増やし、 totem 下のバージョン番号 config_version を進めます。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
root@pve25:~# cat /etc/pve/corosync.new.conf logging { debug: off to_syslog: yes } nodelist { node { name: pve21 nodeid: 2 quorum_votes: 1 ring0_addr: 192.168.2.21 } node { name: pve25 nodeid: 3 quorum_votes: 2 #<--INCREMENT VERSION ring0_addr: 192.168.2.25 } } quorum { provider: corosync_votequorum } totem { cluster_name: pvecluster config_version: 5 #<--INCREMENT VERSION interface { linknumber: 0 } ip_version: ipv4-6 link_mode: passive secauth: on version: 2 } |
最後に、新旧2つの設定ファイルを入れ替えると、
|
1 2 3 4 5 6 |
root@pve25:~# mv /etc/pve/corosync.conf /etc/pve/corosync.conf.bak root@pve25:~# mv /etc/pve/corosync.new.conf /etc/pve/corosync.conf root@pve25:~# ls -l /etc/pve/corosync* -rw-r----- 1 root www-data 447 Feb 11 10:30 corosync.conf -rw-r----- 1 root www-data 448 Feb 11 10:29 corosync.conf.bak |
新しい設定が即反映されていました。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
root@pve25:~#pvecm status Cluster information ------------------- Name: pvecluster Config Version: 5 Transport: knet Secure auth: on Quorum information ------------------ Date: Tue Feb 11 10:30:35 2025 Quorum provider: corosync_votequorum Nodes: 2 Node ID: 0x00000003 Ring ID: 2.d3 Quorate: Yes Votequorum information ---------------------- Expected votes: 3 Highest expected: 3 Total votes: 3 Quorum: 2 Flags: Quorate Membership information ---------------------- Nodeid Votes Name 0x00000002 1 192.168.2.21 0x00000003 2 192.168.2.25 (local) |
WebUI上でも、改ざんした投票数を確認できました。










