Cloudforms vmware provisioning

Hi all, We have in cloudforms a catalog item to provision vmware machines. It creates the virtual machine but the problem is that always provision it at the same datacenter, cluster and template despite not selecting the default values in our custom dialog.

Note: In rhv virtualization as explained here it’s working:
rhv state machines

Let me explain it a little better:

This is the service catalog:

This is the catalog item:

Always creates the virtual machine on VMW_DC_01 datacenter and VMW_DC_01_CL_LC_Linux_01 cluster.

Do you know why? It looks like the service dialog populates the right info inside the dropdown menus but not passing them to provisioning template?

Is this for wrong names in the dropdowns? Is there any name convention?

Thank you very much,
Albert

Hi again, nobody knows why the vmware virtual machine is being created with the default dialog parameters?
Thanks,
Albert

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