VxRailでは、VxRail Manager GUIにてクラスタのシャットダウンボタンを提供しており、簡単にクラスタシャットダウンを実施できますが、
VMware KB#60424で紹介されている通り、VSAN環境では、通常のシャットダウン手順では、データの不整合を引き起こす恐れがあり、
KBに従ったStepによってシャットダウンを実施することを推奨しております。
※本記事を公開するにあたり 十分検証確認を行っておりますが、データ保全に関して当アカウントは責任を負いかねますのであらかじめご了承下さい
下記EMCのKBに従ったVxRailの起動手順を詳細にご説明します。
VxRail: vSAN cluster shutdown and restart may lead to data unavailability after a single failure (Related VMware KB# 60424)
https://support.emc.com/kb/528792
VMTN コミュニティでは起動と停止の手順を以下の通り公開しています。
① VMware KB#60424に基づいたVxRailにおけるクラスタシャットダウン手順
② VMware KB#60424に基づいたVxRailにおけるクラスタ起動手順 <--- 本記事です
まず、大まかな流れとしては、下記のようになります。
■Node起動・ステータス確認編 1.Nodeの起動 2.vSAN Diskの正常ステータスの確認 3.メンテナンスモードの解除
■vSANトラフィックの復活・仮想マシン起動編 4.crontabの編集 5.vSANオブジェクトの健全性確認 6.crontabの再編集 7.VCSA/PSCの仮想マシンを起動する 8.VCSA/PSC以外のすべての仮想マシンを起動する |
■Node起動・ステータス確認編
1.Nodeの起動
電源ケーブルを抜いている場合は接続し、iDRAC/BMC経由、又は物理的に電源ボタンを押してNodeを起動してください
また、ESXiが正常に起動していることをモニターや仮想コンソールから併せて確認してください
起動が完了したら、下記コマンドをすべてのESXiホストで実行しシャットダウン時と同じステータスであることを確認します
[root@esxi01:~] esxcli vsan cluster get | grep "Local Node State"
Local Node State: MASTER
なお、出力結果として”Local Node State: DISCOVER”と表示される場合があります。
その際、localcliコマンドで MASTERステータスであれば、問題ありません。
[root@esxi01:~] localcli vsan cluster get | grep "Local Node State"
Local Node State: MASTER
2.vSAN Diskの正常ステータスの確認
下記コマンドをすべてのESXiホストで実行し、全てのDiskの"In CMMDS:" の値が "true" であることを確認します
[root@esxi01:~] esxcli vsan storage list | grep "In CMMDS"
In CMMDS: true
In CMMDS: true
In CMMDS: true
In CMMDS: true
In CMMDS: true
In CMMDS: true
3.下記コマンドをすべてのESXiホストで実行し、メンテナンスモードの解除を実施します
[root@esxi01:~] esxcli system maintenanceMode set -e false
[root@esxi01:~] esxcli vsan cluster get | grep "Maintenance Mode State"
Maintenance Mode State: OFF
■vSANトラフィックの復活・仮想マシン起動編
4.すべてのESXiホストにて、crontabを編集していきます。
※すべてのESXiホストで同時に実行する必要があるため、4-4で設定する時刻はNode数と作業の手際を考慮した時刻で設定してください
4-1. 各ESXiホストにsshでログインし、クラスタシャットダウン時に配置したスクリプトを確認します。
・ls コマンドでファイルを転送したservice-datastore1のディレクトリにスクリプト「post_reboot.sh」があることを確認。
[root@esxi01:/vmfs/volumes/5d330ce3-a0099b84-7fbe-XXXXXXXXXXXX] ls -l
total 1024
drwxr-xr-x 1 root root 73728 Jul 22 09:00 idrac
drwxr-xr-x 1 root root 73728 Jul 20 15:37 images
drwxr-xr-x 1 root root 73728 Jul 20 12:55 order
-rwxr-xr-x 1 root root 498 Jul 24 12:43 post_reboot.sh
-rwxr-xr-x 1 root root 346 Jul 24 12:43 pre_reboot.sh
drwxr-xr-x 1 root root 69632 Jul 20 13:00 pservice
drwxr-xr-x 1 root root 73728 Jul 22 09:00 ptagent
drwxr-xr-x 1 root root 73728 Jul 20 13:02 reset
drwxr-xr-x 1 root root 73728 Jul 20 12:55 vibs
d-w-r-xr-T 1 root root 73728 Jul 20 13:36 vmkdump
・post_reboot.shに、追記した「esxcli vsan network ip add -i <VMkNic Name> -T=<Traffic Type>」の一文があることを確認
※追記したものがない場合は、再度編集して追記してください
[root@esxi01:~] vi /vmfs/volumes/DE700xxxxxxx16-01-01-service-datastore1/post_reboot.sh
#!/bin/sh
# Make sure to do this before running pre_reboot.sh on hosts.
#
# Using the output of the command 'esxcli van network list', find
# the names of the vmknics and their associated traffic types.
#
# For each of those vmknics add one command to enable vsan traffic
# using the following command.
#
#
# esxcli vsan network ip add -i <VMkNic Name> -T=<Traffic Type>
#
# Ex 1:
# esxcli vsan network ip add -i vmk98 -T=vsan
# Ex 2:
# esxcli vsan network ip add -i vmk99 -T=witness
esxcli vsan network ip add -i vmk3 -T=vsan
4-2. rootのcrontabのバックアップをとっておく
[root@esxi01:~] cp /var/spool/cron/crontabs/root /vmfs/volumes/DE700xxxxxxx16-01-01-service-datastore1/root_crontab.BKP2
4-3. システムの現在時刻を確認する(VxRailではUTC <JST-9> のTimezoneとなります)
[root@esxi01:~] date
Sun Jul 28 03:38:56 UTC 2019
4-4. viコマンドでcrontabを編集し、下記のようなpost_reboot.shスクリプトを実行する1文を記載します
※クラスタシャットダウン時に記載した、pre_reboot.shスクリプトを実行する1文は削除してください
[root@esxi01:~] vi /var/spool/cron/crontabs/root
#min hour day mon dow command
1 1 * * * /sbin/tmpwatch.py
1 * * * * /sbin/auto-backup.sh
0 * * * * /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5 * * * * /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
00 1 * * * localcli storage core device purge
*/2 * * * * /usr/lib/vmware/vsan/bin/vsanObserver.sh ++group=host/vim/vmvisor/vsanobserver
*/5 * * * * /usr/lib/emc/secure_process.sh "timeout -t 90 /usr/bin/env python /bin/marvin-endpoint-post"
0 * * * * /bin/sh /opt/dell/DellPTAgent/scripts/clearTmpFile.sh
*/5 * * * * python /opt/dell/DellPTAgent/scripts/PTAgent_Monitor_35.pyc
*/15 * * * * /usr/lib/emc/collector.sh >> /var/log/emc/logs/mystic-collector.log 2>&1
*/1 * * * * /usr/lib/emc/secure_process.sh "/usr/lib/emc/shutdown_ESX.py"
30 4 28 7 * /vmfs/volumes/DE700xxxxxxx16-01-01-service-datastore1/post_reboot.sh
※数字は左から分 時 日 月となりますので、上記例の場合、7/28 4:30(UTC<JST-9>)にpre_reboot.shを実行するように指定してあります。
※pre_reboot.shはシャットダウン時に使用するスクリプトのため、起動時には設定しないでください
4-5. 下記コマンドを実行してcrondを再起動し、編集したcrontabの内容を適用させます。
[root@esxi01:~] kill -HUP $(cat /var/run/crond.pid)
[root@esxi01:~] /usr/lib/vmware/busybox/bin/busybox crond
5.vSANオブジェクトの健全性確認を確認します。
5-1. 指定した時刻が過ぎてから、下記コマンドをすべてのESXiホストで実行し、cron jobの内容が問題なく実行されたことを確認します
[root@esxi01:~] esxcli vsan network list
Interface
VmkNic Name: vmk3
IP Protocol: IP
Interface UUID: 1334335d-8295-a311-5c11-e4434b18d3b4
Agent Group Multicast Address: 224.2.3.4
Agent Group IPv6 Multicast Address: ff19::2:3:4
Agent Group Multicast Port: 23451
Master Group Multicast Address: 224.1.2.3
Master Group IPv6 Multicast Address: ff19::1:2:3
Master Group Multicast Port: 12345
Host Unicast Channel Bound Port: 12321
Multicast TTL: 5
Traffic Type: vsan
5-2. 下記コマンドをすべてのESXiホストで実行し、何も出力されずにプロンプトが返ってくることを確認します
[root@esxi01:~] cmmds-tool find -f python | grep -C5 CONFIG_STATUS | grep content | grep -v "state....7\|state....15"
[root@esxi01:~]
問題があるデータが存在する場合、何らかの返り値が出力されます。
6.すべてのESXiホストにて、crontabを編集していきます。
6-1. viコマンドでcrontabを編集し、下記のようにpost_reboot.shスクリプトを実行する1文を削除した状態にします
(クラスタシャットダウン実施前の状態)
[root@esxi01:~] vi /var/spool/cron/crontabs/root
#min hour day mon dow command
1 1 * * * /sbin/tmpwatch.py
1 * * * * /sbin/auto-backup.sh
0 * * * * /usr/lib/vmware/vmksummary/log-heartbeat.py
*/5 * * * * /bin/hostd-probe.sh ++group=host/vim/vmvisor/hostd-probe/stats/sh
00 1 * * * localcli storage core device purge
*/2 * * * * /usr/lib/vmware/vsan/bin/vsanObserver.sh ++group=host/vim/vmvisor/vsanobserver
*/5 * * * * /usr/lib/emc/secure_process.sh "timeout -t 90 /usr/bin/env python /bin/marvin-endpoint-post"
0 * * * * /bin/sh /opt/dell/DellPTAgent/scripts/clearTmpFile.sh
*/5 * * * * python /opt/dell/DellPTAgent/scripts/PTAgent_Monitor_35.pyc
*/15 * * * * /usr/lib/emc/collector.sh >> /var/log/emc/logs/mystic-collector.log 2>&1
*/1 * * * * /usr/lib/emc/secure_process.sh "/usr/lib/emc/shutdown_ESX.py"
6-2. 下記コマンドを実行してcrondを再起動し、編集したcrontabの内容を適用させます。
[root@esxi01:~] kill -HUP $(cat /var/run/crond.pid)
[root@esxi01:~] /usr/lib/vmware/busybox/bin/busybox crond
7.PSC -> VCSAの順に仮想マシンを起動します。
7-1. クラスタシャットダウン時にメモした、PSCおよびVCSAが稼働しているESXiホストのHost Clientにアクセスし、
PSC -> VCSAの順に仮想マシンを起動します。
左側のMenuのVirtual Machinesを選択します
vCenter Server Platform Services Controllerを選択し、Power ONを実施します
その後PSCの起動を確認し、vCenter Server Applianceも同様にPower ONを実施します
7-2. Health Checkの実施
VCSA及びPSCのPower Onが完了したら、vSANのHealth Checkを実施します。
vSphere Web ClientへLoginを実施し、
VxRail: Health Check 方法のvSAN ヘルスチェック を実施しエラーがないことを確認します
8.VCSA/PSC以外のすべての仮想マシンを起動します
VxRail ManagerやESRSを含めた、その他の仮想マシンの起動を実施します