Remove Host From Inventory and Add It Again

Some time ago, after I tried to remove ESXi host from vCenter information technology was still appearing in vSphere client with alert and I couldn't remove it over again. Someone would say it is just cosmetic upshot, but for example storage service was failing from initializing considering of information technology too. VMware support provided me with transmission how to exercise transmission cleanup directly in database, equally it wasn't publicly available at the fourth dimension of my issue. I would similar to share sequence with you (I performed this procedure in vCenter 5.5, nevertheless according to VMware it should piece of work from two.5):

Warning: Sequence is provided as is and without any guarantee and should be used only equally last resort if all attempts to remove host failed, although I've got the sequence from VMware support it is not official, and you lot can seriously damage your database. I strongly recommend you to contact VMware support in case of similar issues. Brand sure you accept latest fill-in of you vCenter database.

1. Stop the VMware VirtualCenter service on the vCenter Server. 2. Identify the ESX host ID in the vCenter database with the control:

select ID from VPX_ENTITY where proper name ='10.66.4.211';

Note: ESXi host being removed is x.66.4.211 was previously added under IP not DNS proper noun. This name  returned a host ID of 2445 when the select statement higher up was executed.

3. Execute these SQL statements to remove the ESX\ESXi host from the vCenter database.

Note: At that place are constraint definitions defined in the database therefore post-obit SQL statements must exist executed in the guild.

a. Remove all the datastore assignments for virtual machines which exist on this ESXi host with the statement:

delete from vpx_ds_assignment where entity_id in (select id from vpx_vm where host_id = 2445);

b. Remove all the network assignments virtual machines that exist on this ESXi host with the statement:

delete from vpx_nw_assignment where entity_id in (select id from vpx_vm where host_id = 2445);

c. List the virtual machines in the virtual machine table which be on this ESX\ESXi host with the statement:

select id from vpx_vm where host_id = 2445;

Make a note of whatsoever virtual car IDs returned. In this example, the values returned are 26149, 26215, 26217, 26219, 95343.

d. Delete virtual machines which exist on this ESXi from the virtual machine table with the argument:

delete from vpx_vm where host_id = 2445;

due east. Delete virtual machines which be on this ESXi host from the entity table with the statement:

delete from vpx_entity where id in (26149,26215,26217,26219,95343);

f. Delete the DVS entries associated with the ESX\ESXi host with the statement:

delete from vpx_dvhost where host_id = 2445; delete from vpx_dvport_membership where host_id = 2445; delete from vpx_dvs_blob where host_id = 2445;

yard. Delete the ESXi host from the host table with the statement:

delete from vpx_host where id = 2445;

h. Remove all relations to this ESX host from the entity table with the statement (Really in my case only this footstep was necessary):

delete from vpx_entity where parent_id = 2445; delete from vpx_entity where id = 2445;

four. Offset the VMware vCenter Server service on the vCenter Server to pick upwardly the database changes.

The following ii tabs alter content below.

Dusan has over viii years experience in the Virtualization field. Currently working as Senior VMware plarform Architect at ane of the biggest retail banking concern in Slovakia. He has background in closely related technologies including server operating systems, networking and storage. Used to be a member of VMware Center of Excellence at IBM, co-author of several Redpapers. His main telescopic of work consists from designing and performance optimization of business disquisitional virtualized solutions on vSphere, including, but not limited to Oracle WebLogic, MSSQL and others. He holds several Information technology industry leading certifications like VCAP-DCD, VCAP-DCA, MCITP and the others. Honored with #vExpert2015-2018 awards by VMware for his contribution to the community. Opinions are my own!

Almost Dusan Tekeljak

Dusan has over 8 years experience in the Virtualization field. Currently working as Senior VMware plarform Architect at one of the biggest retail bank in Slovakia. He has background in closely related technologies including server operating systems, networking and storage. Used to be a member of VMware Center of Excellence at IBM, co-writer of several Redpapers. His main scope of work consists from designing and performance optimization of business organisation disquisitional virtualized solutions on vSphere, including, merely not limited to Oracle WebLogic, MSSQL and others. He holds several IT manufacture leading certifications like VCAP-DCD, VCAP-DCA, MCITP and the others. Honored with #vExpert2015-2018 awards by VMware for his contribution to the community. Opinions are my ain!

tatehictis.blogspot.com

Source: https://thevirtualist.org/manually-remove-esxi-host-vcenter-database/

0 Response to "Remove Host From Inventory and Add It Again"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel