Bug 1367488 - Failed to create VM from registered template
Summary: Failed to create VM from registered template
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.0.2.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ovirt-4.0.5
: 4.0.5
Assignee: Maor
QA Contact: Carlos Mestre González
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-16 14:17 UTC by Eyal Shenitzky
Modified: 2016-11-24 09:40 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-11-24 09:40:31 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
ylavi: planning_ack+
tnisan: devel_ack+
acanan: testing_ack+


Attachments (Terms of Use)
Engine and VDSM log (1.04 MB, application/x-bzip)
2016-08-16 14:17 UTC, Eyal Shenitzky
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 63490 0 master MERGED core: Validate images existance for unregistered Template. 2020-03-22 10:55:00 UTC
oVirt gerrit 63720 0 ovirt-engine-4.0 MERGED core: Validate images existance for unregistered Template. 2020-03-22 10:54:59 UTC

Description Eyal Shenitzky 2016-08-16 14:17:57 UTC
Created attachment 1191300 [details]
Engine and VDSM log

Description of problem:

Creating a VM from a template that was registered to the environment and has 2 disks (one disk on block-based storage domain and the other on file-based storage domain)
fails with error: 
VDSM host_mixed_2 command failed: Image path does not exist or cannot be accessed/created

Engine log Error:
2016-08-16 15:54:48,193 ERROR [org.ovirt.engine.core.bll.tasks.SPMAsyncTask] (DefaultQuartzScheduler10) [] BaseAsyncTask::logEndTaskFailure: Task 'ea0db169-22
ea-407c-b74c-44ef73c6e115' (Parent Command 'CreateSnapshotFromTemplate', Parameters Type 'org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters') ended 
with failure:
-- Result: 'cleanSuccess'
-- Message: 'VDSGenericException: VDSErrorException: Failed to HSMGetAllTasksStatusesVDS, error = Image path does not exist or cannot be accessed/created, cod
e = 254',
-- Exception: 'VDSGenericException: VDSErrorException: Failed to HSMGetAllTasksStatusesVDS, error = Image path does not exist or cannot be accessed/created, c
ode = 254'

Version-Release number of selected component (if applicable):
vdsm-4.18.11-1.el7ev.x86_64
Engine-4.0.2.6-0.1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1.Create a VM with 2 disks, one [disk-1]file-based and 
the other [disk-2]block-based
2.Create a template from the VM in step 1
3.Detach the storage domain that contains disk-2
4.Delete the template from step 2
5.Attach the storage domain from step 3 back to the environment
6.Import the template from the attached storage domain back to the environment
7.Try to create a VM from the imported template from step 6

Actual results:
VM creation fails.

Expected results:
VM should create successfully.

Additional info:
Engine and VDSM logs are attached

Comment 1 Maor 2016-08-17 16:07:16 UTC
Since the Template's disk was deleted, creating a VM from that Template should not be supported.

The solution for this bug should be in the registration process of the Template.
Every time a Template will be registered to the setup, the engine will validate if all its volumes exists.
In that case we can have one of two outcomes:

a. If one of the disks will not be found, the operation of registering the Template will fail.

b. If one of the disks will not be found, the user will get a notification that some of the disks were not found, and the user will decide whether he wants to continue to import the Template without this disk or not. 
   - Keep in mind that if we support this behavior then we might also support removing of Template's disks in an existing Template, with all its outcomes...

Comment 2 Maor 2016-08-17 16:12:08 UTC
(In reply to Maor from comment #1)
> Since the Template's disk was deleted, creating a VM from that Template
> should not be supported.
> 
> The solution for this bug should be in the registration process of the
> Template.
> Every time a Template will be registered to the setup, the engine will
> validate if all its volumes exists.
> In that case we can have one of two outcomes:
> 
> a. If one of the disks will not be found, the operation of registering the
> Template will fail.
> 
> b. If one of the disks will not be found, the user will get a notification
> that some of the disks were not found, and the user will decide whether he
> wants to continue to import the Template without this disk or not. 
>    - Keep in mind that if we support this behavior then we might also
> support removing of Template's disks in an existing Template, with all its
> outcomes...

Based on the behavior of export storage domain, once a template is missing one of its disks the import of the template fails since the copy operation fails.
Based on that, and to keep the behavior consistent, I would consider to go on option 1, which means that the engine will fail the operation

Comment 3 Allon Mureinik 2016-08-29 12:16:49 UTC
(In reply to Maor from comment #2)
> (In reply to Maor from comment #1)
> > Since the Template's disk was deleted, creating a VM from that Template
> > should not be supported.
> > 
> > The solution for this bug should be in the registration process of the
> > Template.
> > Every time a Template will be registered to the setup, the engine will
> > validate if all its volumes exists.
> > In that case we can have one of two outcomes:
> > 
> > a. If one of the disks will not be found, the operation of registering the
> > Template will fail.
> > 
> > b. If one of the disks will not be found, the user will get a notification
> > that some of the disks were not found, and the user will decide whether he
> > wants to continue to import the Template without this disk or not. 
> >    - Keep in mind that if we support this behavior then we might also
> > support removing of Template's disks in an existing Template, with all its
> > outcomes...
> 
> Based on the behavior of export storage domain, once a template is missing
> one of its disks the import of the template fails since the copy operation
> fails.
> Based on that, and to keep the behavior consistent, I would consider to go
> on option 1, which means that the engine will fail the operation
Agreed.

Comment 4 Carlos Mestre González 2016-10-07 14:55:40 UTC
When trying to register (import) the template: 

Error while executing action: Cannot import Template. Template's image doesn't exist.

Comment 5 Allon Mureinik 2016-11-24 09:40:31 UTC
4.0.5 has been released, closing.


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