Bug 1172207

Summary: Create new vm from template that lay on other than vm cluster failed on cpu_profile error
Product: Red Hat Enterprise Virtualization Manager Reporter: Artyom <alukiano>
Component: ovirt-engineAssignee: Doron Fediuck <dfediuck>
Status: CLOSED ERRATA QA Contact: Shira Maximov <mshira>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: bazulay, dfediuck, iheim, istein, juan.hernandez, juwu, lsurette, mavital, pzhukov, rbalakri, rgolan, Rhev-m-bugs, sherold, yeylon, ykaul
Target Milestone: ovirt-3.6.0-rcKeywords: ZStream
Target Release: 3.6.0   
Hardware: x86_64   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously, changing the cluster of a virtual machine failed as the CPU profile from the old cluster did not match the CPU profile of the new cluster. With this update, the CPU profile gets updated automatically to match the newly selected cluster.
Story Points: ---
Clone Of:
: 1220125 (view as bug list) Environment:
Last Closed: 2016-03-09 20:52:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: SLA RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1220125    

Description Artyom 2014-12-09 15:42:56 UTC
Description of problem:
Have environment with two clusters(cluster_1, cluster_2), all templates placed on cluster_1, so when I want to create new vm from template on cluster_2, operation failed with error:

Status: 400
Reason: Bad Request
Detail: [Cannot add VM. CPU Profile doesn't match provided Cluster.]

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

How reproducible:

Steps to Reproduce:
1. Setup environment with two clusters
2. Create template from vm on cluster_1
3. Create new vm from template on cluster_2

Actual results:
Operation failed with error.

Expected results:
Operation success, without any errors

Additional info:
My template:
<template href= "/ovirt-engine/api/templates/366f1e3c-289f-4fc4-82d6-1872594fde82" id="366f1e3c-289f-4fc4-82d6-1872594fde82">
<link href= "/ovirt-engine/api/templates/366f1e3c-289f-4fc4-82d6-1872594fde82/export" rel="export"/>
<link href= "/ovirt-engine/api/templates/366f1e3c-289f-4fc4-82d6-1872594fde82/disks" rel="disks"/>
<link href= "/ovirt-engine/api/templates/366f1e3c-289f-4fc4-82d6-1872594fde82/nics" rel="nics"/>
<link href= "/ovirt-engine/api/templates/366f1e3c-289f-4fc4-82d6-1872594fde82/cdroms" rel="cdroms"/>
<link href= "/ovirt-engine/api/templates/366f1e3c-289f-4fc4-82d6-1872594fde82/tags" rel="tags"/>
<link href= "/ovirt-engine/api/templates/366f1e3c-289f-4fc4-82d6-1872594fde82/permissions" rel="permissions"/>
<link href= "/ovirt-engine/api/templates/366f1e3c-289f-4fc4-82d6-1872594fde82/watchdogs" rel="watchdogs"/>
<topology sockets="1" cores="1"/>
<os type="other">
<boot dev="hd"/>
<cluster href= "/ovirt-engine/api/clusters/08ea0169-ae42-4e1b-bb20-839a66cd2010" id="08ea0169-ae42-4e1b-bb20-839a66cd2010"/>
<method id="GUEST_AGENT"/>
<cpu_profile href= "/ovirt-engine/api/cpuprofiles/69d5efc1-9dc0-46f3-84a4-37df7f12d432" id="69d5efc1-9dc0-46f3-84a4-37df7f12d432"/>

Create vm looks like:
    <cluster href="/api/clusters/67866b36-fd68-4106-8758-34cf31b0c3d4" id="67866b36-fd68-4106-8758-34cf31b0c3d4">
    <template id="366f1e3c-289f-4fc4-82d6-1872594fde82"/>

Comment 1 Juan Hernández 2014-12-09 16:03:22 UTC
This happens because the details of the VM, including the disk profile, are taken from the template, and the disk profile in the template is only valid for the cluster of the template. In previous similar discussions (see bug 1158458) it has been decided that rejecting this is correct behavior, and that it won't be changed, so this should probably closed as WONTFIX. However, I let that to the SLA team to decided. As a workaround you can create the VM initially in the same cluster that the template and then, with an additional request, change only the cluster.

Comment 6 Juan Hernández 2015-07-07 08:53:45 UTC
The fix for this bug is included upstream since ovirt-engine-3.6.0_alpha1, thus I'm moving to ON_QA.

Comment 8 Julie 2016-02-23 02:16:22 UTC
Hey Roy,
     I've updated the doc text. Please let me know if it is correct.
Kind regards,

Comment 10 errata-xmlrpc 2016-03-09 20:52:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.