Bug #19566
closedCreating a new host VM on xen fails with: undefined method `new_host?'
Description
When trying create a new host in the Foreman Web interface, as soon as I click on 'Deploy on' and select my XenServer, the 'Virtual Machine' tab throws an error:
Failure: undefined method `new_host?' for #<#<Class:0x0000000c66bf50>:0x007f8938274a48>
I suspect this has to do with this recent change: http://projects.theforeman.org/issues/19340
I tried changing "new_host" on line 30 of /usr/share/foreman/vendor/ruby/2.1.0/gems/foreman_xen-0.5.1/app/helpers/xen_compute_helper.rb to the new method "new_vm", but unfortunately this results in another error (after which I've given up further investigating, since I don't really know the codebase / Ruby well enough):
Failure: undefined method `compute_object' for #<Fog::Compute::XenServer::Models::Server:0x0000000d5994c8>
System info:
- Debian 8.8 (all packages up to date)
- Foreman 1.15.0 (installed via foreman-installer)
- ruby-foreman-xen 0.5.1-2 (installed from Debian package)
Any ideas for a short-term fix or - preferably - a new ruby-foreman-xen version that plays nicely with the current foreman version would be highly appreciated, as not being able to provision on Xen is a shop-stopper for us!
Thank you very much! Let me know if you need any more info (logs) from my side!
Updated by Stefan Heil over 7 years ago
- Related to Refactor #19340: new_host vs new_vm variable in compute resource VM partials added
Updated by Timo Goebel over 7 years ago
You could try the following:
Just add
def new_host?(host)
host.try(:new_record?)
end
to
app/helpers/xen_compute_helper.rb
Updated by Timo Goebel over 7 years ago
- Related to Feature #18064: Ability to import and provision existing VMs added
Updated by Timo Goebel over 7 years ago
- Related to deleted (Refactor #19340: new_host vs new_vm variable in compute resource VM partials)
Updated by Timo Goebel over 7 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset foreman-xen|e88d32a662ffe4eab9dcaf9b241dfd97294cff98.