Bug 1309788

Summary: Export VM that was cloned from template as thin copy and with discard snapshot = false should be blocked
Product: [oVirt] ovirt-engine Reporter: Raz Tamir <ratamir>
Component: BLL.StorageAssignee: Allon Mureinik <amureini>
Status: CLOSED WONTFIX QA Contact: Aharon Canan <acanan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.6.3.1CC: amureini, bugs, gklein, ratamir
Target Milestone: ---Keywords: Automation
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: Storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-28 15:29:07 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:
Attachments:
Description Flags
engine and vdsm logs none

Description Raz Tamir 2016-02-18 17:17:20 UTC
Created attachment 1128288 [details]
engine and vdsm logs

Description of problem:
When exporting a vm that was originally cloned as thin copy from template and discard snapshot attribute is set to 'false' should not be allowed because it is impossible to import that template back to the environment:
"Cannot import and collapse VM, Template is missing in domain export_domain".




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


How reproducible:
100%

Steps to Reproduce:
1. Create vm from template as thin copy
2. Export the vm from REST using [1] in 'Additional info' (do not remove the source vm)
3. Try to import the vm

Actual results:


Expected results:


Additional info:

[1]
<action>
    <async>false</async>
    <grace_period>
        <expiry>10</expiry>
    </grace_period>
    <storage_domain>
        <name>export_domain</name>
    </storage_domain>
    <discard_snapshots>false</discard_snapshots>
    <exclusive>false</exclusive>
</action>

Comment 1 Allon Mureinik 2016-02-21 11:38:00 UTC
(In reply to ratamir from comment #0)
> Description of problem:
> When exporting a vm that was originally cloned as thin copy from template
> and discard snapshot attribute is set to 'false' should not be allowed
> because it is impossible to import that template back to the environment:
> "Cannot import and collapse VM, Template is missing in domain export_domain".
Have you attempted to import without collapsing?

Comment 2 Raz Tamir 2016-02-21 12:09:35 UTC
Yes and see the same behavior

Comment 3 Allon Mureinik 2016-02-21 12:11:26 UTC
(In reply to ratamir from comment #2)
> Yes and see the same behavior
Logs please?

Comment 4 Raz Tamir 2016-02-21 13:08:53 UTC
Allon,
Sorry but I thought I was able to do this.
It is impossible to import without collapse snapshot only if I'm removing the source vm before the import

Comment 5 Raz Tamir 2016-03-28 16:44:40 UTC
Hi Allon,
Is there any good reason why not fixing this bug?
In case I'm creating a vm from template and thin copy and export it, I can't import it again.

Comment 6 Allon Mureinik 2016-03-30 07:51:30 UTC
(In reply to ratamir from comment #5)
> Hi Allon,
> Is there any good reason why not fixing this bug?
> In case I'm creating a vm from template and thin copy and export it, I can't
> import it again.

Sure you can - just export and import the template too.

Comment 7 Aharon Canan 2016-03-31 10:36:06 UTC
Or (options from my POV)
1. we can block the option to export thin copy unless the template is already imported
2. give warning message that in order to import the vm we need to export the template and import it first as well.

question- 
what happens in case I want to import to the same domain which already has the template? do I need to export import as well?

Comment 8 Allon Mureinik 2016-03-31 12:21:14 UTC
(In reply to Aharon Canan from comment #7)
> Or (options from my POV)
> 1. we can block the option to export thin copy unless the template is
> already imported
Doesn't make any sense.

> 2. give warning message that in order to import the vm we need to export the
> template and import it first as well.
We don't nanny the user.

> 
> question- 
> what happens in case I want to import to the same domain which already has
> the template? do I need to export import as well?
Don't understand the question - please clarify.