Bug 1303450 - [REST] Increasing the CPU sockets to a amount of CPU's that the host doesn't have, Shouldn't be possible via REST
Summary: [REST] Increasing the CPU sockets to a amount of CPU's that the host doesn't ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: General
Version: 3.6.3
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ovirt-4.1.0-alpha
: 4.1.0.2
Assignee: Marek Libra
QA Contact: Shira Maximov
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-31 19:53 UTC by Shira Maximov
Modified: 2017-02-01 14:55 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-02-01 14:55:40 UTC
oVirt Team: Virt
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: planning_ack+
rule-engine: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)
engine log (13.46 MB, text/plain)
2016-01-31 19:53 UTC, Shira Maximov
no flags Details
rest logs (1.46 MB, text/plain)
2016-01-31 19:57 UTC, Shira Maximov
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 59618 0 master MERGED core: validate CPU topology in UpdateVMCommand 2016-07-04 11:11:47 UTC

Description Shira Maximov 2016-01-31 19:53:14 UTC
Created attachment 1119926 [details]
engine log

Description of problem:
Increasing the CPU sockets (hot plug cpu) while VM is running to a amount of CPU's that the host doesn't have, is possible via REST and it shouldn't be possible. 


Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization Manager Version: 3.6.3-0.1.el6 

How reproducible:
100%

Steps to Reproduce:
1.Running VM with 1 socket * 1 core (Host total cpu is 6 ) 
2. Try to increase the socket to 16 - in UI not possible but in REST it is possible.
2016-01-31 21:14:18,854 - MainThread - vms - DEBUG - PUT request content is --  url:/ovirt-engine/api/vms/735366b0-49a5-4425-9e7a-b85dab01281a body:<vm>
    <cpu>
        <topology sockets="16"/>
    </cpu>
</vm>


3.

Actual results: 
The put request worked


Expected results:
The put request should work


Additional info:

Comment 1 Shira Maximov 2016-01-31 19:55:04 UTC
comment: the VM need to be pin to a specific host

Comment 2 Shira Maximov 2016-01-31 19:57:37 UTC
Created attachment 1119927 [details]
rest logs

Comment 3 Yaniv Kaul 2016-02-01 10:00:33 UTC
Shira - why is it high severity? What is the user consequence?

Comment 4 Shira Maximov 2016-02-04 07:45:05 UTC
(In reply to Yaniv Kaul from comment #3)
> Shira - why is it high severity? What is the user consequence?

There is no Validation in REST, if the user will run nproc or top commands in the VM he will see the number of CPU's that you enter in REST,  even tough the VM can't have this amount of CPUS (because the host doesn't have this resources).

Comment 5 Yaniv Kaul 2016-02-04 08:28:24 UTC
(In reply to Shira Maximov from comment #4)
> (In reply to Yaniv Kaul from comment #3)
> > Shira - why is it high severity? What is the user consequence?
> 
> There is no Validation in REST, if the user will run nproc or top commands
> in the VM he will see the number of CPU's that you enter in REST,  even
> tough the VM can't have this amount of CPUS (because the host doesn't have
> this resources).

OK (it shouldn't be in REST but in the backend), but I still don't see why it is a severe bug.

Comment 6 Michal Skrivanek 2016-03-16 08:56:53 UTC
we explicitly go through scheduling filters in this case - we should do that for REST path as well

Comment 7 Sandro Bonazzola 2016-12-12 13:59:59 UTC
The fix for this issue should be included in oVirt 4.1.0 beta 1 released on December 1st. If not included please move back to modified.

Comment 8 Shira Maximov 2016-12-13 11:53:05 UTC
Verified on :
oVirt Engine Version: 4.1.0-0.0.master.20161120231325.gitba51756.el7.centos


verification steps :
PUT request in REST: 
url:/ovirt-engine/api/vms/vm-id

body:
<vm>
  <cpu>
    <topology>
      <sockets>16</sockets>
    </topology>
  </cpu>
</vm>

result: 
<fault>
<detail>
[The requested number of vCPUs is not available on the host the VM is running on]
</detail>
<reason>Operation Failed</reason>
</fault>


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