Vm Provisioning problem with Template


#1

Hi,

I have tried to Provisioning the VM with Template through API, but it’s showing following response. Can you please some one help me?

{“error”:{“kind”:“internal_server_error”,“message”:"undefined method `^’ for “https://192.168.1.39/api/templates/99000000000009":String",“klass”:"NoMethodError”}}

below are my input,

{
“action”: “add”,
“resource”: {
“template”: “https://192.168.1.39/api/templates/99000000000009”,
“name”: “mewsmartvm”,
“host_id”: 99000000000002,
“storage_id”: 99000000000001,
“location”: “IN”,
“vendor”: “vmware”,
“email”: "pragash@local.com",
“first_name”: “Pragash”,
“last_name”: “M”
}
}

below is my curl command,

curl -u admin:smartvm -H “Accept: application/json” -H “Content-type: application/json” -X POST -d @desk_add_vm.json https://192.168.1.39/api/vms


#2

Hello Guys, can you please help someone for my post?


#3

I think you are trying to use the wrong resource of template.

If simply trying to provision a VM from a template, there are examples here:
https://github.com/ManageIQ/manageiq_docs/blob/master/api_examples/provision_request.adoc


#4

The other place to look for API reference: https://github.com/ManageIQ/manageiq_docs/tree/master/api_reference


#5

Thanks Bascar. Its working fine now.