Delete hosts job succeeds but does not actually delete hosts

I’m trying to delete a bunch of hosts that have been physically deleted but are still present in Foreman. I’ve selected them in the hosts list, run “Delete hosts”, and the jobs finishes successfully (100% complete, green happy success message). But the hosts don’t actually get removed from the hosts lists. Same thing if I try opening an individual host entry and running delete from there – successful job, but the host remains.

Expected outcome:
Delete hosts really deletes the hosts.

Foreman and Proxy versions:

Distribution and version:
Alma Linux 8.9

Other relevant data:

We use PuppetDB, and it is enabled.
Puppet server 7.14

Most of the suggestions I’ve been able to find so far suggest disabling PuppetDB, but that’s not really an option for us. We make too much use if its fact reporting capabilities.

Hi @guertin

Does the host remain part of “Hosts > All Hosts” or do you still see the host on your compute resources?

Please have a look at Removing a Host from Foreman in Managing Hosts and check the Destroy associated VM on host delete setting on your Foreman.

Thanks for that. Those are the same instructions that I’ve been following. The hosts have already been deleted from the compute resources (Hyper-V VMs in this case), but they still show up in Foreman in “Hosts > All Hosts”, even after I’ve deleted them there.

I normally keep the Destroy associated VM on host delete setting off, but I just turned it on anyway and tried to delete the hosts again, with the same result. They still appear in All Hosts.