Skip to content

Conversation

@shwstppr
Copy link
Contributor

@shwstppr shwstppr commented Mar 28, 2019

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 <[email protected]>
@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@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 <[email protected]>
@blueorangutan
Copy link

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

@shwstppr shwstppr force-pushed the constraint-custom-compute-offering branch from aa2ba3e to 2b89dfc Compare April 4, 2019 07:09
@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

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

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:

Test Result Time (s) Test File
test_04_create_iso_with_no_checksum Error 65.87 test_iso.py
ContextSuite context=TestAccounts>:setup Error 0.00 test_accounts.py
ContextSuite context=TestAddVmToSubDomain>:setup Error 0.00 test_accounts.py
test_DeleteDomain Error 1.54 test_accounts.py
test_forceDeleteDomain Error 1.39 test_accounts.py
ContextSuite context=TestRemoveUserFromAccount>:setup Error 5.72 test_accounts.py
ContextSuite context=TestDeployVmWithAffinityGroup>:setup Error 0.00 test_affinity_groups_projects.py
test_query_async_job_result Error 0.00 test_async_job.py

@PaulAngus
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Copy link
Member

@PaulAngus PaulAngus left a comment

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.

ui/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
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
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.

@yadvr yadvr assigned yadvr and shwstppr and unassigned yadvr Apr 10, 2019
@yadvr yadvr added this to the 4.13.0.0 milestone Apr 10, 2019
@shwstppr
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@borisstoyanov
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

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

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:

Test Result Time (s) Test File
test_isolate_network_password_server Failure 22.60 test_password_server.py
test_01_isolate_network_FW_PF_default_routes_egress_true Failure 76.24 test_routers_network_ops.py
test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true Failure 107.19 test_routers_network_ops.py
test_03_ssvm_internals Failure 14.13 test_ssvm.py
test_05_stop_ssvm Failure 66.94 test_ssvm.py
test_09_destroy_ssvm Failure 69.85 test_ssvm.py
test_05_rvpc_multi_tiers Failure 398.13 test_vpc_redundant.py
test_05_rvpc_multi_tiers Error 427.09 test_vpc_redundant.py

@PaulAngus
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@PaulAngus
Copy link
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.

@yadvr yadvr changed the title [WIP DO NOT MERGE] server: allows compute offering with or without constraints server: allows compute offering with or without constraints May 23, 2019
@yadvr
Copy link
Member

yadvr commented May 23, 2019

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

@yadvr yadvr merged commit 2020bfb into apache:master May 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 free to 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.

6 participants