Project

General

Profile

Actions

Feature #1945

closed

Better VMWare support for non-clusters setup

Added by Brian Gupta over 11 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Compute resources - VMware
Target version:
-
Difficulty:
medium
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Issues:

- 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.


Related issues 4 (0 open4 closed)

Related to Foreman - Feature #1946: Addition VMWare options required for VM creationResolved11/15/2012Actions
Related to Foreman - Bug #2666: Unable to create new host Rejected06/13/2013Actions
Has duplicate Foreman - Bug #8528: Provisioning on a non-clustered ESXiDuplicate11/27/2014Actions
Blocked by Foreman - Refactor #8357: Update fog version to 1.25.xClosedShlomi Zadok11/12/2014Actions
Actions #1

Updated by Brian Gupta over 11 years ago

  • Target version set to 1.1
Actions #2

Updated by Ohad Levy over 11 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

Actions #3

Updated by Ohad Levy about 11 years ago

  • Target version deleted (1.1)
Actions #4

Updated by Mikael Fridh almost 11 years ago

Ohad Levy wrote:

while a hack, this patch can solve the issue in the meantime:

[...]

Patch works wonders! Thanks Ohad.

Actions #5

Updated by Dominic Cleal almost 11 years ago

  • Target version set to 1.3.0
Actions #6

Updated by Oliver Weinmann over 10 years ago

Hi,

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

Actions #7

Updated by Lukas Zapletal over 10 years ago

  • Target version changed from 1.3.0 to 1.4.0
Actions #8

Updated by Greg Sutcliffe over 10 years ago

  • Target version deleted (1.4.0)
Actions #9

Updated by Anonymous over 10 years ago

According to a discussion on IRC, this is still present at least in 1.3.1.

Actions #10

Updated by Ben Fairless about 10 years ago

I can confirm this issue, and also Ohad's workaround, is still present in 1.4.0

Actions #11

Updated by Benjamin Papillon about 10 years ago

  • Related to Bug #2666: Unable to create new host added
Actions #12

Updated by Marco De Vitis over 9 years ago

I confirm this bug is still present in Foreman 1.5.1, and Ohad's patch works.

Actions #13

Updated by Derek Tamsen over 9 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)

Actions #14

Updated by Dominic Cleal over 9 years ago

  • Bugzilla link set to 1142878
Actions #15

Updated by Dominic Cleal over 9 years ago

  • Category changed from VM management to Compute resources - VMware

Derek, re comment 14, I've logged that cluster-in-a-folder issue as #7518 leaving this ticket specifically for non-cluster setups.

Actions #16

Updated by Alexander Korolev over 9 years ago

Just tested with vSphere 5.5. over vCenter on a single host (former cluster) - works fine without any issues.
Structure is as Follows:
vCenter |- Cluster (no HA/DRS active) |- Single host |- test vm

Actions #17

Updated by Slava Bendersky over 9 years ago

Hello Everyone,
Is there availble work arrounds ? In my case it is blocker I can't deploy any new vms.

My case

Vcenter --- DataCenter01
_ Host01 | |_________ Host02 | |______ DataCenter02

Actions #18

Updated by Slava Bendersky over 9 years ago

My case

Vcenter --- DataCenter01
  |                 |_ Host01
  |                 |__Host02
  |
  |______ DataCenter02
                 |_ Host01
                 |__Host02
and so on
Actions #19

Updated by Shlomi Zadok over 9 years ago

  • Assignee set to Shlomi Zadok
Actions #20

Updated by Shlomi Zadok over 9 years ago

Actions #21

Updated by Slava Bendersky over 9 years ago

I tried today on 1.7RC1 and patch not working any more. Cluster field is empty.

Actions #22

Updated by Slava Bendersky over 9 years ago

ok after reboot patch fog 1.24 and it working.

Actions #23

Updated by Slava Bendersky over 9 years ago

Slava Bendersky wrote:
ok after reboot patch for fog 1.24 working as expected.

Actions #24

Updated by Dominic Cleal over 9 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
  • translation missing: en.field_release set to 29
Actions #25

Updated by Dominic Cleal over 9 years ago

  • Related to Bug #8528: Provisioning on a non-clustered ESXi added
Actions #26

Updated by Dominic Cleal over 9 years ago

  • translation missing: en.field_release changed from 29 to 28
Actions #27

Updated by Dominic Cleal about 9 years ago

  • Related to deleted (Bug #8528: Provisioning on a non-clustered ESXi)
Actions #28

Updated by Dominic Cleal about 9 years ago

  • Blocked by Bug #8528: Provisioning on a non-clustered ESXi added
Actions #29

Updated by Dominic Cleal about 9 years ago

  • Status changed from Closed to New
  • Assignee deleted (Shlomi Zadok)
  • translation missing: en.field_release deleted (28)

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.

Actions #30

Updated by Shlomi Zadok about 9 years ago

So it is a regression? (it is working on 1.7.x)

Actions #31

Updated by Dominic Cleal about 9 years ago

Shlomi Zadok wrote:

So it is a regression? (it is working on 1.7.x)

1.7 doesn't even have the Fog patch. I don't see how this is a regression, it's never functioned.

Actions #32

Updated by Anonymous almost 7 years ago

  • Blocked by deleted (Bug #8528: Provisioning on a non-clustered ESXi)
Actions #33

Updated by Anonymous almost 7 years ago

  • Has duplicate Bug #8528: Provisioning on a non-clustered ESXi added
Actions #34

Updated by Anonymous almost 7 years ago

Before there's no fog update which is bringing this feature, there's no possibility on the Foreman side to fix this.

Actions #35

Updated by Bryan Kearney almost 6 years ago

@michael is there a fog upstream issue we should be tracking for this?

Actions #36

Updated by Chris Roberts almost 6 years ago

  • Assignee set to Chris Roberts
  • Difficulty set to medium
Actions #37

Updated by Eric Hansen almost 6 years 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'

Actions #38

Updated by Eric Hansen almost 6 years ago

FYI, my problem was resolved by adding a cluster to the datacenter and moving the ESX host into it, so that's definitely the problem.

Actions #39

Updated by Chris Roberts over 5 years ago

  • Status changed from New to Resolved
  • Triaged changed from No to Yes
  • Pull request https://github.com/fog/fog-vsphere/pull/149 added
  • Fixed in Releases 1.19.0 added
Actions #40

Updated by Chris Roberts over 5 years ago

Part of the fog-vsphere 2.3.0 gem found in 1.19 marking as resolved.

Actions #41

Updated by Eric Hansen about 5 years ago

Was this ever tested?

Although I now see stand-alone hosts in the UI, trying to provision to them fails. I am on Foreman 1.20.1. The logs show,

2019-01-31T11:27:24 [I|app|cdd3a] Processed 1 tasks from queue 'Host::Managed Main', completed 0/5
2019-01-31T11:27:24 [E|app|cdd3a] Task 'Set up compute instance joey-tafoya.qa.catalogic.us' failed
2019-01-31T11:27:24 [E|app|cdd3a] Task 'Query instance details for joey-tafoya.qa.catalogic.us' canceled
2019-01-31T11:27:24 [E|app|cdd3a] Task 'Create IPv4 DNS record for joey-tafoya.qa.catalogic.us' canceled
2019-01-31T11:27:24 [E|app|cdd3a] Task 'Create Reverse IPv4 DNS record for joey-tafoya.qa.catalogic.us' canceled
2019-01-31T11:27:24 [E|app|cdd3a] Task 'Power up compute instance joey-tafoya.qa.catalogic.us' canceled
2019-01-31T11:27:24 [I|app|4e73a] Rendering text template
2019-01-31T11:27:24 [I|app|4e73a] Rendered text template (0.0ms)
2019-01-31T11:27:24 [I|app|4e73a] Completed 200 OK in 232ms (Views: 0.9ms | ActiveRecord: 43.5ms)
2019-01-31T11:27:24 [E|app|cdd3a] Failed to save: Failed to create a compute eng1vcenter-Apps-DC (VMware) instance joey-tafoya.qa.catalogic.us: CannotAccessVmComponent: A component of the virtual machine is not accessible on the host.

Actions #42

Updated by Chris Roberts about 5 years ago

  • Status changed from Resolved to Need more information

Eric,

Do you have the full traceback from the production.log that I can see? As far as it being tested yes it should have been. I have about 16 tests that I run for regression besides testing the main feature. It was quite a bit ago so I apologize for not having that answer off hand.

Actions #43

Updated by Chris Roberts about 5 years ago

Eric,

It was tested in our downstream product here:

https://bugzilla.redhat.com/show_bug.cgi?id=1596858#c7

Actions #44

Updated by Chris Roberts almost 5 years ago

  • Status changed from Need more information to Closed
Actions #45

Updated by Luca Lesinigo over 3 years ago

sorry to resurrect this, but I recently tried with a fresh install of Foreman 2.1.2 and I cannot provision VMs on standalone VMware hosts (tried with an ESXi 5.5 and an ESXi 6.7 hosts, with different errors).

Documentation clearly says Only VMware clusters using vSphere are supported, not standalone ESX or ESXi servers but then links to this issue which is marked as closed and Fixed in Releases: 1.19.0 and it also contains comments like "marking as resolved". As a user reading documentation and this issue, the whole thing sounds a little confusing to me.

As far as I can understand, it still stands that standalone hosts are not supported and getting errors like I did is to be expected, even if this issue and some linked ones (also on RH Satellite) sounds like resolved. Can someone please clarify if this is correct?

Actions

Also available in: Atom PDF