Provisioning a new host fails with error "NoMethodError: undefined method `sub' for nil:NilClass" in Red Hat Satellite 6.5

Solution Verified - Updated -

Issue

  • While creating a host using VMware as a compute resource, after selecting Resources as the Resource Pool, the Folder list is coming completely blank.

  • If selecting an alternate Resource Pool, then the host creation fails with an error message as displayed below.

    2019-06-14T10:51:07 [W|app|f020e421] Failed to create a compute vimiXXXXXXX (VMware) instance client.example.com: undefined method `sub' for nil:NilClass
    
    NoMethodError: undefined method `sub' for nil:NilClass
    /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-2.4.0/lib/fog/vsphere/requests/compute/get_folder.rb:34:in `get_raw_vmfolder'
    /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-2.4.0/lib/fog/vsphere/requests/compute/create_vm.rb:29:in `create_vm'
    /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-2.4.0/lib/fog/vsphere/models/compute/server.rb:300:in `save'
    /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:454:in `create_vm'
    /usr/share/foreman/app/models/concerns/orchestration/compute.rb:87:in `setCompute'
    /usr/share/foreman/app/models/concerns/orchestration.rb:222:in `execute'
    

Environment

  • Red Hat Satellite 6.5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content