Project

General

Profile

Bug #18366

vSphere: exception raised when vm cannot be created correctly

Added by Timo Goebel about 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources - VMware
Target version:
Difficulty:
trivial
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

NoMethodError: undefined method `include?' for nil:NilClass | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:40:in `get_vm_by_name' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:25:in `block in get_vm_ref' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:25:in `map' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:25:in `get_vm_ref' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/requests/compute/get_virtual_machine.rb:7:in `get_virtual_machine' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-1.0.0/lib/fog/vsphere/models/compute/servers.rb:31:in `get' | /usr/share/foreman/app/models/compute_resource.rb:169:in `find_vm_by_uuid' | /usr/share/foreman/app/models/compute_resource.rb:187:in `destroy_vm' | /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:399:in `rescue in create_vm' | /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:386:in `create_vm' | /usr/share/foreman/app/models/concerns/orchestration/compute.rb:82:in `setCompute'

rescue block in create_vm should check if vm.id is not nil

Associated revisions

Revision b7cb8e5f (diff)
Added by Timo Goebel about 6 years ago

fixes #18366 - vmware: delete vm only if created with errors

Revision 0601db70 (diff)
Added by Timo Goebel about 6 years ago

fixes #18366 - vmware: delete vm only if created with errors

(cherry picked from commit b7cb8e5f47b6d10715cffc49070eee931d712637)

History

#1 Updated by The Foreman Bot about 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4249 added

#2 Updated by Timo Goebel about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Dominic Cleal about 6 years ago

  • Legacy Backlogs Release (now unused) set to 221

Also available in: Atom PDF