Manageiq: MiQ connecting directly to ESXi

Created on 19 Jan 2015  路  13Comments  路  Source: ManageIQ/manageiq

The connection direclty to ESXi works only patialy. It is possible to monitor the VMs but they cannot be managed (suspended, stopped, etc.). VM management works with a small change in https://github.com/ManageIQ/manageiq/blob/master/vmdb/app/models/vm_or_template/vmware_shared.rb1

The direct connection to ESXi works, if the line "connection.hostSystemsByMor.keys.first" in case option "HostAgent" is changed to "self.ems_ref". In this case both cases ' when "VirtualCenter" ' and ' when "HostAgent" ' will have the same code, which is surely wrong, and could brick something else. But at least VM management (starting/stopping virtual machines) in ESXi 5.5 works.

Discussion about that: http://talk.manageiq.org/t/miq-connecting-directly-to-esxi/476

bug providerinfrastructure stale

All 13 comments

Thanks @cankarm. I'll take a look.

@Fryguy,
This link https://github.com/ManageIQ/manageiq/blob/master/vmdb/app/models/vm_or_template/vmware_shared.rb1 is outdated.

Can you advise @cankarm's change for current code base ? I have fine-rc1 and ESXi 6.5 setup for testing.

@miq-bot assign @agrare

Hi, this is 2 years old... the code on which I was referring back then is probably the one below on the link. Search for def provider_object and find the case clauses in it.

https://coveralls.io/builds/3370597/source?filename=app%2Fmodels%2Fmanageiq%2Fproviders%2Fvmware%2Finfra_manager%2Fvm_or_template_shared.rb

However, this was possible, because the API for vCenter and ESXi were so similar, but I'm not sure if this functionality is meant to be supported. Without vCenter your actions are limited to a few actions on each ESXi hosts.

@cankarm , thanks for your pointer. I made following change on fine-rc1 vmware appliance.

[root@localhost infra_manager]# diff -ru vm_or_template_shared.rb.orig vm_or_template_shared.rb
--- vm_or_template_shared.rb.orig       2017-05-17 10:51:13.223952215 -0400
+++ vm_or_template_shared.rb    2017-05-17 10:53:14.238485118 -0400
@@ -23,7 +23,9 @@
       when "VirtualCenter"
         # The ems_ref in the VMDB is from the vCenter perspective
         ems_ref
-      when "HostAgent"
+      # https://github.com/ManageIQ/manageiq/issues/1409#issuecomment-302110651
+      #when "HostAgent"
+      when "self.ems_ref"
         # Since we are going directly to the host, it acts like a VC
         # Thus, there is only a single host in it
         # It has a MOR for itself, which is different from the vCenter MOR
[root@localhost infra_manager]#

I can test the connection to ESXi 5.5 and ESXi 6.5 instances.

Is there other ruby rails steps I need to do before my testing ?

@tjyang at least you need to restart the server. Maybe this would be enough.

@cankarm , following is from latest Fine-1 appliance.

  1. apply one-line patch to vm_or_template_shared.rb.
[root@miqfine1 infra_manager]# ls -l vm_or_template_shared.rb
-rw-r--r--. 1 root root 1182 May 19 09:18 vm_or_template_shared.rb
[root@miqfine1 infra_manager]# pwd
/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/bundler/gems/manageiq-providers-vmware-30e6243bf993/app/models/manageiq/providers/vmware/infra_manager
[root@miqfine1 infra_manager]#

  1. reboot the miqfine1 and add in esxi6501 ESXi host.
  2. Still not able list host_name and datastore be listed for selection.
    image

@tjyang there are some issues with the allowed_* methods when you're using a standalone host that we are looking into /cc @gmcculloug

Having this same conversation on the talk site: http://talk.manageiq.org/t/can-standalone-esxi-os-be-added-as-vmware-provider/2313.

I did a little digging this week and right now I think the root cause is that while ESX has a default data-center that is hidden and not something we would display as part of the resource selection. Unlike vSphere environments where there are visible data-centers. Therefore not have a selected data-center is leading to the other child resources being empty.

Since ManageIQ was initially designed as an Enterprise product there were certain minimal requirements, and I would say connecting to a hypervisor manager, like vSphere, was one of them which is why we see issue like this trying to use ESXi directly.

Is this issue resolved? in new realise of manage IQ or not? If it resolved, please let us know.

This issue has been automatically marked as stale because it has not been updated for at least 6 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions!

@cankarm looks like this issue has been open for some time and is now stale.
If this issue can be closed, can you do so.
Otherwise, if you'd like it to stay open, let me know and I'll remove the stale label.

@miq_bot close_issue

Was this page helpful?
0 / 5 - 0 ratings