Bug #25849

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

Added by J. A. almost 4 years ago. Updated over 3 years ago.

Compute resources - VMware
Target version:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:


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?


#1 Updated by Tomer Brisker almost 4 years ago

  • Category set to Compute resources - VMware

#2 Updated by A Ops over 3 years ago

First of all, thanks for a great product!

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

#3 Updated by Chun-Liang Lin over 3 years ago

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

#4 Updated by Martin Reemala over 3 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.

#5 Updated by Ondřej Ezr over 3 years ago

  • Bugzilla link set to 1717248

#6 Updated by Chris Roberts over 3 years ago

  • Pull request added

#7 Updated by Chris Roberts over 3 years ago

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

Also available in: Atom PDF