VMware vSAN集群,删除不可访问的对象
问题现象
Skyline 运行状况
1. vSAN 对象运行状况,出现不可访问的对象
2. 查看详细信息,对象名称显示“未知对象类型”
3. 无法通过“清除不可访问的虚拟机交换对象”进行清除,提示“未找到不可访问的虚拟机交换对象。”
解决办法
SSH登录vCenter,使用rvc localhost
登录RVC
如果rvc localhost登录报错,提示“Failed to connect to localhost: Public key fingerprint for host 'localhost' does not match /root/.rvc/known_hosts:0.”
需要重命名或删除known_hosts,命令如下
cd /root/.rvc
mv known_hosts known_hosts.bak
再次登录RVC
1. 使用ls和cd,进入到集群,最终进入到/localhost/SH-Datacenter/computers/SH-VSAN
2. 执行vsan.check_state -r .
,检查不可访问的对象
3. 列出的不可访问的对象UUID,应该与Skyline 运行状况中显示的一样
4. 使用vsan.cmmds_find -u <UUID> .
,检查不可访问对象的详细信息,详细信息第三列Owner,可以看到ESXi主机的IP
5. SSH登录对应的ESXi主机,使用命令删除不可访问的对象/usr/lib/vmware/osfs/bin/objtool delete -u <UUID> -f -v 10
进入集群,查看不可访问对象UUID,命令记录
root@sh-vcsa7 [ ~/.rvc ]# rvc localhost
[DEPRECATION] This gem has been renamed to optimist and will no longer be supported. Please switch to optimist as soon as possible.
Install the "ffi" gem for better tab completion.
The authenticity of host 'localhost' can't be established.
Public key fingerprint is 6c410619e2d924500a8f7b159410dab1d7dae106dde08687731ba8e3e285afb4.
Are you sure you want to continue connecting (y/n)? y
Warning: Permanently added 'localhost' (vim) to the list of known hosts
Using default username "administrator@vsphere.local".
password:
0 /
1 localhost/
> ls
0 /
1 localhost/
> cd 1
/localhost> ls
0 SH-Datacenter (datacenter)
/localhost> cd SH-Datacenter/
/localhost/SH-Datacenter> ls
0 storage/
1 computers [host]/
2 networks [network]/
3 datastores [datastore]/
4 vms [vm]/
/localhost/SH-Datacenter> cd 1
/localhost/SH-Datacenter/computers> ls
0 SH-VSAN (cluster): cpu 314 GHz, memory 4399 GB
/localhost/SH-Datacenter/computers> cd 0
/localhost/SH-Datacenter/computers/SH-VSAN> ls
0 hosts/
1 resourcePool [Resources]: cpu 314.09/314.09/normal, mem 4399.39/4399.39/normal
/localhost/SH-Datacenter/computers/SH-VSAN> vsan.check_state -r .
2025-04-16 15:04:01 +0800: Step 1: Check for inaccessible vSAN objects
Detected 0ef92565-0c26-0a35-be92-00620b925480 to be inaccessible, refreshing state
Detected 970fec65-e24f-0345-d8d1-00620b784b80 to be inaccessible, refreshing state
Detected 6a6d8664-6ef9-465d-ea93-00620b925480 to be inaccessible, refreshing state
Detected 556eec65-f2f6-db73-fc97-00620b784b80 to be inaccessible, refreshing state
2025-04-16 15:04:06 +0800: Step 1b: Check for inaccessible vSAN objects, again
Detected 0ef92565-0c26-0a35-be92-00620b925480 is still inaccessible
Detected 970fec65-e24f-0345-d8d1-00620b784b80 is still inaccessible
Detected 6a6d8664-6ef9-465d-ea93-00620b925480 is still inaccessible
Detected 556eec65-f2f6-db73-fc97-00620b784b80 is still inaccessible
2025-04-16 15:04:06 +0800: Step 2: Check for invalid/inaccessible VMs
2025-04-16 15:04:06 +0800: Step 2b: Check for invalid/inaccessible VMs again
2025-04-16 15:04:06 +0800: Step 3: Check for VMs for which VC/hostd/vmx are out of sync
Found VMs for which VC/hostd/vmx are out of sync:
VCSA-31.8_replica
BackupSrv_replica
ELNDBserver-VAL2
ELNWEBserver-VAL2
SQLCS-BAK
DataCJ01-BAK
/localhost/SH-Datacenter/computers/SH-VSAN>
来源:https://vinfrastructure.it/2019/11/purge-inaccessible-objects-in-vmware-vsan/