Bug 1362464

Summary: REST-API v4 is ignoring disk attributes requested when thin cloning a vm from a template
Product: [oVirt] ovirt-engine Reporter: Carlos Mestre González <cmestreg>
Component: BLL.StorageAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Carlos Mestre González <cmestreg>
Severity: high Docs Contact:
Priority: high    
Version: 4.0.2CC: amureini, bugs, cmestreg, frolland, gklein, tnisan, ylavi
Target Milestone: ovirt-4.0.6Flags: tnisan: ovirt-4.0.z?
amureini: exception?
rule-engine: planning_ack?
tnisan: devel_ack+
rule-engine: testing_ack+
Target Release: 4.0.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-18 07:28:31 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 Carlos Mestre González 2016-08-02 09:18:03 UTC
Description of problem:
When trying to create a vm from a template with QCOW disks (created from a vm with raw and cow disks) without clone (thin), the operation succeeds, creating the disks but not matching the disk format set in the request.

In the Web UI the operation is blocked since you can only set the disks to RAW once you select clone, but in REST it allows the operation and creates the disks.


Version-Release number of selected component (if applicable):
rhevm-4.0.2-0.1.rc.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a vm with a cow sparse and raw no sparse disk
2. Create a template from the VM with COW format (QCOW) disks
3. Create a vm from the previous template with the REST API without clone selecting the disks as RAW:
<vm>
      <name>template_manual_rest_raw_no_clone2</name>
      <cluster><name>golden_env_mixed_1</name></cluster>

        <disk_attachments>
        <disk_attachment>
            <interface>virtio</interface>
            <disk id="22d677b6-302a-4b94-8b49-e44932861510">
                <format>raw</format>
          </disk>
     </disk_attachment>
             <disk_attachment>
            <interface>virtio</interface>
            <disk id="0f7e5f74-c1c5-466a-93a7-b1e0ec2eb1f5">
                <format>raw</format>
           </disk>
           </disk_attachment>
    </disk_attachments>
    <template><name>vm_TestCase16408_REST_NFS_28170411</name></template>
</vm>

Actual results:
Operation succeeds, creating a vm with two disks, one RAW and one COW (the requested asked for both being RAW)

In the Web UI this operation is not allowed, only you're able to create the template when you mark it as clone.

Expected results:
Error stating that the request cannot be fulfil.

Additional info:

Comment 1 Yaniv Lavi 2016-09-11 18:55:28 UTC
Is this v3 or v4 API?

Comment 2 Carlos Mestre González 2016-09-12 10:50:14 UTC
V4

Comment 3 Carlos Mestre González 2016-11-22 10:38:13 UTC
Creating the vm shows an error message: 

<fault>
<detail>
[Cannot add VM. Thin provisioned template disks can not be defined as Raw.]
</detail>
<reason>Operation Failed</reason>
</fault>


rhevm-4.0.6-0.1.el7ev.noarch