Associate VM with generic service catalogue item

Hi everyone,

Recently I’ve been using some generic service catalogue items for provisioning OpenStack instances. However, once provisioned, the VM is not associated with the service request.

ie; the following returns an empty array:

I’m using the $evm.execute('create_provision_request', *args) method to provision from my generic service catalogue item.

I thought I could be able to do this during my openstack_PostProvision method, using the following logic:

  • Get the root provisioning object (prov = $evm.root[‘miq_provision’])
  • Get the root MiqAeServiceService object (service = $evm.root[‘service’]
  • Get the VM associated with the provisioning object (vm = prov.vm)
  • Set the VM to the MiqAeServiceService (?)

Looking at the MiqAeServiceService object, it exposes direct_vms, indirect_vms and vms, however there is no method to update these. The ManageIQ source for the MiqAeServiceService object substantiates this:

So, my question is - does anyone know how to associate VMs created from a generic service catalogue item with the underlying service object?


Hi @jockey10,

There is a method add_to_service on the VM:

The automate method is here:

Awesome, thanks @gmccullough!