Bug 1326810 - Cannot edit HE VM via REST API
Summary: Cannot edit HE VM via REST API
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.HostedEngine
Version: 3.6.5
Hardware: x86_64
OS: Linux
urgent
high
Target Milestone: ovirt-3.6.7
: ---
Assignee: Roman Mohr
QA Contact: Artyom
URL:
Whiteboard:
: 1327891 (view as bug list)
Depends On: 1328921
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-13 13:02 UTC by Artyom
Modified: 2017-05-11 09:27 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Some VM devices were not imported. See bug https://bugzilla.redhat.com/show_bug.cgi?id=1328921 for details. Consequence: Hosted Engine VM was only editable through the GUI but not through the REST API. Fix: Import video and graphics devices. Result: Editing allowed values is now possible through the GUI and through the REST API.
Clone Of:
Environment:
Last Closed: 2016-07-04 12:33:44 UTC
oVirt Team: SLA
Embargoed:
rule-engine: ovirt-3.6.z+
ylavi: blocker+
mgoldboi: planning_ack+
msivak: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1343593 0 unspecified CLOSED after hosted-engine --upgrade-appliance action is done, HE VM still runs with old disk 2022-02-25 11:25:01 UTC
oVirt gerrit 56302 0 master ABANDONED core: Load the same data in REST and VM update command 2021-02-19 23:38:37 UTC
oVirt gerrit 56351 0 ovirt-engine-3.6 MERGED core: Make disk list of VM editable on HE update 2021-02-19 23:38:37 UTC
oVirt gerrit 56354 0 master MERGED core: Make disk list of VM editable on HE update 2021-02-19 23:38:37 UTC
oVirt gerrit 57298 0 ovirt-engine-3.6 MERGED core: Import graphics devices from hosted engine VM 2021-02-19 23:38:37 UTC
oVirt gerrit 57885 0 ovirt-hosted-engine-setup-1.3 MERGED Make video device explicit 2021-02-19 23:38:36 UTC
oVirt gerrit 57887 0 ovirt-hosted-engine-ha-1.3 MERGED Extract video device from OVF store 2021-02-19 23:38:36 UTC
oVirt gerrit 58099 0 ovirt-engine-3.6 MERGED core: Insert valid graphics and display devices in HE VM 2021-02-19 23:38:37 UTC
oVirt gerrit 58255 0 ovirt-engine-4.0 MERGED core: Import graphics devices from externally managed VMs 2021-02-19 23:38:37 UTC
oVirt gerrit 58313 0 ovirt-engine-3.6.7 MERGED core: Import graphics devices from hosted engine VM 2021-02-19 23:38:37 UTC
oVirt gerrit 58314 0 ovirt-engine-3.6.7 MERGED core: Insert valid graphics and display devices in HE VM 2021-02-19 23:38:37 UTC

Internal Links: 1343593

Description Artyom 2016-04-13 13:02:04 UTC
Description of problem:
Impossible to edit HE VM via REST API

Version-Release number of selected component (if applicable):
rhevm-3.6.5.3-0.1.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. Deploy hosted engine and add storage domain to engine to auto-import it
2. Try to edit HE VM via REST
<vm>
<name>HostedEngine1</name>
</vm>
3.

Actual results:
<fault>
<reason>Operation Failed</reason>
<detail>[There was an attempt to change Hosted Engine VM values that are locked.]</detail>
</fault>

Expected results:
Possible to edit HE VM values that we permit to edit via UI

Additional info:

Comment 1 Martin Sivák 2016-04-13 15:37:05 UTC
Please show the exact request you used.

Comment 2 Artyom 2016-04-13 16:04:22 UTC
I did PUT request, you can see it under step 2, but I also tried the same thing for memory and cpu:
<vm>
<memory>some_value</memory>
</vm>

<vm>
<cpu>
<topologysockets="4"cores="1"threads="1"/>
</cpu>
</vm>

Comment 3 Martin Sivák 2016-04-13 16:51:26 UTC
Ok, the VM name should not be editable so that is correct. But the two others should be.

I found out that the REST api change for memory tries to update the diskList attribute and that prevents the rest of the change from being applied.

Comment 4 Martin Sivák 2016-04-13 17:07:20 UTC
Another check that fails in CanDoAction is isNumOfMonitorsLegal. And that happens although both db and params value of numOfMonitors is 1.

Comment 5 Martin Sivák 2016-04-13 17:09:48 UTC
Both issues happen only when the edit is done over REST.

Comment 6 Jenny Tokar 2016-04-18 15:05:47 UTC
*** Bug 1327891 has been marked as a duplicate of this bug. ***

Comment 7 Roman Mohr 2016-04-20 15:29:27 UTC
(In reply to Martin Sivák from comment #4)
> Another check that fails in CanDoAction is isNumOfMonitorsLegal. And that
> happens although both db and params value of numOfMonitors is 1.

That's a different bug: https://bugzilla.redhat.com/show_bug.cgi?id=1328921

Comment 8 Artyom 2016-05-04 14:45:44 UTC
Checked on rhevm-3.6.6-0.1.el6.noarch
PUT request:
<vm>
  <memory>8589934592</memory>
</vm>

response:
<fault>
<reason>Operation Failed</reason>
<detail>[Cannot edit VM. Illegal number of monitors is provided, max allowed number of monitors is 1 for VNC and the max number in the ValidNumOfMonitors configuration variable for SPICE., Cannot edit VM. Illegal number of monitors is provided, max allowed number of monitors is 1 for VNC and the max number in the ValidNumOfMonitors configuration variable for SPICE.]</detail>
</fault>

Comment 9 Yaniv Kaul 2016-05-04 18:17:07 UTC
Missed 3.6.6, moving to 3.6.7.

Comment 10 Roman Mohr 2016-05-04 20:48:13 UTC
(In reply to Artyom from comment #8)
> Checked on rhevm-3.6.6-0.1.el6.noarch
> PUT request:
> <vm>
>   <memory>8589934592</memory>
> </vm>
> 
> response:
> <fault>
> <reason>Operation Failed</reason>
> <detail>[Cannot edit VM. Illegal number of monitors is provided, max allowed
> number of monitors is 1 for VNC and the max number in the ValidNumOfMonitors
> configuration variable for SPICE., Cannot edit VM. Illegal number of
> monitors is provided, max allowed number of monitors is 1 for VNC and the
> max number in the ValidNumOfMonitors configuration variable for
> SPICE.]</detail>
> </fault>

@artyom What you witnessed is https://bugzilla.redhat.com/show_bug.cgi?id=1328921. Also try editing the HE VM from the GWT frontend and you will see that it does not work either.

It leaves probably most of the hosted engine imports in an inconsistent state (important for the edit VM feature, HE itself will work as expeced). Make sure that you select SPICE as display device when doing the 'hosted-engine --deploy' procedure to work around that issue.

Comment 11 Roman Mohr 2016-05-04 20:51:17 UTC
(In reply to Yaniv Kaul from comment #9)
> Missed 3.6.6, moving to 3.6.7.

I could not come up fast enough with a fix for https://bugzilla.redhat.com/show_bug.cgi?id=1328921 but this one should be fixed in 3.6.6. Another QA run with the additional info provided above should make the tests pass.

Comment 12 Yaniv Kaul 2016-05-05 06:46:26 UTC
Artyom - please follow comment 10 so we'll be able to asses this bug inclusion to 3.6.6

Comment 13 Artyom 2016-05-05 11:43:26 UTC
I rechecked update of HE VM via REST on deploy over spice console, and still have the same error:
[Cannot edit VM. Illegal number of monitors is provided, max allowed number of monitors is 1 for VNC and the max number in the ValidNumOfMonitors configuration variable for SPICE., Cannot edit VM. Illegal number of monitors is provided, max allowed number of monitors is 1 for VNC and the max number in the ValidNumOfMonitors configuration variable for SPICE.]

Update via webadmin works fine.

Comment 14 Yaniv Kaul 2016-05-05 11:45:59 UTC
(In reply to Artyom from comment #13)
> I rechecked update of HE VM via REST on deploy over spice console, and still
> have the same error:
> [Cannot edit VM. Illegal number of monitors is provided, max allowed number
> of monitors is 1 for VNC and the max number in the ValidNumOfMonitors
> configuration variable for SPICE., Cannot edit VM. Illegal number of
> monitors is provided, max allowed number of monitors is 1 for VNC and the
> max number in the ValidNumOfMonitors configuration variable for SPICE.]
> 

Why would we ever want to change the number of monitors for hosted-engine?
I suggest we concentrate on the important stuff. Do they work? (I saw some comment from you on timezone, for example).

> Update via webadmin works fine.

Comment 15 Roy Golan 2016-05-05 11:58:11 UTC
(In reply to Artyom from comment #13)
> I rechecked update of HE VM via REST on deploy over spice console, and still
> have the same error:
> [Cannot edit VM. Illegal number of monitors is provided, max allowed number
> of monitors is 1 for VNC and the max number in the ValidNumOfMonitors
> configuration variable for SPICE., Cannot edit VM. Illegal number of
> monitors is provided, max allowed number of monitors is 1 for VNC and the
> max number in the ValidNumOfMonitors configuration variable for SPICE.]
> 
> Update via webadmin works fine.

Artyom what exactly is the change you're sending, num of monitors ?

Comment 16 Artyom 2016-05-05 12:51:05 UTC
I send update only for memory parameter
<vm>
  <memory>8589934592</memory>
</vm>
I remember we had the same problem via UI, it also tried to update some additional stuff and not only parameters that I changed.

Comment 17 Roy Golan 2016-05-08 07:23:49 UTC
console is VNC? is changing to SPICE and editing works?

Comment 18 Artyom 2016-05-08 08:00:50 UTC
No, console is SPICE from HE deployment.

Comment 19 Roman Mohr 2016-05-10 13:13:13 UTC
I could confirm it now too that it works neither with SPICE nor VNC. I am currently verifying a possible fix.

Comment 20 Yaniv Lavi 2016-05-16 09:01:05 UTC
Should this be modified?

Comment 21 Roy Golan 2016-05-16 12:19:04 UTC
(In reply to Yaniv Dary from comment #20)
> Should this be modified?

57298 is still on review

Comment 22 Yaniv Lavi 2016-05-23 12:57:17 UTC
Required for HE upgrade to 4.0.

Comment 23 Yaniv Kaul 2016-06-01 10:28:54 UTC
Not sure it can be in MODIFIED sate without a build (of 3.6.8).

Comment 24 Roman Mohr 2016-06-01 10:36:35 UTC
(In reply to Yaniv Kaul from comment #23)
> Not sure it can be in MODIFIED sate without a build (of 3.6.8).

I thought it is modified when all patches are merged (they are in 3.6 branch now) but of course QE can just test it after the first build.

Comment 25 Roman Mohr 2016-06-01 14:55:05 UTC
Moving back to post since there will be another 3.6.7 build I can catch.

Comment 26 Artyom 2016-06-16 13:57:53 UTC
Verified on rhevm-3.6.7.4-0.1.el6.noarch

1) Update VM memory - PASS
2) Update VM number of cores - PASS
3) Add VNIC to HE VM - PASS


Note You need to log in before you can comment on or make changes to this bug.