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

Bug 1268949

Summary: Wrong error message while changing template of vm
Product: [oVirt] ovirt-engine Reporter: jniederm
Component: RestAPIAssignee: Marek Libra <mlibra>
Status: CLOSED CURRENTRELEASE QA Contact: meital avital <mavital>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.0.0CC: bugs, jniederm, juan.hernandez, mavital, michal.skrivanek, mlibra
Target Milestone: ovirt-4.0.0-alphaFlags: rule-engine: ovirt-4.0.0+
rule-engine: planning_ack+
michal.skrivanek: devel_ack+
mavital: testing_ack+
Target Release: 4.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt 4.0.0 alpha1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-17 14:37:02 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:
Attachments:
Description Flags
part of engine log generated during the processing of the request none

Description jniederm 2015-10-05 17:34:33 UTC
Created attachment 1080014 [details]
part of engine log generated during the processing of the request

Description of problem:
Misleading error message is printed as result of an attempt to change template of stopped (Down) vm:
"There was an attempt to change VM values while the VM is not down. Please shut down the VM in order to modify these properties."

Version-Release number of selected component (if applicable):
4.0 master, commit e94ce26

How reproducible:
100%

Steps to Reproduce:
1. Create a template with two versions
2. Create a vm based on the first version of the template (and let that vm in down state)
3. Execute following rest request
PUT /vms/{new-vm-id}
<vm>
  <template id="{id-if-the-second-versiton-of-the-template}"/>
</vm>

Actual results:
400 Bad Request
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
    <detail>[There was an attempt to change VM values while the VM is not down. Please shut down the VM in order to modify these properties.]</detail>
</fault>

Expected results:
Either real explanation of the reason why template can't be changed or the template of vm to be changed.

Comment 1 Juan Hernández 2015-10-05 17:39:46 UTC
Does this happen in 3.6 as well?

Comment 2 jniederm 2015-10-06 10:21:59 UTC
Yes, it does.

Comment 3 Marek Libra 2016-01-04 14:01:32 UTC
The template can be changed for pool VMs only with additional requirement on keeping the template version chain.

Patch improving the error message has been posted.

Comment 4 Michal Skrivanek 2016-01-05 10:16:08 UTC
it would be interesting to unblock changing of the template for any thin && stateless VM. It should work

Comment 5 Red Hat Bugzilla Rules Engine 2016-01-06 14:30:15 UTC
Fixed bug tickets must have version flags set prior to fixing them. Please set the correct version flags and move the bugs back to the previous status after this is corrected.

Comment 6 Red Hat Bugzilla Rules Engine 2016-01-06 14:43:11 UTC
Fixed bug tickets must have version flags set prior to fixing them. Please set the correct version flags and move the bugs back to the previous status after this is corrected.

Comment 7 Red Hat Bugzilla Rules Engine 2016-01-06 14:43:11 UTC
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.

Comment 8 Red Hat Bugzilla Rules Engine 2016-01-06 14:44:37 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 9 meital avital 2016-08-16 14:10:35 UTC
Verified on version: 4.0.2.6-0.1.el7ev


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
    <detail>[Cannot edit VM. The Template can be changed for pool VMs only.]</detail>
</fault>