Prov.eligible_hosts returning wrongs hosts for template


#1

Hey there,

i just want to contact you, because we have an issue with our provisioning. We currently have this issue in Cloudforms, but i also tried it out in MIQ. Same here.

The Problem:
we have 2 Datacenters (Locations) with one vCenter over it. No Storage Domain is used (this means that every location has his Storage LUNs which couldn’t be accessed by the other location).
To provision in these 2 locations we places 2 templates on each.

Now, our placement method goes through, and pulls eligible hosts with the

prov.eligible_hosts.each do |whatever|

But he gets the wrong hosts. These are hosts from the other site, which are not attached to this template

[----] I, [2016-06-08T16:08:43.496896 #32343:3cc3d5c]  INFO -- : Q-task_id([miq_provision_49000000005821]) <AEMethod vmware_best_fit_with_tags> INFO: vm=[CFVM-Template-RHEL6_64v2_location1], space required=[536870912]
[----] I, [2016-06-08T16:08:45.121983 #32343:6ce37e4]  INFO -- : Q-task_id([miq_provision_49000000005821]) <AEMethod vmware_best_fit_with_tags> DEBUG: Inspecting Host <esx55.location2.company.com> with tags <["host_cluster/location1"]>
[----] I, [2016-06-08T16:08:45.125569 #32343:6ce37e4]  INFO -- : Q-task_id([miq_provision_49000000005821]) <AEMethod vmware_best_fit_with_tags> DEBUG: ignored tag: customer = internal -> not nesscessary
[----] I, [2016-06-08T16:08:45.125993 #32343:6ce37e4]  INFO -- : Q-task_id([miq_provision_49000000005821]) <AEMethod vmware_best_fit_with_tags> DEBUG: ignored tag: sdrs_cluster = cluster1 -> not nesscessary
[----] I, [2016-06-08T16:08:45.126414 #32343:6ce37e4]  INFO -- : Q-task_id([miq_provision_49000000005821]) <AEMethod vmware_best_fit_with_tags> DEBUG: searching through tags: host_cluster => location1
[----] I, [2016-06-08T16:08:45.131401 #32343:6ce37e4]  INFO -- : Q-task_id([miq_provision_49000000005821]) <AEMethod vmware_best_fit_with_tags> INFO: Host <esx55.location2.company.com> eligable?: <false>
[----] I, [2016-06-08T16:08:45.138753 #32343:6ce37e4]  INFO -- : Q-task_id([miq_provision_49000000005821]) <AEMethod vmware_best_fit_with_tags> DEBUG: Inspecting Host <esx07.location2.company.com> with tags <["host_cluster/location1"]>

Do you have any idea why this happen ?


#2

The eligible_hosts method, along with all the other eligible_* methods, uses the same method in the backend as the UI to display available field data on the Environment tab of the provisioning dialog. These fields are interrelated so changing one effects the filtering of available objects in the other fields. For example, selection a Cluster will effect the eligible hosts and storages to the resources of that cluster. Or selection storage would filter host and cluster.

In the case of VMware, setting the datacenter, cluster, resource_pool, folder and/or datastore before calling the eligible_hosts method would all cause the results to be filtered.

It is easy to visualize by running the a provision in the UI and selection the Environment tab and trying it out.

Hope this helps.


vCenter Cluster Placement
#3

Thanks, we found the problem which caused this issue… it was a resourcePool…

Thanks