===== Eliminar manualmente un host del Vcenter ===== Recientemente he tenido un problema al intentar eliminar un host del vcenter al que previamente le había cambiado los permisos. Primero intente eliminar el host desde el PowerCli [[http://www.vmware.com/support/developer/PowerCLI/index.html]] ejecutando: Set-ExecutionPolicy RemoteSigned Connect-VIServer -Server -User -Password Remove-VMHost host.red -Confirm:$false Como había cambiado los permisos me dio un error por falta de ellos para eliminar la máquina. Ante ello sólo quedaba eliminar el host manualmente de la base de datos del vcenter Para ello hay que ejecutar los siguientes pasos: - Parar el servicio Vmware VirtualCenter - Abrir el SQL Manager y ejecutar lo siguiente: use vim_vcdb select ID from VPX_ENTITY where name ='host.red.local'; Nos da un identificador que será el usaremos para los siguientes pasos delete from vpx_ds_assignment where entity_id in (select id from vpx_vm where host_id = 3761); delete from vpx_nw_assignment where entity_id in (select id from vpx_vm where host_id = 3761); Comprobamos que máquinas virtuales están asociadas a dichos host select id from vpx_vm where host_id = 3761; y apuntamos en un papel su identificador que usaremos más adelante delete from vpx_vm where host_id = 3761; Borramos las máquinas virtuales asociadas a este host que habiamos anotado previamente delete from vpx_entity where id in (724,717,4837,5259); delete from vpx_host where id = 3761; delete from vpx_entity where id = 3761; delete from vpx_entity where parent_id = 3761; delete from vpx_entity where id = 3761; Reiniciamos el servicio VMware Vcenter ==== Referencias ==== * http://www.douglaspsmith.com/home/2011/1/6/manually-removing-a-host-from-inventory.html