Red Hat Bugzilla – Bug 1215533
[Docs][Tech] API docs should cover: How to add a disk to VM from a different storage domain
Last modified: 2015-09-10 03:10:49 EDT
This was brought to my attention by Juan Hernandez as a question he is frequently asked. Most likely this requires a new topic.
The question that I frequently get is how to add to a VM a disk that will reside in a storage domain different to the one where the other disks or the VM reside. To do so the caller has to provide the identifier (or name) or that storage domain. For example: #!/bin/sh -ex url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="..." vm_id="1423ee7b-cbe1-4bcf-8594-1a16f1f19da7" sd_id="929162d4-5a96-48c2-a9b3-dd606172b963" curl \ --insecure \ --user "${user}:${password}" \ --request POST \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data " <disk> <alias>mydisk</alias> <size>10737418240</size> <interface>virtio</interface> <format>cow</format> <storage_domains> <storage_domain id=\"${sd_id}\"/> </storage_domains> </disk> " \ "${url}/vms/${vm_id}/disks" The important part in this example is the "storage_domains" element used to specify explicitly in what storage domain the disk should be created.
Assigning juwu as the QA contact.