Bug 834198

Summary: OVIRT-CLI: update network by name doesn't work
Product: [Retired] oVirt Reporter: Elena <edolinin>
Component: ovirt-engine-cliAssignee: Michael Pasternak <mpastern>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acathrow, bazulay, dyasny, ecohen, iheim, oramraz, Rhev-m-bugs, srevivo, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra network
Fixed In Version: 3.1.0.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-17 07:49:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Elena 2012-06-21 07:52:47 UTC
update network testrest2  --description 'Test Desciption' --name 'testrest3'

Got an error in cli and engine.log:
2012-06-21 10:04:04,150 WARN  [org.ovirt.engine.core.bll.storage.UpdateNetworkCommand] (ajp--0.0.0.0-8009-12) [24c01206] CanDoAction of action UpdateNetwork failed. Reasons:VAR__ACTION__UPDATE,VAR__TYPE__NETWORK,NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK

According to Michael - the problem is in restapi: api reports /api/networks as searchable collection

Comment 1 Michael Pasternak 2012-06-21 08:10:46 UTC
entire update of network (by-name [1]) won't work cause, used following
pattern [2] to retrieve network by-name while actually /api/network
is non-searchable collection,

bottom line, restapi reports /api/network collection as searchable while 
it is not.

p.s future versions of CLI will not retrieve object on update before setting 
fields in it [3]

[1] update network my_network --description aaa --name bbb
[2] /api/networks?search=name%3Dmy_network
[3] https://bugzilla.redhat.com/show_bug.cgi?id=834202

Comment 2 Michael Pasternak 2012-06-21 08:34:13 UTC
Oded, you have simple workaround: update network by id [1], so i'm
not sure this is high priority bug.

[1]

[oVirt shell (connected)]# update network "e7449227-31a0-46a9-856c-e61439dade62" --description aaa --name bbb

id            : e7449227-31a0-46a9-856c-e61439dade62
name          : bbb
description   : aaa
data_center-id: c747d78b-ee6a-485c-8f81-1b9d46be51e9
display       : False
mtu           : 0
required      : False
status-state  : non_operational
stp           : False
usages-usage  : VM

Comment 3 Michael Pasternak 2012-06-24 08:00:48 UTC
*** Bug 834841 has been marked as a duplicate of this bug. ***

Comment 4 Michael Pasternak 2012-07-04 13:22:09 UTC
use sdk >= 3.1.0.4

Comment 5 Elena 2012-08-09 05:20:06 UTC
Verified in rhevm-sdk-3.1.0.5-1.el6ev.noarch.rpm, rhevm-cli-3.1.0.7-1.el6ev.noarch.rpm