Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vSphere Datacenter not found #112

Open
danhiris opened this issue May 8, 2017 · 1 comment
Open

vSphere Datacenter not found #112

danhiris opened this issue May 8, 2017 · 1 comment

Comments

@danhiris
Copy link

danhiris commented May 8, 2017

I'm trying to converge but I keep getting a datacenter not found error. The datacenter is in a folder.
I have a datacenter on a lab cluster that isn't in a specific folder, and everything works great.

Am I declaring the datacenter name correctly? Is this a bug that prevents the datacenter name from being set due to the folder structure?

screen shot 2017-05-08 at 4 09 41 pm

datacenter: 'USF Support Centers/1P - Phoenix NPC - QA'

------Exception-------
Class: Kitchen::ActionFailed
Message: 1 actions failed.
Failed to complete #create action: [vSphere Datacenter not found [USF Support Centers/1P - Phoenix NPC - QA]] on default-redhat

Please see .kitchen/logs/kitchen.log for more details
Also try running kitchen diagnose --all for configuration

UPDATE:
I tested this from knife and the datacenter is found. For some reason this is not able to find the datacenter if it's under a folder structure.

I think this code has something to do with it:

rootFolder = vim.serviceInstance.content.rootFolder
dc = rootFolder.childEntity.grep(RbVmomi::VIM::Datacenter).find

When looking up data centers, folders should be traversed, not just doing a find on the rootFolder.

This is how knife vsphere does it:

  def traverse_folders_for_dc(folder, dcname)
    children = folder.children.find_all
    children.each do |child|
      if child.class == RbVmomi::VIM::Datacenter && child.name == dcname
        return child
      elsif child.class == RbVmomi::VIM::Folder
        dc = traverse_folders_for_dc(child, dcname)
        return dc if dc
      end
    end
@jjasghar
Copy link
Contributor

jjasghar commented May 9, 2017

Hi! If you're still interested in getting this looked at, please close and reopen this
issue against the new maintainers at https://github.com/chef-partners/chef-provisioning-vsphere.

We are in the process of reinvigorating this project and look forward to many collaborations
in the future!

Thanks for your time and issue! We have a few updates already, and it would be nice to have everything in one location.

Oh! We also are on the VMware{Code} slack team in #chef if you'd ever like to come by and
say hi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants