Bug 1177940 - [REST-API] Fail to Clone VM from Template to another SD, on disk profile mismatch.
Summary: [REST-API] Fail to Clone VM from Template to another SD, on disk profile mism...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 3.5.0
Assignee: Gilad Chaplik
QA Contact: Ilanit Stein
URL:
Whiteboard: sla
Depends On:
Blocks: rhev35rcblocker rhev35gablocker
TreeView+ depends on / blocked
 
Reported: 2014-12-31 13:45 UTC by Ilanit Stein
Modified: 2016-02-10 20:16 UTC (History)
13 users (show)

Fixed In Version: org.ovirt.engine-root-3.5.0-30
Doc Type: Bug Fix
Doc Text:
Previously, when cloning disks, disk profiles are retrieved from templates instead of the destination Storage Domain. If a different storage domain then the source was selected, virtual machine creation from the template would fail. With this update, if users do not specify a disk profile when cloning disks, the disk profile gets reset to an available disk profile from the selected storage domain.
Clone Of:
Environment:
Last Closed: 2015-02-15 09:14:24 UTC
oVirt Team: SLA
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Failing clone vm from template (16.27 KB, text/plain)
2014-12-31 13:52 UTC, Ilanit Stein
no flags Details
Logs from Automatic test, that also runs clone vm from template to another storage domain (3.92 MB, application/x-bzip)
2014-12-31 14:00 UTC, Ilanit Stein
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0230 0 normal SHIPPED_LIVE Red Hat Enterprise Virtualization Manager 3.5.0-1 ASYNC 2015-02-16 19:50:27 UTC
oVirt gerrit 36591 0 master MERGED restapi: wrong disk_profile when cloning to another SD Never
oVirt gerrit 36695 0 ovirt-engine-3.5 MERGED restapi: wrong disk_profile when cloning to another SD Never

Description Ilanit Stein 2014-12-31 13:45:37 UTC
Description of problem:
When trying to clone VM from template, to a storage domain, that has disk profile, which is different than the template disk's disk profile,
It fails on can do action (engine.log):

"CanDoAction of action AddVmFromTemplate failed. Reasons:VAR__ACTION__ADD,VAR__TYPE__VM,ACTION_TYPE_DISK_PROFILE_NOT_MATCH_STORAGE_DOMAIN"

"Operation Failed: [Cannot add VM. Disk Profile doesn't match provided Storage Domain.]"

Only for storage domain, that has the same cpu profile, and the template disk's disk profile, the clone VM from template succeeds (VM created)

Version-Release number of selected component (if applicable):
vt13.5

How reproducible:
100%

Steps to Reproduce:
1. Have a template with disk that is connected to several storage domains in th edata center (more than 1)

2. In the Disks tab, you can see that for template disk, in the general tab, at the bottom, it is displaying a certain disk profile.

3. Via REST clone VM from template like in the attached txt file cloneVmFromTemplateRestRequest.txt. The storage domain set in the CREATE VM request is different from the template disk's disk profile.
=> This action should fail on 

Expected results:
The clone VM from template should succeed to another storage domain as well.

Additional info:
From UI clone VM from template works OK. it is possible to choose the storage target, and adpatively the corresponding disk profile is chosen. VM is create dsuccessfuly.

Comment: 
It is marked as regression because before (rhevm 3.4) it was possible to clone vm from template to another storage domain.

Comment 1 Ilanit Stein 2014-12-31 13:52:32 UTC
Created attachment 974811 [details]
Failing clone vm from template

Failing clone vm from template

Comment 2 Ilanit Stein 2014-12-31 14:00:39 UTC
Created attachment 974812 [details]
Logs from Automatic test, that also runs clone vm from template to another storage domain

See in engine.log, 
2014-12-31 08:44:57,623 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (ajp-/127.0.0.1:8702-18) Operation Failed: [Cannot add VM. Disk Profile doesn't match provided Storage Domain.]

Comment 3 Gilad Chaplik 2015-01-01 08:42:33 UTC
similar to bug 1172207.

Comment 5 Ilanit Stein 2015-01-27 08:57:45 UTC
Verified on vt13.8.

By running this rest POST request with url: 
https://<engine fqdn>:443/ovirt-engine/api/vms

body:

<vm>
    <name>virt-vm-1</name>
    <cluster>
       <name>golden_env_mixed_1</name>
    </cluster>
    <template>
       <name>golden_mixed_virtio_template</name>
    </template>
    <disks>
        <clone>true</clone>
    </disks>
</vm>

Comment 7 Eyal Edri 2015-02-15 09:14:24 UTC
bugs were moved by ERRATA to RELEASE PENDING bug not closed probably due to errata error.
closing as 3.5.0 is released.


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