vcenter出现大量孤立的主机分析

来源:互联网 发布:投影机写码软件 编辑:程序博客网 时间:2024/06/05 00:30
如果使用客户端或者API操作删除虚机,在vcenter上查看会出现孤立,说明如下。

Adding Existing Virtual Machines to vCenter Server

When you add a host to vCenter Server, it discovers all the virtual machines on that managed host and adds them to the vCenter Server inventory.

If a managed host is disconnected, the already discovered virtual machines continue to be listed in the inventory.

If a managed host is disconnected and reconnected, any changes to the virtual machines on that managed host are identified, and the vSphere Client updates the list of virtual machines. For example, if node3 is removed and node4 is added, the new list of virtual machines adds node4 and shows node3 asorphaned.



http://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.vsphere.vm_admin.doc_50/GUID-5C6A3F59-F4F9-4DA2-AE90-E948CAEC0846.html?resultof=%2522%256f%2572%2570%2568%2561%256e%2565%2564%2522%2520%2522%256f%2572%2570%2568%2561%256e%2522%2520


试验发现使用viewclient或API删除都会有此情况

不管是客户端还是API,都仍然是vmware的用户。而vcenter则是管理员,
用户删除什么,管理员起码要知道。从这个层面上讲,vmware这样处理也是合适的。


openstack删除vm的处理如下
https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vmops.py#L1557

defdestroy(self,instance, destroy_disks=True):"""Destroy a VM instance.Steps followed for each VM are:1. Power off, if it is in poweredOn state.2. Un-register.3. Delete the contents of the folder holding the VM related data."""LOG.debug("Destroying instance",instance=instance)self._destroy_instance(instance,destroy_disks=destroy_disks)LOG.debug("Instance destroyed",instance=instance)

0 0