Bug #25849


VMware compute resource cannot find VM folders when datacenters are themselves nested in folders

Added by J. A. over 5 years ago. Updated almost 5 years ago.

Compute resources - VMware
Target version:
Fixed in Releases:
Found in Releases:


Using Foreman 1.20.1 and vCenter 6.7.

Our vCenter has folders at the top level, and the datacenter objects are in those folders.

We are successfully adding our vCenter as a compute resource in Foreman, however, when creating a new host - as well as when configuring compute profiles - the "Folder" drop-down box in the "Virtual Machine" tab is empty (and contains the text "No matches found"), despite there being folders in vCenter. If we move the datacenter objects out of the folders, directly under the top vCenter object, Foreman lists all the folders correctly.

This prevents creating hosts: when submitting the new host for provisioning with "No matches found" in the folder drop-down box, Foreman passes a nil folder path where fog-vsphere expects a string, causing a NoMethodError for String#sub.

I'm not sure whether this used to work or not. Folder listing has worked before for this Foreman-vCenter combination. However, we recently upgraded from Foreman 1.16 to 1.20 (through the intermediates), and vCenter 6.5 to 6.7, but it's unclear whether we actually had datacenters nested in folders prior to the upgrades.

Putting datacenters in folders is apparently a VMware recommendation when setting up vCenter. Maybe it has something to do with more flexible management of permissions?

Actions #1

Updated by Tomer Brisker over 5 years ago

  • Category set to Compute resources - VMware
Actions #2

Updated by A Ops about 5 years ago

First of all, thanks for a great product!

We have exactly the same issue, any fix on its way?

Actions #3

Updated by Chun-Liang Lin almost 5 years ago

We have the same problem in Foreman 1.18.3 and vCenter 6.7.

Actions #4

Updated by Martin Reemala almost 5 years ago


We had the same issue but with different version.
It works fine with 1.20.2 with ESX 6.5 but when we update to 1.21 it doesn't work.

Actions #5

Updated by Ondřej Ezr almost 5 years ago

  • Bugzilla link set to 1717248
Actions #6

Updated by Chris Roberts almost 5 years ago

  • Pull request added
Actions #7

Updated by Chris Roberts almost 5 years ago

  • Status changed from New to Resolved
  • Assignee set to Chris Roberts
  • Target version set to 1.23.0
  • Difficulty set to easy
  • Triaged changed from No to Yes
  • Fixed in Releases 1.23.0 added
  • Found in Releases 1.22.0 added
  • Found in Releases deleted (1.20.1)

Also available in: Atom PDF