Can standalone ESXi OS be added as VMWare provider?


#1

My testing so far is yes. Just want to share my joyful finding :wink:
This will open the door for people running bunch of free ESXi (without vcenter).


Basic ManageIQ Configuration and Setup Question
#2

Also see discussion here:


#3

Thanks for this pointer on same subject. I am able to query and do smart-analysis on the esxi host.

I am not able to provision a VM since the VM template I added on ESXi 5.5 OS doesn’t show up as one of listed templates in MIQ GUI.


#4

As I recall VM templates on VMware are registered to vCenter and not the ESX Host. @rpo or @agrare would know better.


#5

@gmccullough, I confirm your statement by adding esxi machine into vc and turn a VM into template. Later I disconnected it and login directly from vsphere windows client. The template is not visible.

So the fix should be changing the MIQ sever side to code allow provision a VM from cloning a VM on ESXi OS, not just pick from list of templates.

Let me know if you need me to open a RFE issue.


#6

You can perform this action for VMware VMs by clicking into a VM and then selecting Lifecycle -> Clone this VM.


#7

I did try your approach but it ended up with error citing resource not found. I will built a test ESXi OS vm to try again.


#8

Here is my test result of trying to provision a VM on ESXi host by cloning.
I can’t see the available default DataStore so I picked auto option.

VM Provision Error: [EVM] VM [test01] Step [CheckProvisioned] Status 
[[MiqException::MiqProvisionError]: Destination placement_ds_name not provided] Message 
[[MiqException::MiqProvisionError]: Destination placement_ds_name not provided]

#9

The auto-placement option is limited to the same set of data-stores that the UI would display. Sounds like you need to figure out why no data-stores are visible to provisioning.

The first thing that comes to mind is to make sure the storages are not marked as read-only.


#10

Hi @gmccullough, I looked at your screenshot again and found you are using vcenter example in the picture.

Are you sure for ESXi standalone instance one can clone a existing VM ? I tried but I still can’t see the avaiable folder, data store to choose from.


#11

@tjyang Working on getting direct access to an ESX box, right now my permissions in our lab env do not allow for it. Hopefully will be able to test this out next week.


#12

Thanks @gmccullough for helping to fix this issue.

There is a issue already raised here https://github.com/ManageIQ/manageiq/issues/1409

I have fine-rc1 and nested ESXi 6.5 testing environment but I don’t have ability to debug the *.rb code and fix the issue yet. I would love to learn and know about miq from miq developer perspective.


#13

@tjyang Finally got enough time to focus on this issue and found that the single host was not visible because we are expecting it to be available under a cluster.

I created this small patch which allows provisioning to show the host and storages attached to the ESXi host being used and the provider. A final fix would look different then this but wanted to send you something simple to test with.

Please give it a try and let me know if it works for you.

diff --git a/app/models/miq_request_workflow.rb b/app/models/miq_request_workflow.rb
index 9110a93827..b47fedbf9b 100644
--- a/app/models/miq_request_workflow.rb
+++ b/app/models/miq_request_workflow.rb
@@ -927,6 +927,9 @@ class MiqRequestWorkflow
       st = Time.zone.now
       result = load_ar_obj(src[:ems]).fulltree_arranged(:except_type => "VmOrTemplate")
       ems_metadata_tree_add_hosts_under_clusters!(result)
+
+      esxi_as_ems_hack(load_ar_obj(src[:ems]), result)
+
       @ems_xml_nodes = {}
       xml = MiqXml.newDoc(:xmlhash)
       convert_to_xml(xml, result)
@@ -935,6 +938,12 @@ class MiqRequestWorkflow
     end
   end
 
+  def esxi_as_ems_hack(ems, result)
+    if ems.hosts.count == 1 && ems.ems_clusters.count == 0
+      result.each { |obj, children| children[ems.hosts.first] = {} }
+    end
+  end
+
   def ems_metadata_tree_add_hosts_under_clusters!(result)
     result.each do |obj, children|
       ems_metadata_tree_add_hosts_under_clusters!(children)

#14

@gmccullough, following is my testing report.

  • patch applied to my test instance.
[root@miqfine1 models]# git diff  miq_request_workflow.rb
diff --git a/app/models/miq_request_workflow.rb b/app/models/miq_request_workflow.rb
index 9110a93..ab6ac07 100644
--- a/app/models/miq_request_workflow.rb
+++ b/app/models/miq_request_workflow.rb
@@ -926,6 +926,9 @@ class MiqRequestWorkflow
       return if src[:ems].nil?
       st = Time.zone.now
       result = load_ar_obj(src[:ems]).fulltree_arranged(:except_type => "VmOrTemplate")
+
+      esxi_as_ems_hack(load_ar_obj(src[:ems]), result)
+
       ems_metadata_tree_add_hosts_under_clusters!(result)
       @ems_xml_nodes = {}
       xml = MiqXml.newDoc(:xmlhash)
@@ -935,6 +938,12 @@ class MiqRequestWorkflow
     end
   end

+  def esxi_as_ems_hack(ems, result)
+    if ems.hosts.count == 1 && ems.ems_clusters.count == 0
+      result.each { |obj, children| children[ems.hosts.first] = {} }
+    end
+  end
+
   def ems_metadata_tree_add_hosts_under_clusters!(result)
     result.each do |obj, children|
       ems_metadata_tree_add_hosts_under_clusters!(children)
[root@miqfine1 models]#

  1. fill the vm creation needed information and hit submit.
    make sure esxi6501.test.lan host and datastore1 got selected
  2. clone job error out with “undefined method `folder_path’ for nil:NilClass]”
Request Details

Request ID 2
Status Error
Request State Finished
Requester Administrator
Request Type VM Clone
Description Clone from [vc6501] to [test]
Last Message [EVM] VM [test] Step [CheckProvisioned] Status [[NoMethodError]: 
undefined method `folder_path] Message [[NoMethodError]: undefined method 
`folder_path' for nil:NilClass]
Created On Mon, 29 May 2017 11:53:09 +0000
Last Update Mon, 29 May 2017 11:54:49 +0000
Completed Mon, 29 May 2017 11:53:47 +0000
Approval State Approved
Approved/Denied by admin (Administrator)
Approved/Denied on Mon, 29 May 2017 11:53:21 +0000
Reason Auto-Approved
Provisioned VMs 1

#15

Hi guys,

What is the status today of provisioning VMs on ESXi added as infrastructure host?

Running Version gaprindashvili-3.20180509122840_10033db

I added an ESXi host but manageiq doesn’t show running VM or datastore.

Thanks,
Daniel


#16

Hi @danleonard

My test miq running on miq master branch works in terms of basic displaying VMs … functions.

gapri-3 should works also.

Please make sure vmware ddk is installed correctly.

[root@miq02 ~]# ldconfig -p | grep vix
        libvixDiskLib.so.6 (libc6,x86-64) => /lib/libvixDiskLib.so.6
        libvixDiskLib.so (libc6,x86-64) => /lib/libvixDiskLib.so
[root@miq02 ~]#

``

#17

You’ll have no customization specifications and templates without vCenter, so I don’t see how you’ll deploy new VMs.


#18

@xian

For me, on MIQ being able to see VMs on ESXi hosts is good enough for me now.