Skip to content

Conversation

@ustcweizhou
Copy link
Contributor

@ustcweizhou ustcweizhou commented Oct 6, 2020

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

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

How Has This Been Tested?

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)
Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@DaanHoogland DaanHoogland added this to the 4.14.1.0 milestone Oct 6, 2020
@blueorangutan
Copy link

@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2127

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-2899)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 30521 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4376-t2899-kvm-centos7.zip
Smoke tests completed. 83 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

Copy link
Contributor

@shwstppr shwstppr left a 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)) {
Copy link
Contributor

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.

Copy link
Member

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)) {
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weizhouapache thanks for confirming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants