Bug 1003282

Summary: [RHEVM-ENGINE] wrong error when updating host IP address using REST API
Product: Red Hat Enterprise Virtualization Manager Reporter: Barak Dagan <bdagan>
Component: ovirt-engineAssignee: Mooli Tayer <mtayer>
Status: CLOSED CURRENTRELEASE QA Contact: Tareq Alayan <talayan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: aberezin, acathrow, bazulay, eedri, iheim, lpeer, pstehlik, Rhev-m-bugs, yeylon
Target Milestone: ---Keywords: Triaged
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: is19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 22:16:56 UTC 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: 1026487    
Attachments:
Description Flags
engine + cli logs none

Description Barak Dagan 2013-09-01 15:44:45 UTC
Created attachment 792612 [details]
engine + cli logs

Description of problem:
After an host is added, trying to edit it's IP address (when host is in maintenance mode) fails due to wrong error: 

[RHEVM shell]# update host MyHost --address IP-Addr

error: 
status: 409
reason: Conflict
detail: Cannot edit Host. Host parameters cannot be modified while Host is operational.
Please switch Host to Maintenance mode first

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

How reproducible:
100%

Steps to Reproduce:
1.
2.
3.

Actual results:
detail: Cannot edit Host. Host parameters cannot be modified while Host is operational.
Please switch Host to Maintenance mode first

Expected results:
detail: Cannot edit Host. parameter cannot be modified.

Additional info:

Comment 1 Mooli Tayer 2013-10-01 16:12:37 UTC
There is already an error message for this case: ACTION_TYPE_FAILED_HOSTNAME_CANNOT_CHANGE

It was not exposed due to a bug. Patch suggested on master.

Comment 2 Mooli Tayer 2013-10-01 16:21:17 UTC
just saw this is has flags exception & 3.3, changing to assigned.

Comment 4 Tareq Alayan 2013-10-29 22:10:36 UTC
Verified. tested on: 
rhevm-3.3.0-0.28.beta1.el6ev.noarch

[RHEVM shell (connected)]# update host rose04 --address 1.1.1.1

error: 
status: 400
reason: Bad Request
detail: Host Address can not be modified due to Security restrictions.  In order to change Host Address, Host has to be reinstalled

Comment 5 Barak Dagan 2013-10-30 10:20:24 UTC
According https://bugzilla.redhat.com/show_bug.cgi?id=1003281#c8
IP addrerss can be changed using API, but not from UI. So using UI related error message in REST, might not be the best solution.

Comment 6 Mooli Tayer 2013-10-30 11:40:59 UTC
I see. It is possible to implement it this way and might even be better according to bug 1003281, comment 8 and bug 1003281, comment 9. however currently the code contains a specific check to prevent this situation since ovirt git history began.

Comment 7 Itamar Heim 2014-01-21 22:16:56 UTC
Closing - RHEV 3.3 Released

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