I have already posted this on matrix a few days ago, posting here too in case someone who’s not on there can help.
Problem:
We are testing lestejska’s patch from Fixes #37800 - Don't apply the compute profile when updating host by stejskalleos · Pull Request #10291 · theforeman/foreman · GitHub, since we are affected by the same issue. The patch worked flawlessly in out test environment, so we went ahead and tried it on the production instance where we are now facing a new issue (which I am somewhat certain is not caused by the patch, but rather surfaced now due to the original issue not being present anymore).
When trying to update a host provisioned to VMWare, we get the following error: “Failed to find compute attributes, please check if VM was deleted”, which as far as I could find is only thrown here: foreman/app/models/concerns/orchestration/compute.rb at develop · theforeman/foreman · GitHub . Following the chain of events that leads to this code being executed, it seems like the only way that code should be executed is if vm_exists?
returns false.
Though when I query the compute_object and it’s persisted?
attribute via rake console, I get the object and persisted? returns true. Modifying the host via the UI also works fine.
Expected outcome:
Host updated without error through the UI.
Foreman and Proxy versions:
3.9.3
Foreman and Proxy plugin versions:
- foreman-tasks 9.0.4
- foreman_expire_hosts 8.2.0
- foreman_hooks 0.3.17
- foreman_puppet 6.2.0
- foreman_remote_execution 12.0.5
- foreman_scc_manager 3.0.0
- foreman_snapshot_management 3.0.0
- foreman_templates 9.4.0
- foreman_webhooks 3.2.2
- katello 4.11.1
- puppetdb_foreman 6.0.2
Distribution and version:
RHEL8.10
Other relevant data:
Here is how I checked the compute info is present for one of the affected hosts through the console:
irb(main):003:0> Host::Managed.find_by(:id => 10267).compute_object.persisted?
=> true
So Foreman clearly has the correct association for the host and as far as I understand, the compute orchestration should not be checking anything else.
Dos someone have an idea where this might come from or how to debug this further?