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

Bug 906797

Summary: [Admin Portal] Importing a template based VM fails - Cannot import VM. The selected Storage Domain does not contain the VM Template.
Product: Red Hat Enterprise Virtualization Manager Reporter: Jiri Belka <jbelka>
Component: ovirt-engineAssignee: Daniel Erez <derez>
Status: CLOSED DUPLICATE QA Contact: Haim <hateya>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: abaron, acathrow, dyasny, iheim, lpeer, Rhev-m-bugs, scohen, sgrinber, yeylon, ykaul
Target Milestone: ---   
Target Release: 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 09:46:03 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.log, vdsm.log none

Description Jiri Belka 2013-02-01 14:10:00 UTC
Created attachment 691593 [details]
engine.log, vdsm.log

Description of problem:
Importing a template based VM fails:

Error while executing action: Cannot import VM. The selected Storage Domain does not contain the VM Template.

2013-02-01 14:35:54,749 WARN  [org.ovirt.engine.core.bll.ImportVmCommand] (ajp-/127.0.0.1:8702-7) CanDoAction of action ImportVm failed. Reasons:VAR__ACTION__
IMPORT,VAR__TYPE__VM,ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN

'tmpl00' exists on data domain:

$ curl -sk -X GET -u 'admin@internal:xxxxxx' -H 'Accept: application/xml' https://10.34.63.76/api/templates | sed -n '/tmpl00/,/link/p'
        <name>tmpl00</name>
        <description></description>
        <link href="/api/templates/e2ef30b8-8f12-44b4-8135-830eddec2857/disks" rel="disks"/>

'dsktp00' is backed by this template (uuid):

$ curl -sk -X GET -u 'admin@internal:xxxxxx' -H 'Accept: application/xml' https://10.34.63.76/api/storagedomains/131d564c-52d1-4bba-8d60-39e889a8bc08/vms | sed -n '/<name>dsktp00/,/template/p' | egrep "name|template"
        <name>dsktp00</name>
        <template href="/api/templates/e2ef30b8-8f12-44b4-8135-830eddec2857" id="e2ef30b8-8f12-44b4-8135-830eddec2857"/>

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

How reproducible:
100%

Steps to Reproduce:
1. create a vm (no nic, no disk)
2. make a template from this vm
3. make new vm based on this template
4. export both the template and the vm (based on this template)
5. delete both the template and the vm
6. import the template
7. import the vm

Actual results:

Error while executing action: Cannot import VM. The selected Storage Domain does not contain the VM Template.


Expected results:
should work

Additional info:
seems to be related to templates only without nic and disk. I tried with a template which had nic and disk and it worked.

Comment 1 Ayal Baron 2013-02-13 10:53:35 UTC
Hi Jiri, can you reproduce this? from the logs it doesn't appear as though the template was imported.
In addition, the question is not whether the template is in the system, but rather whether the disks reside on the target domain.
Please reproduce and also query: /api/templates/e2ef30b8-8f12-44b4-8135-830eddec2857/disks

Comment 2 Jiri Belka 2013-02-18 08:41:15 UTC
Still same issue on sf7, here I imported previously exported diskless/nicless template00. As it is diskless template, then you say the error is related to disks residing on the target domain? Well, if you presuppose disk-based template then I would say it is wrong.

on_template00:

    Cannot import VM. The selected Storage Domain does not contain the VM Template.

$ curl -sk -X GET -u 'admin@internal:xxxxxx' -H 'Accept: application/xml' https://10.34.63.76/api/templates/1eb0e966-6a32-4c39-b79c-b5c4376aa2c5 | grep '<name>'
    <name>template00</name>

$ curl -sk -X GET -u 'admin@internal:xxxxxx' -H 'Accept: application/xml' https://10.34.63.76/api/templates/1eb0e966-6a32-4c39-b79c-b5c4376aa2c5/disks
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<disks/>

Comment 3 Sean Cohen 2013-02-21 08:28:56 UTC
Does this reproduce in a scenario without nic and with disk?

Comment 4 Jiri Belka 2013-02-21 09:24:55 UTC
No, as it was previously said - this is related to template without disk. So in scenario without nic _and_ with disk this cannot be reproduced. But this can be reproduced in scenarion with nic and _without_ disk.