Project

General

Profile

Actions

Bug #12070

closed

Compute instance creation fails with Automatic allocation

Added by Boris Kreitchman about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hi,

It seems since v0.1.3 when Hypervisor is set to "Automatic allocation" compute instance creation fails.
Probably because host is empty. Does fog always require specific home server for the VM? - it probably shouldn't.

2015-10-06 13:16:09 [sql] [I] <ArgumentError> Invalid :affinity attribute
        /opt/rh/ruby193/root/usr/share/gems/gems/fog-1.32.0/lib/fog/xenserver/requests/compute/create_server.rb:31:in `create_server_raw'
        /opt/rh/ruby193/root/usr/share/gems/gems/fog-1.32.0/lib/fog/xenserver/models/compute/server.rb:201:in `save'
        /opt/rh/ruby193/root/usr/share/gems/gems/foreman-xen/app/models/foreman_xen/xenserver.rb:302:in `create_vm_from_builtin'
        /opt/rh/ruby193/root/usr/share/gems/gems/foreman-xen/app/models/foreman_xen/xenserver.rb:182:in `create_vm'
        /usr/share/foreman/app/models/concerns/orchestration/compute.rb:76:in `setCompute'
...
Actions #1

Updated by Boris Kreitchman about 9 years ago

Boris Kreitchman wrote:

Hi,

It seems since v0.1.3 when Hypervisor is set to "Automatic allocation" compute instance creation fails.
Probably because host is empty. Does fog always require specific home server for the VM? - it probably shouldn't.

[...]

Following in create_vm_from_builtin() of foreman-xen/app/models/foreman_xen/xenserver.rb fixes it for me:

if args[:hypervisor_host] != ''
    host  = client.hosts.find { |host| host.name == args[:hypervisor_host] }
    logger.info "create_vm_from_builtin: host : #{ host.name }"    
elsif   
    host  = client.hosts.first
    logger.info "create_vm_from_builtin: host : #{ host.name }" 
end
Actions #2

Updated by Anonymous about 9 years ago

  • Status changed from New to Closed
  • Assignee set to Operations ooVoo
  • Pull request https://github.com/theforeman/foreman-xen/pull/28 added
  • Pull request deleted ()
Actions

Also available in: Atom PDF