Bug 1098951

Summary: Possible to create template from vm without disk via REST on cluster without hosts and storage domains
Product: Red Hat Enterprise Virtualization Manager Reporter: Artyom <alukiano>
Component: ovirt-engineAssignee: Martin Betak <mbetak>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kubica <pkubica>
Severity: high Docs Contact:
Priority: medium    
Version: 3.4.0CC: bazulay, gklein, lsurette, mavital, michal.skrivanek, oramraz, pstehlik, rbalakri, Rhev-m-bugs, srevivo, ykaul
Target Milestone: ovirt-3.6.0-rc   
Target Release: 3.6.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-engine-3.5.0_beta Doc Type: Bug Fix
Doc Text:
Cause: When creating a template from VM, the check whether target cluster lies on same datacenter was only performed for VMs with attached disks. Consequence: It was possible to get to state where neither deletion of the incorrectly created template nor the deletion of target cluster with such template was possible. Fix: The check is now performed for all VMs (even those without disks) Result: It is no more possible to achieve such errorneous state.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-20 01:34:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Artyom 2014-05-19 08:32:21 UTC
Description of problem:
It possible to create template from vm without disk via REST on cluster without hosts and storage domains, so now you have interesting situation that you can't remove template without hosts and can't remove cluster with template.
Problem appear via REST, because via UI it just don't show other data center clusters via create template menu.

Version-Release number of selected component (if applicable):
rhevm-3.4.0-0.18.el6ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Have two datacenters, one(dc_1) with host and storagedomain and also with vm without disk, second(dc_2) just with cluster.
2. Create template from vm on dc_1 via REST and give cluster from dc_2:
<template>
    <name>cluster_template</name>
    <vm id="vm_id_from_dc_1"/>
    <cluster id="cluster_id_from_dc2"/>
</template>
3.

Actual results:
Template create successfully. 

Expected results:
Some error message, that say that you chose not correct cluster id(exactly as when you create template from vm with disk)

Additional info:

Comment 1 Allon Mureinik 2014-05-19 10:03:09 UTC
> Create template from vm on dc_1 via REST and give cluster from dc_2
To me this seems like an invalid usecase that should be blocked.
Michal - moving to virt to analyze.

Comment 2 Omer Frenkel 2014-05-20 08:19:48 UTC
right, user shouldn't be able to assign cluster from the wrong DC

Comment 3 Petr Kubica 2014-09-24 14:43:27 UTC
Verified in rhevm 3.5.0-0.12.beta.el6ev