Project

General

Profile

Bug #22798

VMware: Exception listing VMs in the root of the datacenter

Added by Adam Grare 5 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Compute resources - VMware
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

When listing virtual machines under a compute_resource on VMware vSphere a folder hash is built of all folders under the datacenter, but the datacenter's vmFolder is skipped in the PropertyFilterSpec.

This causes VMs which have the vmFolder as their parent to throw an undefined method '[]' for nil:NilClass error when they try to access 'folder_inventory[vm['parent']._ref][:path]'.

Traceback:
2018-03-06T11:11:34 fd0ae69d [app] [W] Error has occurred while listing VMs on dev-vc65 (VMware) | NoMethodError: undefined method `[]' for nil:NilClass | /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:61:in `lookup_parent_folders' | /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:62:in `lookup_parent_folders' | /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:56:in `block in set_folder_paths' | /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:55:in `each' | /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:55:in `set_folder_paths' | /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:50:in `generate_folder_inventory' | /home/agrare/src/foreman/app/services/fog_extensions/vsphere/mini_servers.rb:21:in `all'


Related issues

Related to Foreman - Feature #22258: VMWare: Speed up VM listingClosed2018-01-12

Associated revisions

Revision 68e96c10 (diff)
Added by Adam Grare 5 months ago

Fixes #22798 - VMware: Fix exception listing VMs

If a VM is in the root of the datacenter its parent is the vmFolder.
This folder was being skipped by the PropertyFilterSpec causing an
undefined method error '[]' for nil:NilClass when accessing the
vm['parent'] key.

History

#1 Updated by The Foreman Bot 5 months ago

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

#2 Updated by Ohad Levy 5 months ago

  • Category set to Compute resources - VMware

#3 Updated by Ohad Levy 5 months ago

  • Legacy Backlogs Release (now unused) set to 330

#4 Updated by Ohad Levy 5 months ago

#5 Updated by Adam Grare 5 months ago

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

Also available in: Atom PDF