Hi.
I'm trying to create vm from a snapshot using API. If I just provide the new vm 
name, source snapshot ID and cluster name the new vm is been created 
successfully on the same storage domain. But if I additionally provide 
diskattachments to create it on another storage I get error: "Cannot add VM. 
One or more provided storage domains are either not in active status or of an 
illegal type for the requested operation". I can't find the reason why I can't 
create vm on another storage via API while I can do the same via web-portal.

My oVirt Engine version is 4.1.1.8-1.el7.centos.

Here is my code:
curl.exe -k -u "user@domain.suffix:*************" -H "Content-Type: 
application/xml" -H
 "Accept: application/xml" -X POST https://192.168.0.1/ovirt-engine/api/vms -d 
"<vm><name>vm-Test1</name><snapshots><snapshot 
id=\"4b73c79b-efed-4362-8843-91f5cc2d9775\"/></snapshots><cluster><name>MyCluster</name></cluster><disk_attachments><disk_attachment><disk><image_id>6525c157-4e73-440b-adc8-596f1d03ef3c</image_id><storage_domains><storage_domain
 
id=\"52a003d7-cec1-473e-b521-1a551f55abd1\"/></storage_domains></disk></disk_attachment></disk_attachments></vm>"

The answer is:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <detail>[Cannot add VM. One or more provided storage domains are either not 
in active status or of an illegal type for the requested operation.]</detail>
    <reason>Operation Failed</reason>
</fault>
_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/U2QCJ7XJONJRM3XKIDIPGKGFYO3GAE7L/

Reply via email to