Better VMWare support for non-clusters setup
- when trying to provision a VM in a vsphere environment that doesn't have clusters, and only hosts, the dropdown for clusters is empty and creating it indicates that "cluster is required for this operation"
- It allows you to select a local data store on a different host than you are creating the VM on.
#2 Updated by Ohad Levy almost 6 years ago
while a hack, this patch can solve the issue in the meantime:
diff --git a/lib/fog/vsphere/requests/compute/list_clusters.rb b/lib/fog/vsphere/requests/compute/list_clusters.rb index 2092213..55980c7 100644 --- a/lib/fog/vsphere/requests/compute/list_clusters.rb +++ b/lib/fog/vsphere/requests/compute/list_clusters.rb @@ -11,7 +11,7 @@ module Fog end def raw_clusters(datacenter) - find_raw_datacenter(datacenter).hostFolder.childEntity.grep(RbVmomi::VIM::ClusterComputeResource) + find_raw_datacenter(datacenter).hostFolder.childEntity.grep(RbVmomi::VIM::ComputeResource) end
#6 Updated by Oliver Weinmann about 5 years ago
this no longer seems to work in Foreman 1.2.
I have a Vsphere 5.0 cluster that works fine but the standalone ESXi 5.1 throws an error:
Failed to save: Failed to destroy a compute esxi51 (VMWare) instance centos.a.space.corp: unexpected path class NilClass, mac value is blank!, Failed to destroy a compute esxi51 (VMWare) instance centos.a.space.corp: unexpected path class NilClass
#13 Updated by Derek Tamsen about 4 years ago
I can also confirm this issue still exists in Foreman 1.5.1. However, the patch only works if their are no organizational folders in vsphere for the cluster group. If a cluster is organized into folder(s) under a datacenter, foreman fails to see any clusters. This seems like an underlying issue with either fog or rbvmomi though.
Working Example with Patch:
vcenterserver -> datacenter chosen in dropdown menu -> cluster(s)
Non working example with patch or without patch:
vcenterserver -> datacenter chosen in dropdown menu -> folder1 -> folder2 -> cluster(s)
#29 Updated by Dominic Cleal over 3 years ago
- Status changed from Closed to New
- Assignee deleted (
- Legacy Backlogs Release (now unused) deleted (
Removing from the 1.8.0 release target, as based on the discussion surrounding #8528, I remain unconvinced that this is supported. The patch in Fog only appears to be part of the solution, a more fundamental problem about MAC address allocations and Foreman's compute orchestration remains.
#37 Updated by Eric Hansen 4 months ago
I started hitting something like this after upgrading from 1.16rc2 to 1.17. The problem was not evident in 1.16rc2. Now, when I try to deploy on a host, I see that the cluster field is populated as "Please select a cluster". The ESXi host is a standalone in the datacenter. When deploying to this datacenter, the deployment now fails with the following, but I had it working in 1.16rc2,
2018-05-18 13:02:54 5312b229 [app] [W] Failed to create a compute dev5vcenter-QA-Databases (VMware) instance eh-katello.qa.catalogic.us: undefined method `resourcePool' for #<RbVmomi::VIM::Folder:0x00007f9db47ec670> | | NoMethodError: undefined method `resourcePool' for #<RbVmomi::VIM::Folder:0x00007f9db47ec670> | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-2.1.0/lib/fog/vsphere/requests/compute/get_resource_pool.rb:16:in `get_raw_resource_pool' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-2.1.0/lib/fog/vsphere/requests/compute/create_vm.rb:25:in `create_vm' | /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere-2.1.0/lib/fog/vsphere/models/compute/server.rb:303:in `save' | /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb:447:in `create_vm' | /usr/share/foreman/app/models/concerns/orchestration/compute.rb:77:in `setCompute' | /usr/share/foreman/app/models/concerns/orchestration.rb:222:in `execute' | /usr/share/foreman/app/models/concerns/orchestration.rb:145:in `block in process' | /usr/share/foreman/app/models/concerns/orchestration.rb:137:in `each' | /usr/share/foreman/app/models/concerns/orchestration.rb:137:in `process' | /usr/share/foreman/app/models/concerns/orchestration.rb:44:in `around_save_orchestration' | /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks'