<div dir="ltr">Hi all,<div><br></div><div>I'm exploring using ovirt's REST APIs to manage VM creation/deletion/etc. I can create the VM, attach an ISO and change boot order, but I'm unable to attach a storage disk to the VM. I send a POST request to /api/vms/<vm uuid>/disks with the structure:</div>
<div>{"storage_domain":</div><div> {"name":"am_data",</div><div> "id":"6fbee79d-5b71-48c1-b86c-ee9755a46013"</div><div> },</div><div> "size":"4294967296",</div>
<div> "type":"system", </div><div> "interface":"ide", </div><div> "format":"raw", </div><div> "sparse":"false", </div><div> "bootable":"true", </div>
<div> "wipe_after_delete":"false"</div><div>}<br></div><div>The response I receive is</div><div><div>{</div><div> "reason" : "Operation Failed",</div><div> "detail" : "[Cannot add Virtual Machine Disk. Storage Domain doesn't exist.]"</div>
<div>}</div></div><div>For the storage domain, I've tried just the name, just the id, and both with the same results. When I attach storage from the GUI, the disk is created/attached fine, and a GET request for the disks of the VM shows the storage domain as the same as I was attempting to use before.</div>
<div><div>"storage_domains" : {</div><div> "storage_domain" : [ {</div><div> "id" : "6fbee79d-5b71-48c1-b86c-ee9755a46013"</div><div> } ]</div><div> },</div></div>
<div><br></div><div>Any idea what I might be doing wrong?</div><div><br></div><div>Thanks,</div><div>Andrew</div></div>