Error: Source Template/Vm with id [2] has no EMS, unable to provision

Hello,

When I submit a request through our service catalog to provision a VM, it fails with:

Error: Source Template/Vm with id [2] has no EMS, unable to provision

I found here where this error is raised. It looks like ext_management_system = nil. Does that mean there’s some issue integrating with my provider?

I found the error in the evm.log file, but it’s not very enlightening, at least not to me:

Any pointers? THANKS!

It looks like you’ve possibly picked a template that’s been archived (deleted from the underlying EMS, but the template object still exists in MIQ as a historical record). Check the template’s icon in the MIQ WebUI, if it’s archived the top-right tile quadrant will look like a box with a lid, i.e.

archived_template

Hope this helps
pemcg

Hello @pemcg,

I am returning to this issue with templates and am puzzled after several hours of digging around the docs and trying some log statements.

In the drop down where I select the template, I can see where the service dialog is executing a method which queries vmdb for the first provider, and then loops through the miq_templates on provider object, and then returns the friendly names of those templates to be presented in the dialog. However, I can’t figure out where one views or edits those templates. They’re in the database, but how does one manage them? It’s not something coming from my cloud vendor (Azure) is it?

In the Compute–>Clounds–>Instances–>Images portion of the UI I can see available images which bear the very same names as the miq_template friendly names returned by my script query, but not all of these images show up in the results of that template query.

Lastly, when you suggest I check my template’s icon… I’m only familiar with instances having those icons, not templates. Where do I find template icons?? Or are they somehow synonymous with instance icons?? That doesn’t seem right.

What am I missing here?

Thank you very much!

Hi

Yes, images/templates are defined/created/managed at the provider, and ManageIQ just sees them as part of an inventory refresh.

In Compute -> Clouds -> Instances you should see “Images by Provider” and “Images” in the accordion section. If you expand “Images”, you can use the filters under All Images -> Global Filters to see any that might be archived or retired. To see the tile icons you may need to switch to “Tile View” in the upper right hand side of the WebUI.

Hope this helps,
pemcg

Strange to say, @pemcg, none of the images I’m trying to provision are archived:


Only the CentOS image is archived, but the ones giving the “has no EMS” error are not archived. (RHEL* and Windows).

Does it make any sense that I only get this error when using a custom Service Dialog, but do not when I use the provisioning dialog?

Also, why would one environment (prod) show images available and my other environment (dev) show none, when they are configured to work with the very same resource group in Azure? To test this I added a VM (via provisioning dialog in production instance of MIQ) to my resource group in Azure. Then from my new dev instance of MIQ (configured to work with the very same resource group), I did a provider refresh, and can see the new vm sitting there. And yet no images are displayed in the dev environment?

@pemcg
SOLVED

  1. The reason why the service catalog was selecting an invalid template is because when we created the service catalog item, and we had to fill out the “Request Info”, we selected an image that was later archived. For some reason this selection does NOT get overwritten when a user makes a request. The original value from when the catalog item was created persists and goes through as the selected image.
  2. If anyone else reads this, the available images are set in settings–> server–> Advanced under market_image_urns Mine currently reads:
  :azure:
    :get_market_images: true
    :get_private_images: true
    :market_image_urns:
    - RedHat:RHEL:7-LVM:latest
    - MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest
    - RedHat:RHEL:7.3:7.3.2017051117