Bug 1046336

Summary: [REST-API] misleading error message, for moving hosts between clusters
Product: Red Hat Enterprise Virtualization Manager Reporter: Barak Dagan <bdagan>
Component: ovirt-engine-restapiAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Tareq Alayan <talayan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: aberezin, acathrow, bazulay, eedri, iheim, oramraz, pstehlik, Rhev-m-bugs, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: is30 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1056111    

Description Barak Dagan 2013-12-24 15:34:03 UTC
Description of problem:
When moving host between cluster using "update host ... cluster-name ...", there is an error message required using a different method (change host cluster action).
1) Couldn't find that method as primary or under action & update as secondary action.
2) The host's moved to the new cluster.

Version-Release number of selected component (if applicable):
is28.1:
sdk version    : 3.3.0.21.*final-.1
cli version    : 3.3.0.12.*final-.1
python version : 2.6.6.final.0

How reproducible:
100%

Steps to Reproduce:
1. Create 2 DC, containing 1 cluster each.
2. Add host to one of the clusters
3. update host with the 2nd cluster name

Actual results:
error message while action successedd

Expected results:


Additional info:

[RHEVM shell (connected@localhost)]# list clusters

id         : 60f782e4-f7d8-48e8-ae62-9757d4254c04
name       : CL10

id         : 7cf98041-201e-4553-a4d7-527ad1f2b5a6
name       : cl_t

id         : 99408929-82cf-4dc7-a532-9d998063fa95
name       : Default
description: The default server cluster

[RHEVM shell (connected@localhost)]# show host MyHost | grep cluster
cluster-id                        : 60f782e4-f7d8-48e8-ae62-9757d4254c04
[RHEVM shell (connected@localhost)]# update host MyHost --cluster-name cl_t 

error: 
status: 400
reason: Bad Request
detail: Updating Host's Cluster cannot be performed through update Host action, please use Change Host Cluster action instead.

[RHEVM shell (connected@localhost)]# show host MyHost | grep cluster
cluster-id                        : 7cf98041-201e-4553-a4d7-527ad1f2b5a6

Comment 1 Juan Hernández 2013-12-25 15:11:07 UTC
The problem we have here is that we load the host entity before changing the cluster, then we change the cluster with the ChangeVDSCluster command and then we change the rest of the parameters with the UpdateVds command. But we load the host entity before the first command and pass it to the second, so the second command sees the old cluster id and explicitly refuses to perform the second part of the update (the first part, changing the cluster, has already been performed).

I think that we can fix this with the proposed patch, but I believe that this logic doesn't belong in the API, it should be part of the backend.

Comment 3 Tareq Alayan 2014-01-05 10:34:38 UTC
verified on rhevm-cli-3.3.0.13-1.el6ev.noarch

Comment 4 Itamar Heim 2014-01-21 22:23:35 UTC
Closing - RHEV 3.3 Released

Comment 5 Itamar Heim 2014-01-21 22:24:38 UTC
Closing - RHEV 3.3 Released

Comment 6 Itamar Heim 2014-01-21 22:28:17 UTC
Closing - RHEV 3.3 Released