-
Notifications
You must be signed in to change notification settings - Fork 1.3k
server: Fix some cpuspeed issues while create service offering #4376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server: Fix some cpuspeed issues while create service offering #4376
Conversation
Only the following offerings are accepted (1) fixed offering: cpunumber, memory, must be specified. cpuspeed should be specified example: create serviceoffering displaytext=offering-fix name=offering-fix cpunumber=1 memory=1024 cpuspeed=1000 (should not work) create serviceoffering displaytext=offering-fix name=offering-fix cpunumber=1 memory=1024 (but works in 4.14, fixed by this commit) (2) unconstrained offering: cpunumber, memory must be null cpuspeed must be null example: create serviceoffering displaytext=offering-unconstrained name=offering-unconstrained (should not work) create serviceoffering displaytext=offering-unconstrained name=offering-unconstrained cpunumber=1 create serviceoffering displaytext=offering-unconstrained name=offering-unconstrained memory=1024 create serviceoffering displaytext=offering-unconstrained name=offering-unconstrained cpuspeed=1000 (but works in 4.14, fixed by this commit) (3) constrained offering: cpunumber, memory must be null mincpunumber, maxcpunumber, minmemory, maxmemory, cpuspeed must be specified example:create serviceoffering displaytext=offering-constrained name=offering-constrained mincpunumber=1 maxcpunumber=2 minmemory=1024 maxmemory=2048 cpuspeed=1000 (should not work) create serviceoffering displaytext=offering-constrained name=offering-constrained mincpunumber=1 maxcpunumber=2 minmemory=1024 maxmemory=2048 (but works in 4.14, fixed by this commit)
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2127 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2899)
|
shwstppr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| throw new InvalidParameterValueException("For creating a custom compute offering min/max cpu and min/max memory/cpu speed should all be null or all specified"); | ||
| } | ||
| } else { | ||
| if (cpuSpeed != null && (cpuSpeed.intValue() < 0 || cpuSpeed.longValue() > Integer.MAX_VALUE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cpuSpeed null check not required here, it is always not null as per the above changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sureshanaparti indeed, I will remove it.
| throw new InvalidParameterValueException("Failed to create service offering " + offeringName + ": specify the cpu number value between 1 and " + Integer.MAX_VALUE); | ||
| } | ||
| if (cpuSpeed != null && (cpuSpeed.intValue() < 0 || cpuSpeed.longValue() > Integer.MAX_VALUE)) { | ||
| if (cpuSpeed == null || (cpuSpeed.intValue() < 0 || cpuSpeed.longValue() > Integer.MAX_VALUE)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ustcweizhou similar cond check applicable for cpuNumber and memory if these are mandatory params? check and update accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sureshanaparti cpuNumber and memory are not mandatory for dynamic offerings.
There are 3 types of offerings
(1) fixed offering, cpu number, cpu speed, memory are mandatory
(2) dynamic offering,
(2.1) unconstrained offering, cpu number, cpu speed, memory are not required
(2.2) constrained offerings, min/max cpu, min/max memory, and cpu speed are mandatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weizhouapache thanks for confirming
Description
Only the following offerings are accepted
(1) fixed offering:
cpunumber, memory, must be specified.
cpuspeed should be specified
example: create serviceoffering displaytext=offering-fix name=offering-fix cpunumber=1 memory=1024 cpuspeed=1000
(should not work)
create serviceoffering displaytext=offering-fix name=offering-fix cpunumber=1 memory=1024 (but works in 4.14, fixed by this commit)
(2) unconstrained offering:
cpunumber, memory must be null
cpuspeed must be null
example: create serviceoffering displaytext=offering-unconstrained name=offering-unconstrained
(should not work)
create serviceoffering displaytext=offering-unconstrained name=offering-unconstrained cpunumber=1
create serviceoffering displaytext=offering-unconstrained name=offering-unconstrained memory=1024
create serviceoffering displaytext=offering-unconstrained name=offering-unconstrained cpuspeed=1000 (but works in 4.14, fixed by this commit)
(3) constrained offering:
cpunumber, memory must be null
mincpunumber, maxcpunumber, minmemory, maxmemory, cpuspeed must be specified
example:create serviceoffering displaytext=offering-constrained name=offering-constrained mincpunumber=1 maxcpunumber=2 minmemory=1024 maxmemory=2048 cpuspeed=1000
(should not work)
create serviceoffering displaytext=offering-constrained name=offering-constrained mincpunumber=1 maxcpunumber=2 minmemory=1024 maxmemory=2048 (but works in 4.14, fixed by this commit)
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?