Bug 1215533 - [Docs][Tech] API docs should cover: How to add a disk to VM from a different storage domain
Summary: [Docs][Tech] API docs should cover: How to add a disk to VM from a different ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: Documentation
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.5.0
Assignee: Lucy Bopf
QA Contact: Megan Lewis
URL:
Whiteboard:
Depends On:
Blocks: 1256971
TreeView+ depends on / blocked
 
Reported: 2015-04-27 05:15 UTC by Andrew Burden
Modified: 2015-09-10 07:10 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-09-10 07:10:49 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Andrew Burden 2015-04-27 05:15:59 UTC
This was brought to my attention by Juan Hernandez as a question he is frequently asked. Most likely this requires a new topic.

Comment 3 Juan Hernández 2015-06-09 11:58:55 UTC
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.

Comment 4 Andrew Dahms 2015-06-24 05:10:59 UTC
Assigning juwu as the QA contact.


Note You need to log in before you can comment on or make changes to this bug.