Project

General

Profile

Bug #19566

Creating a new host VM on xen fails with: undefined method `new_host?'

Added by Stefan Heil over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

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!


Related issues

Related to Foreman - Feature #18064: Ability to import and provision existing VMsClosed2017-01-13

Associated revisions

Revision e88d32a6 (diff)
Added by Timo Goebel over 3 years ago

fixes #19566 - replace new_vm? with new_host? for 1.15

History

#1 Updated by Stefan Heil over 3 years ago

  • Related to Refactor #19340: new_host vs new_vm variable in compute resource VM partials added

#3 Updated by Luke Huxley over 3 years ago

  • Priority changed from Normal to High

#4 Updated by Timo Goebel over 3 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

#5 Updated by Timo Goebel over 3 years ago

  • Related to Feature #18064: Ability to import and provision existing VMs added

#6 Updated by Timo Goebel over 3 years ago

  • Related to deleted (Refactor #19340: new_host vs new_vm variable in compute resource VM partials)

#7 Updated by Timo Goebel over 3 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF