XenServer 隐藏的虚拟机
2014-11-28 by dongnan
环境
CloudStack 4.4
XenServer 6.2
问题描述
从 Pool
移除主机时提示错误:
xe pool-eject host-uuid=47d72d9a-a834-4c60-abe1-b161b93b38d2
WARNING: Ejecting a host from the pool will reinitialise that host's local SRs.
WARNING: Any data contained with the local SRs will be lost.
The following VDI objects will be destroyed:
VDI: b7e18265-f74d-4920-a6d1-ad6a132f56cf (base copy)
....
VDI: 8a07e413-9ac5-45f4-a88b-41c299c714f1 (SCSI 5:0:0:0)
Type 'yes' to continue
yes # 输入yes
This operation cannot be performed because this VDI is in use by some other operation
vdi: 06c852d1-47f5-41a1-86d9-65961af7fd7e (New virtual disk (1))
operation: <unknown>
虚拟机的问题
按照提示查看这个虚拟机
首先查看该VDI信息
xe vdi-param-list uuid=06c852d1-47f5-41a1-86d9-65961af7fd7e
uuid ( RO) : 06c852d1-47f5-41a1-86d9-65961af7fd7e
name-label ( RW): New virtual disk (1)
name-description ( RW):
is-a-snapshot ( RO): false
snapshot-of ( RO): <not in="" database="">
snapshots ( RO):
snapshot-time ( RO): 19700101T00:00:00Z
allowed-operations (SRO): clone; copy; snapshot
current-operations (SRO):
sr-uuid ( RO): d72b2a29-c019-74f4-6b98-2765582d4846
sr-name-label ( RO): Local storage
vbd-uuids (SRO): 980f6e6c-a13d-2eb2-b5d3-29067e97f052 # 这里
crashdump-uuids (SRO):
virtual-size ( RO): 214748364800
physical-utilisation ( RO): 215176183808
location ( RO): 06c852d1-47f5-41a1-86d9-65961af7fd7e
type ( RO): User
sharable ( RO): false
read-only ( RO): false
storage-lock ( RO): false
managed ( RO): true
parent ( RO): <not in="" database="">
missing ( RO): false
other-config (MRW): content_id: d5d68639-12db-efdd-0f91-02bca2061be9
xenstore-data (MRO):
sm-config (MRO): vdi_type: vhd; vmhint: OpaqueRef:4254bb70-d111-bf78-191c-47ca664bbd54
on-boot ( RW): persist
allow-caching ( RW): false
metadata-latest ( RO): false
metadata-of-pool ( RO): <not in="" database="">
根据VDI查询VBD信息
xe vbd-param-list uuid=980f6e6c-a13d-2eb2-b5d3-29067e97f052
uuid ( RO) : 980f6e6c-a13d-2eb2-b5d3-29067e97f052
vm-uuid ( RO): 83670073-de0d-482e-9370-5ea894fd96f6 # 这里
vm-name-label ( RO): Control domain on host: xenserver-23317
vdi-uuid ( RO): 06c852d1-47f5-41a1-86d9-65961af7fd7e
vdi-name-label ( RO): New virtual disk (1)
allowed-operations (SRO): pause; unpause; attach; unplug_force; unplug
current-operations (SRO):
empty ( RO): false
device ( RO): sm/backend/d72b2a29-c019-74f4-6b98-2765582d4846/06c852d1-47f5-41a1-86d9-65961af7fd7e
userdevice ( RW): 0
bootable ( RW): false
mode ( RW): RO
type ( RW): Disk
unpluggable ( RW): true
currently-attached ( RO): true
attachable ( RO): true
storage-lock ( RO): false
status-code ( RO): 0
status-detail ( RO):
qos_algorithm_type ( RW):
qos_algorithm_params (MRW):
qos_supported_algorithms (SRO):
other-config (MRW): task_id: OpaqueRef:754d73b0-d3ea-a0ce-9447-0e650be80d9c
io_read_kbs ( RO): <unknown>
io_write_kbs ( RO): <unknown>
根据VBD查询VM信息
xe vm-list uuid=83670073-de0d-482e-9370-5ea894fd96f6
uuid ( RO) : 83670073-de0d-482e-9370-5ea894fd96f6
name-label ( RW): Control domain on host: xenserver-23317
power-state ( RO): running
删除隐藏的虚拟机
在 XenCenter 查看隐藏的虚拟机
删除隐藏的虚拟机
其它
如果即使删除了隐藏的vm
,还是无法从pool
中移除主机?
估计是此 xenserver
作为源 pool master host
,配置文件出错导致,不过在重启此 xenserver
时却找到了另外的方法,如下图
- 第1步
reboot xenserver
- 第2步
destorying host "xenserver XX"
验证
xe host-list
uuid ( RO) : 584e8d5d-f461-4bf2-9a2b-3f99e38059c5
name-label ( RW): xenserver-23319
name-description ( RW): Default install of XenServer
按照以上方法成功pool
中只有一台xenserver
,被移除的xenserver
启动后会无法连接pool master
重装即可。
小结
从 pool
移除某主机时,提示有活动的vdi
,根据 vdi
查找运行的vm
为 Control domain on host: xenserver-23317
。
此 vm
为隐藏,在 xenserver
不可见,此vm
导致无法从pool
删除主机,可能是由于导出/导入 vm
过程中断,遗留下来的。
参考
this operation cannot be performed because a VDI is in use by some other operation