Hello,
I cannot remove a host (that is gone for a while now) from vcenter.
It appears disconnected and here is the error when I want to remove it from the inventory:
The object or item referred to could not be found. vDS dvs port c-150662 cannot be found
In vpxd.log no more specific informations:
2021-11-03T11:15:11.757+01:00 info vpxd[15600] [Originator@6876 sub=Default opID=kv84gjry-2934932-auto-1qwm5-h5:70368331-8] [VpxLRO] -- ERROR task-
68322902 -- domain-s1587083 -- vim.ManagedEntity.destroy: vim.fault.NotFound:
--> Result:
--> (vim.fault.NotFound) {
--> faultCause = (vmodl.MethodFault) null,
--> faultMessage = (vmodl.LocalizableMessage) [
--> (vmodl.LocalizableMessage) {
--> key = "com.vmware.vim.vpxd.dvs.portNotFound.label",
--> arg = (vmodl.KeyAnyValue) [
--> (vmodl.KeyAnyValue) {
--> key = "port",
--> value = "c-150662"
--> }
--> ],
--> message = <unset>
--> }
--> ]
--> msg = ""
--> }
--> Args:
-->
Would anybody know how to remove from VCDB this host and all its reference ?
Thank you for your help.
jb
I finally found the VM (it was a template disconnected) corresponding to this device id, and manually deleted it following https://virtual-power.in/f/removing-a-stale-vm-entry-from-vcenter-db
The disconnected host has been deleted succesfully after that.
I have searched the text "150662" in all vc tables and found one occurrence in vpx_vm_virtual_device:
The device type is : vim.vm.device.VirtualVmxnet3 and text is :
<obj xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:vim25" versionId="6.7.2" xsi:type="VirtualVmxnet3"><key>4000</key><deviceInfo><label>Network adapter 1</label><summary>DVSwitch: 8c 23 2b 50 b4 c1 22 62-6a 5c a0 bb 47 25 cd 6d</summary></deviceInfo><backing xsi:type="VirtualEthernetCardDistributedVirtualPortBackingInfo"><port><switchUuid>8c 23 2b 50 b4 c1 22 62-6a 5c a0 bb 47 25 cd 6d</switchUuid><portgroupKey>dvportgroup-189595</portgroupKey><portKey>c-150662</portKey><connectionCookie>1037262735</connectionCookie></port></backing><connectable><migrateConnect>unset</migrateConnect><startConnected>true</startConnected><allowGuestControl>true</allowGuestControl><connected>false</connected><status>unrecoverableError</status></connectable><slotInfo xsi:type="VirtualDevicePciBusSlotInfo"><pciSlotNumber>192</pciSlotNumber></slotInfo><controllerKey>100</controllerKey><unitNumber>7</unitNumber><addressType>assigned</addressType><macAddress>00:50:56:ab:06:54</macAddress><wakeOnLanEnabled>true</wakeOnLanEnabled><resourceAllocation><reservation>0</reservation><share><shares>50</shares><level>normal</level></share><limit>-1</limit></resourceAllocation><uptCompatibilityEnabled>true</uptCompatibilityEnabled></obj>
The dvs-portgroup still exists, I am sure there is no VM ith the mac address, so, do you think I could delete this entry ?
I finally found the VM (it was a template disconnected) corresponding to this device id, and manually deleted it following https://virtual-power.in/f/removing-a-stale-vm-entry-from-vcenter-db
The disconnected host has been deleted succesfully after that.
Happy to know my blog helped you!
Hello AJ,
I marked it as correct...even if my post looked like a monologue 🙂
But undoubtedly your sql code make me more comfortable to delete the rights objects in the database.