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

Bug 876139

Summary: [rest-api] moveImage (import vm from template) is always used with 'force' = 'true'
Product: Red Hat Enterprise Virtualization Manager Reporter: Haim <hateya>
Component: ovirt-engineAssignee: Maor <mlipchuk>
Status: CLOSED CURRENTRELEASE QA Contact: Attila Darazs <adarazs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: abaron, amureini, dyasny, ecohen, ewarszaw, hateya, iheim, jlibosva, lpeer, mgoldboi, mpastern, Rhev-m-bugs, sgrinber, yeylon, ykaul
Target Milestone: ---   
Target Release: 3.1.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: storage
Fixed In Version: si24.2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Attachments:
Description Flags
all logs. none

Description Haim 2012-11-13 12:46:19 UTC
Description of problem:

it appears that when using import vm from template in rest-API it always pass the 'force' = 'true' field which kindly asks vdsm to remove all pre-existing volumes, problem starts when in our tests we just ask to import a VM from template, but the image doesn't exists, vdsm is failing (due to different bug).

expected results:

force value should be passed by request and not by default.

<test_case>
   <test_name>Import vm</test_name>
   <test_action>importVm</test_action>
   <parameters>vm='vm_test', import_storagedomain='master_sd', export_storagedomain='{export_domain_name}', cluster='storage_sanity_31_cluster'</parameters>
   <positive>true</positive>
   <run>yes</run>
   <report>yes</report>
   <bz>853045</bz>
</test_case>

Comment 1 Haim 2012-11-13 12:47:49 UTC
Created attachment 644091 [details]
all logs.

Comment 2 Jakub Libosvar 2012-11-13 12:51:08 UTC
Body and url used:
/api/storagedomains/df1cdb8f-9774-4d32-8335-5e6cb09cea02/vms/6cb08ca5-f30f-4a2f-8cc1-e8581776523d/import

body:
<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <storage_domain>
        <name>iscsiStorageTest_data_domain0</name>
    </storage_domain>
    <cluster>
        <name>iscsiStorageTest</name>
    </cluster>
</action>

Comment 3 Michael Pasternak 2012-11-13 13:27:09 UTC
(In reply to comment #0)
> Description of problem:
> 
> it appears that when using import vm from template in rest-API it always
> pass the 'force' = 'true' field which kindly asks vdsm to remove all
> pre-existing volumes, problem starts when in our tests we just ask to import
> a VM from template, but the image doesn't exists, vdsm is failing (due to
> different bug).
> 
> expected results:
> 
> force value should be passed by request and not by default.
> 
> <test_case>
>    <test_name>Import vm</test_name>
>    <test_action>importVm</test_action>
>    <parameters>vm='vm_test', import_storagedomain='master_sd',
> export_storagedomain='{export_domain_name}',
> cluster='storage_sanity_31_cluster'</parameters>
>    <positive>true</positive>
>    <run>yes</run>
>    <report>yes</report>
>    <bz>853045</bz>
> </test_case>

not sure i understand, what do you mean by "import vm from template" ?
we :

1. import vms from SD
2. create/clone vm from template

Comment 4 Michael Pasternak 2012-11-13 13:50:21 UTC
(In reply to comment #0)
> Description of problem:
> 
> it appears that when using import vm from template in rest-API it always
> pass the 'force' = 'true' field which kindly asks vdsm to remove all
> pre-existing volumes, problem starts when in our tests we just ask to import
> a VM from template, but the image doesn't exists, vdsm is failing (due to
> different bug).
> 

backend forcibly set '.setForceOverride(true);' in ImportVmCommand:559

Comment 7 Allon Mureinik 2012-11-13 15:50:43 UTC
Engine should set the force property from the import params onwards.
Default in REST API should be false if it is not set.

Comment 8 Maor 2012-11-13 16:16:24 UTC
Pushed suggestion fix to upstream at http://gerrit.ovirt.org/#/c/9224/

Comment 9 Maor 2012-11-13 18:02:01 UTC
Merged upstream with change id Ie3a8de587e9a9384a2cf51dc7435967d46d3d9fd

Comment 12 Jakub Libosvar 2012-11-16 09:14:10 UTC
Verified rhevm-3.1.0-30.el6ev.noarch