When call REST to create a service from the service catalog which create one or more vmware vms.
In the json payload we name the service - let’s say - “www” .
data_json = {
“action”:“order”,
“resource”:{
“href”:manageiq_url + “/api/service_catalogs/”+ service_catalogs_id +"/service_templates/"+ cf_template,
“service_name”: ‘www’,
[ … ]
Then we call the API:
url = manageiq_url+’/api/service_catalogs/’+ service_catalogs_id +’/service_templates’
The result is that each call create a new service www, with the requested vms inside, so we have lots of “www” services with one or 2 VMs inside.
The purpose was to add VMs in the existing service www (and if it does not exist, create it) , not to create new ones.
What should we do instead?