Skip to content

server: allows compute offering with or without constraints - #3245

Merged
yadvr merged 7 commits into
apache:masterfrom
shapeblue:constraint-custom-compute-offering
May 23, 2019
Merged

server: allows compute offering with or without constraints#3245
yadvr merged 7 commits into
apache:masterfrom
shapeblue:constraint-custom-compute-offering

Conversation

@shwstppr

@shwstpprshwstppr commented Mar 28, 2019

Copy link
Copy Markdown
Contributor

Description

Problem: Custom compute offering does not allow setting min and max values for CPU and VRAM for custom VMs.

Root Cause: Custom compute offerings cannot be created with a given range of CPU number and memory instead it allows only fixed values.

Solution: createServiceOffering API has been modified to allow setting a defined range for CPU number and memory. Also, UI form for compute offering creation is provided with a new field named 'compute offering type’ with values - Fixed, Custom Constrained, Custom Constrained. It will allow the creation of compute offerings either with a fixed CPU speed and memory for fixed compute offering, or with a range of CPU number and memory for custom constrained compute offering or without predefined CPU number, CPU speed and memory for custom unconstrained compute offering.

To allow the user to set CPU number, CPU speed and memory during VM deployment, UI form for VM deployment has been modified to provide controls to change these values. These controls are depicted in screenshots below for custom constrained and custom unconstrained compute offering types.

Sample API calls using cmk to create a constrained service offering and deploying a VM using it,

create serviceoffering name=Constrained displaytext=Constrained customized=true mincpunumber=2 maxcpunumber=4 cpuspeed=400 minmemory=256 maxmemory=1024

deploy virtualmachine displayname=ConstrainedVM serviceofferingid=60f3e500-6559-40b2-9a61-2192891c2bd6 templateid=8e0f4a3e-601b-11e9-9df4-a0afbd4a2d60 zoneid=9612a0c6-ed28-4fae-9a48-6eb207af29e3 details[0].cpuNumber=3 details[0].memory=800

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):

Create compute offering form
Screenshot from 2019-03-12 17-32-13
Screenshot from 2019-03-12 17-32-17
Screenshot from 2019-03-12 17-32-22

VM deployment form
Screenshot from 2019-03-12 17-43-52
Screenshot from 2019-03-12 17-44-01

How Has This Been Tested?

Changes allow admin to create compute offerings with unconstrained CPU, Memory or constrained range CPU, memory which can be later set by user while deploying VM.
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2663

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

VM deployed using constrained service offering won't be having CPU speed in the details therefore CPU speed for such VMs need to be retrieved from offering itself. This change adds check for the same.
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2675

@shwstppr
shwstpprforce-pushed the constraint-custom-compute-offering branch from aa2ba3e to 2b89dfcCompareApril 4, 2019 07:09
@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@borisstoyanovborisstoyanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGMT. tested it manually, checked the constrained and unconstrained compute offering with different parameters, it's working as expected.

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3468)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 29608 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3245-t3468-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_accounts.py
Intermittent failure detected: /marvin/tests/smoke/test_affinity_groups_projects.py
Intermittent failure detected: /marvin/tests/smoke/test_async_job.py
Intermittent failure detected: /marvin/tests/smoke/test_iso.py
Smoke tests completed. 66 look OK, 4 have error(s)
Only failed tests results shown below:

TestResultTime (s)Test File
test_04_create_iso_with_no_checksumError65.87test_iso.py
ContextSuite context=TestAccounts>:setupError0.00test_accounts.py
ContextSuite context=TestAddVmToSubDomain>:setupError0.00test_accounts.py
test_DeleteDomainError1.54test_accounts.py
test_forceDeleteDomainError1.39test_accounts.py
ContextSuite context=TestRemoveUserFromAccount>:setupError5.72test_accounts.py
ContextSuite context=TestDeployVmWithAffinityGroup>:setupError0.00test_affinity_groups_projects.py
test_query_async_job_resultError0.00test_async_job.py

@PaulAngus

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2689

@PaulAngusPaulAngus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

tested manually, created a service offering with max 2 cores and max 512MB RAM.
logged in as a user and created a VM with 3 cores 128MB RAM and a VM with 1core and 1GB RAM.
(i did this by typing into the box next to the slider - i think typing in the box is ok BTW)

both VMs deployed OK - API should have not allowed this.

Arguably there should also be verification on UI before proceeding.

Comment threadui/l10n/en.js Outdated
"label.compute.offering":"Compute offering",
"label.compute.offering.type":"Compute offering type",
"label.compute.offering.custom.constrained":"Custom Constrained",
"label.compute.offering.custom.unconstrained":"Custom Unsconstrained",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
"label.compute.offering.custom.unconstrained":"Custom Unsconstrained",
"label.compute.offering.custom.unconstrained":"Custom Unconstrained",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good hack. Simply the ui typing field could be grey out but that won't solve the api call. This need a service layer check imho.

@yadvryadvr assigned yadvr and shwstppr and unassigned yadvrApr 10, 2019
@yadvryadvr added this to the 4.13.0.0 milestone Apr 10, 2019
Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
@shwstppr

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2692

Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2702

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@borisstoyanovborisstoyanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM on your latest changes @shwstppr

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-3498)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33532 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3245-t3498-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_password_server.py
Intermittent failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermittent failure detected: /marvin/tests/smoke/test_ssvm.py
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 66 look OK, 4 have error(s)
Only failed tests results shown below:

TestResultTime (s)Test File
test_isolate_network_password_serverFailure22.60test_password_server.py
test_01_isolate_network_FW_PF_default_routes_egress_trueFailure76.24test_routers_network_ops.py
test_01_RVR_Network_FW_PF_SSH_default_routes_egress_trueFailure107.19test_routers_network_ops.py
test_03_ssvm_internalsFailure14.13test_ssvm.py
test_05_stop_ssvmFailure66.94test_ssvm.py
test_09_destroy_ssvmFailure69.85test_ssvm.py
test_05_rvpc_multi_tiersFailure398.13test_vpc_redundant.py
test_05_rvpc_multi_tiersError427.09test_vpc_redundant.py

@PaulAngus

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2726

@PaulAngus

Copy link
Copy Markdown
Member

retested UI and API.
it is possible (by moving and forwards in the wizard and selecting different constrained custom offerings to confuse the UI into letting you request an offering that doesn't meet the criteria BUT the API then rejects it anyway. so it's a very very niche case, that I'm not concerned about.

LGTM.

@yadvryadvr changed the title [WIP DO NOT MERGE] server: allows compute offering with or without constraintsserver: allows compute offering with or without constraintsMay 23, 2019
@yadvr

Copy link
Copy Markdown
Member

Merging based on reviews from Paul and Bobby, and the smoketests.

@yadvr
yadvr merged commit 2020bfb into apache:masterMay 23, 2019
yadvr pushed a commit that referenced this pull request Aug 28, 2020
For customer constrained offering, the cpu speed is fixed.
Therefore the 'CpuSpeed' field should be hidden for customer constrained offering when change vm offering on UI.
It is visible only for unconstrained offering.
This is regression issue of #3245
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@shwstppr@borisstoyanov@blueorangutan@PaulAngus@yadvr@DaanHoogland@sb-abhish3k