Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 829672

Summary: [RFE] RESTAPI: vm/template Import candidates should have /disks sub-collection
Product: Red Hat Enterprise Virtualization Manager Reporter: Michael Pasternak <mpastern>
Component: ovirt-engine-restapiAssignee: Ravi Nori <rnori>
Status: CLOSED ERRATA QA Contact: Meital Bourvine <mbourvin>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: abaron, acanan, acathrow, adahms, amureini, bazulay, ecohen, iheim, jkt, nlevinki, Rhev-m-bugs, rnori, yeylon
Target Milestone: ---Keywords: FutureFeature, Improvement
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: is1 Doc Type: Enhancement
Doc Text:
Previously in the REST API, there was no disk sub-collection for virtual machines or templates in an export domain. Due to this, users would not be able to use the REST API to view the disks owned by these objects. With this update, a disk sub-collection has been added to virtual machines and templates in export domains, making it possible for administrators to view the disks that belong to those virtual machines or templates.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 17:11:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Pasternak 2012-06-07 09:11:58 UTC

Comment 1 Itamar Heim 2013-01-06 07:44:37 UTC
Closing old bugs. If this issue is still relevant/important in current version, please re-open the bug.

Comment 2 Michael Pasternak 2013-01-06 08:10:29 UTC
this RFE is must, otherwise the one importing vm/template cannot:

1. figure out required space
2. see/modify disks config

(afaik GUI has such capability)

Comment 3 Ayal Baron 2013-01-06 11:00:51 UTC
Michael please provide additional information about what is needed here.

Comment 4 Michael Pasternak 2013-01-06 11:24:08 UTC
(In reply to comment #3)
> Michael please provide additional information about what is needed here.

when importing vm/template via api only import candidate metadata is visible (disk are not), 

requirement: import candidate should have /disks sub-collection

Comment 5 Ravi Nori 2013-01-16 21:42:48 UTC
link : http://gerrit.ovirt.org/#/c/11126/

change id : I83fd4b046f72f73bb516615137522ac40028a7f0

Comment 6 Meital Bourvine 2013-08-11 10:38:11 UTC
Verified on is9.1

Working for templates:

mbourvin@mbourvin ~/scripts$ curl -X GET -H "Accept: application/xml" -u admin@internal:123456 --cacert /tmp/cert  https://mbourvin-rhevm33.qa.lab.tlv.redhat.com:443/api/storagedomains/c47eab9b-5f06-4134-87b3-6ce024272f44/templates/8205e91f-31b3-4ca2-8daf-f34c6518a6a8/disks
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<disks>
    <disk href="/api/disks/1458f799-dc62-4afb-9d77-b7c3f255d9a8" id="1458f799-dc62-4afb-9d77-b7c3f255d9a8">
        <name>test1_Disk1</name>
        <alias>test1_Disk1</alias>
        <image_id>49e7834a-cd93-4a4c-9fab-208334d1ce1d</image_id>
        <storage_domains>
            <storage_domain id="0b95a82f-5a9d-4303-8b74-0258a7de1853"/>
        </storage_domains>
        <size>21474836480</size>
        <provisioned_size>21474836480</provisioned_size>
        <actual_size>21474836480</actual_size>
        <status>
            <state>ok</state>
        </status>
        <interface>virtio</interface>
        <format>raw</format>
        <sparse>false</sparse>
        <bootable>true</bootable>
        <shareable>false</shareable>
        <wipe_after_delete>false</wipe_after_delete>
        <propagate_errors>false</propagate_errors>
    </disk>
</disks>





Working for VMs:

mbourvin@mbourvin ~/scripts$ curl -X GET -H "Accept: application/xml" -u admin@internal:123456 --cacert /tmp/cert  https://mbourvin-rhevm33.qa.lab.tlv.redhat.com:443/api/storagedomains/c47eab9b-5f06-4134-87b3-6ce024272f44/vms/a2e78159-2738-4db0-97cb-c224e87c536c/disks
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<disks>
    <disk href="/api/disks/fdfc07c4-49e7-47ea-8d81-a704c8becc83" id="fdfc07c4-49e7-47ea-8d81-a704c8becc83">
        <name>test1_Disk1</name>
        <alias>test1_Disk1</alias>
        <image_id>0a3c4e10-ba84-4edd-97d8-4db4480bf8c3</image_id>
        <storage_domains>
            <storage_domain id="0b95a82f-5a9d-4303-8b74-0258a7de1853"/>
        </storage_domains>
        <size>21474836480</size>
        <provisioned_size>21474836480</provisioned_size>
        <actual_size>21474836480</actual_size>
        <status>
            <state>ok</state>
        </status>
        <interface>virtio</interface>
        <format>raw</format>
        <sparse>false</sparse>
        <bootable>true</bootable>
        <shareable>false</shareable>
        <wipe_after_delete>false</wipe_after_delete>
        <propagate_errors>false</propagate_errors>
        <active>true</active>
    </disk>
</disks>


Steps to verify:
1. Create export domain
2. Create VM and Template
3. Export the VM and the template
4. Run:
/api/storagedomains/{storagedomain:id}/templates/{template:id}/disks

/api/storagedomains/{storagedomain:id}/vms/{vm:id}/disks

Comment 7 Charlie 2013-11-28 00:25:14 UTC
This bug is currently attached to errata RHEA-2013:15231. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag.

Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information:

* Cause: What actions or circumstances cause this bug to present.
* Consequence: What happens when the bug presents.
* Fix: What was done to fix the bug.
* Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore')

Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug.

For further details on the Cause, Consequence, Fix, Result format please refer to:

https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes 

Thanks in advance.

Comment 10 errata-xmlrpc 2014-01-21 17:11:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2014-0038.html