If you haven’t already, I would highly recommend to read Peter McGowan’s book, espacially Part 2 as it goes into a lot more detail on how VM provisionings work
I guess the problem is, that you haven’t enabled “Choose Automatically” and it therefore just uses the values from the CatalogItem > RequestInfo configuration.
If you choose automatic placement, ManageIQ seems to try to match a couple of tags on the Catalog Item with tags on the host and select the least utilized host.
I haven’t seed an easy override option to select the cluster from the dialog (though I haven’t seen that in the RHV code repo you have posted either)
Unfortunately we use a completely different placement, so I have no idea how this is supposed to work in a default ManageIQ environment.
In general, if you start from a Catalog Item, you are provisioning 2 things simultaneously. First a Service-Object (this is a ManageIQ internal object, similar to a folder) and a VM.
The Service Provisioning StateMacine starts at /Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogItemInitialization
and once it hits the “Proivision”-step starts the actual VM provisioning StateMachine as a sub-task
If you want to customize placement, take a look at the StateMachine in /Instrastructure/VM/Provisioning/StateMachines/VMProvisioning_VM/template
. This is the StateMachine that manages the actual VM provisioning.
The “Placement”-step calls /Infrastructure/VM/Provisioning/Placement/default#vmware
, which ends up calling vmware_best_fit_least_utilized
You want create a new method that does something similar to this (but more robust):
cluster = $evm.vmdb(:ems_cluster).where(name: $emv.root['dialog_vmware_cluster']).first
host = cluster.hosts.shuffle.first
$evm.root['miq_provision'].set_host(host)
I guess you figure something out using the book and the examples in the ManageIQ and RedHat domains. Just keep in mind, that the Workflow has a lot of moving parts and spend some time understanding what is happening in the background. Ideally you are ok with changing a couple of methods