You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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
The text was updated successfully, but these errors were encountered:
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?
datacenter: 'USF Support Centers/1P - Phoenix NPC - QA'
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:
The text was updated successfully, but these errors were encountered: