Vm gets provisioned twice issue

automate

#1

hi there, so I’m facing this problem where I created a service catalog to provision a vm with the choice to chose ram and cpu and It’s working properly. Then I have created a service catalog to install apache and another one to set up a static ip address and hostname. I have joined these service catalogs in a bundle. It works but it shows error and I’m guessing it’s because the vm gets provisioned twice because these errors shows up on CloudForms:

VM Provision Error: [EVM] VM [testvm] Step [CheckProvisioned] Status [Error Creating VM] Message [[OvirtSDK4::Error]: Fault reason is "Operation Failed". Fault detail is "[Cannot add VM. Related operation is currently in progress. Please try again later.]". HTTP response code is 409.]

[EVM] VM [testvm] Step [CheckProvisioned] Status [Error Creating VM] Message [[OvirtSDK4::Error]: Fault reason is "Operation Failed". Fault detail is "[Cannot add VM. The VM name is already in use, please choose a unique name and try again.]". HTTP res...

I have set up my service catalog to create vm as shown in the picture above: 43%20AM

and the service bundle like this : 21%20AM.

How can I avoid this problem?


#2

@pemcg any help with this issue, my final year project is stuck on this error, I’d really appreciate it if you’d help me figure out this problem. Thank you in advance.


#3

HI, can you provide your version and share Automation code? Looks like you have override for Catalogiteminitialization instance?


#4

Thank you for your reply, I really appreciate it. I am using Cloudforms 4.6. I haven’t really changed anything, I used the default code for Catalogiteminitialization.

My provision entry point for the bundle is /Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogBundleInitialization and for the service catalog that is provisioning my vms is /ACME/Service/Provisioning/StateMachines/ServiceProvision_Template/CatalogItemInitialization

I have both CatalogBundleInitialization and CatalogItemInitialization under /ACME/Service/Provosioning/StateMachines/ServiceProvision_Template and they are an exact copy from Manageiq. I haven’t made any changes in the Automation Code.


#5

I see you have also copy of update_provision_status method. Is it also does not have any changes?

Did you use some vm naming workflow? When you create service template for your catalog item what value you set to vm name field?

Vm provision workflow have logic depended from value of this field. If you set some value it is used to set name for vms. And uniqunes of names is provider depended. Looks like you should set the value to “changeme” and cfme automation code will create some unique name for you.
https://pemcg.gitbooks.io/mastering-automation-in-cloudforms-4-2-and-manage/content/vm_naming_during_provisioning/chapter.html


#6

Yes update_provision_status method does not have any changes.

Vm Name is set as follows in my dialog, 18%20PM20%20PM

and The create New VMs service catalog is a Red Hat Virtualization catalog with the following setting for VM Name:

and the Bundle is set as shown bellow:
02%20PM

I did not create a vm naming method, It seems to change the D99MASTER00n for the number of vms.
But if I changed the vm name to “changeme” isn’t the vm is going to be provisioned twice? I need the VM to be provisioned oncee or depending on the number of the VMs set in the dialog with option_0_number_of_vms. But I get this error even though I chose to provision only one VM.


#7

How did you deploy your appliance? Docker image?


#8

I haven’t used docker, I deployed the appliance on a virtual machine on Red Hat Virtualization Manager.


#9

I think if you want override vm_name by dialog option you should set this to “changeme” in service template. In other case the value you set in service template is used. Can you check this?


#10

Thank you for your suggestion, I have changed the vm name to changeme on the service template and the error is not showing anymore but now the vm does not get powered on automatically like it used to even though the Power on virtual machines after creation is checked in the service template and that effects Ansible Tower running jobs on it, do you have any advice on how to fix this?


#11

The problem was that i had too manny vms running and I had no memory left to run the vm but now it works just fine. Thank you so much for your help.