Project

General

Profile

Actions

Bug #19566

closed

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

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

Status:
Closed
Priority:
High
Assignee:
-
Difficulty:
Triaged:
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 1 (0 open1 closed)

Related to Foreman - Feature #18064: Ability to import and provision existing VMsClosedTimo Goebel01/13/2017Actions
Actions #1

Updated by Stefan Heil over 7 years ago

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

Updated by Luke Huxley over 7 years ago

  • Priority changed from Normal to High
Actions #4

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

Actions #5

Updated by Timo Goebel over 7 years ago

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

Updated by Timo Goebel over 7 years ago

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

Updated by Timo Goebel over 7 years ago

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

Also available in: Atom PDF