Skip to content

Conversation

@harikrishna-patnala
Copy link
Contributor

@harikrishna-patnala harikrishna-patnala commented Feb 3, 2021

Description

This PR introduces new granularity levels to configure VM dynamic scalability. Previously VM is configured to be dynamically scalable based on the template and global setting. Now we bringing this option to configure at service offering and VM level also.

VM can dynamically scale only when all flags are ON at VM level, template, service offering and global setting. If any of the flags is set to false then VM cannot be scalable. This result will be persisted in DB for each VM and will be honoured for that VM till it is updated.

We are introducing 'dynamicscalingallowed' parameter with permitted values of true or false for deployVM API and createServiceOffering API.

Following are the API parameter changes:
createServiceOffering API:
dynamicscalingenabled: an optional parameter of type Boolean with default value “true”.
deployVirtualMachine API:
dynamicscalingenabled: an optional parameter of type Boolean with default value “true”.

Following are the UI changes:
Service offering creation has ON/OFF switch for dynamic scaling enabled with default value true.

image

Deploy VM wizard has ON/OFF switch for dynamic scaling enabled with default value true in Advanced Mode section.

image

Added a documentation PR to support these changes
apache/cloudstack-documentation#186

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Following are the test cases that I've covered as part of my testing on VMware environment.

VM Creation:

  1. Created VM with Small service offering with all Flags ON
    - VM1 (scalable)
  2. Created VM with Small service offering which is not dynamic, with Dynamic Scaling Enabled true on VM
    - VM2 (not scalable)
  3. Created VM with Small service offering, with Dynamic Scaling Enabled false on VM
    - VM3 (not scalable)
  4. Created VM with Small service offering which is not dynamic, with Dynamic Scaling Enabled false on VM
    - VM4 (not scalable)
  5. Created VM with Small service offering with all dynamic flags ON except template
    - VM5 (not scalable)

VM Update:

  1. Stop VM1 => set Dynamic Scaling Enabled to false => Update VM
    - VM is updated to Dynamic Scaling Enabled value false
  2. Stop VM2 or VM3 or VM4 or VM5 => set Dynamic Scaling Enabled to true => Update VM
    - VM update operation fails because VM cannot be scaled with any of the template/service offering/global setting dynamic scaling enabled flag with false

VM dynamic Scaling:

While trying to scale VM from UI, it will only list service offering that are suitable to scale and also offering with "Dynamic Scaling Enabled" value same as old service offering.

  1. Create Big Service Offering with Dynamic Scaling Enabled true
    - SO1
  2. Create Big Service Offering with Dynamic Scaling Enabled false
    - SO2
  3. Scale VM1 (scalable) to Service Offering SO1
    - Successful
  4. Scale VM1 (scalable) to Service Offering SO2
    - Operation failed because, VM1 Service Offering is marked Dynamic Scaling Enabled but not on SO2

@harikrishna-patnala harikrishna-patnala marked this pull request as draft February 3, 2021 05:55
@harikrishna-patnala harikrishna-patnala added this to the 4.16.0.0 milestone Feb 3, 2021
@harikrishna-patnala
Copy link
Contributor Author

@blueorangutan package

@yadvr
Copy link
Member

yadvr commented Feb 3, 2021

@blueorangutan ui

@harikrishna-patnala
Copy link
Contributor Author

@blueorangutan package

@harikrishna-patnala
Copy link
Contributor Author

@blueorangutan test matrix

@harikrishna-patnala
Copy link
Contributor Author

These failed test cases are commonly seen on all PRs, not related to this PR changes.

test_01_scale_vm on XenServer is failing with License error

@harikrishna-patnala
Copy link
Contributor Author

@blueorangutan ui

Copy link

@utchoang utchoang left a comment

Choose a reason for hiding this comment

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

UI Code LGTM!


@Column(name = "dynamic_scaling_enabled")
private boolean dynamicScalingEnabled;

Copy link
Contributor

Choose a reason for hiding this comment

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

@harikrishna-patnala what's the difference between "dynamic_scaling_enabled" vs "is_dynamic" field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is_dynamic is related to custom compute offerings and thats a transient parameter.

getCurrentTimeStampString(),
"autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(), null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null, null,
null, true, null, null, null, null, null, null, null);
null, true, null, null, null, null, null, null, null, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

@harikrishna-patnala is there a reason that we've set it to true as opposed to find the value from the service offering?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this parameter value in deploy VM flow is the one that read from deploy VM API, where as in other cases there is no user/admin option to specify whether the VM can be dynamically scalable or not, so it is defaulted to true. All these method calls will reach checkIfDynamicScalingCanBeEnabled() where other dynamic scaling flags from template, offering and global setting are considered.

owner, "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(),
"autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(), null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null,
null, null, true, null, null, null, null, null, null, null);
null, null, true, null, null, null, null, null, null, null, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

vm = _userVmService.createAdvancedVirtualMachine(zone, serviceOffering, template, null, owner, "autoScaleVm-" + asGroup.getId() + "-" +
getCurrentTimeStampString(), "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(),
null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null, null, addrs, true, null, null, null, null, null, null, null);
null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null, null, addrs, true, null, null, null, null, null, null, null, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor

@nvazquez nvazquez left a comment

Choose a reason for hiding this comment

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

Nice feature, I left some comments

}

public Boolean getDynamicScalingEnabled() {
return isDynamicScalingEnabled == null ? Boolean.TRUE : isDynamicScalingEnabled;
Copy link
Contributor

Choose a reason for hiding this comment

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

As the null check is in place, what about returning boolean instead of Boolean on this function? Also, this will mean that all the service offerings registered before 4.16 will now become dynamically scallable as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed all Boolean to boolean, thanks for that.
Yes all old service offerings prior to upgrade will be marked as dynamically scalable. This is made not to break existing VMs because service offering was not part of dynamic scaling decision before. After upgrade we need to bypass that check for old VMs, which can be achieved by marking them true.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy, thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

@harikrishna-patnala and @nvazquez this method is Boolean was it meant to become boolean?

@harikrishna-patnala
Copy link
Contributor Author

@sureshanaparti @Pearl1594 @nvazquez I've addressed your comments and updated the code as per the suggestions. Please review.

@harikrishna-patnala
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

@harikrishna-patnala 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. SL-JID 110

@harikrishna-patnala
Copy link
Contributor Author

@blueorangutan test matrix

@apache apache deleted a comment from blueorangutan May 28, 2021
@apache apache deleted a comment from blueorangutan May 29, 2021
@apache apache deleted a comment from blueorangutan May 29, 2021
@apache apache deleted a comment from blueorangutan May 29, 2021
@DaanHoogland
Copy link
Contributor

@blueorangutan test matrix

@blueorangutan
Copy link

@DaanHoogland a Trillian-Jenkins matrix job (centos7 mgmt + xs71, centos7 mgmt + vmware65, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@apache apache deleted a comment from blueorangutan May 29, 2021
@apache apache deleted a comment from blueorangutan May 29, 2021
@apache apache deleted a comment from blueorangutan May 29, 2021
@apache apache deleted a comment from blueorangutan May 29, 2021
@apache apache deleted a comment from blueorangutan May 29, 2021
@apache apache deleted a comment from blueorangutan May 29, 2021
@blueorangutan
Copy link

Trillian test result (tid-788)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33951 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4643-t788-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
Smoke tests completed. 88 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@apache apache deleted a comment from blueorangutan Jun 1, 2021
@alexandremattioli
Copy link
Contributor

LGTM

@yadvr
Copy link
Member

yadvr commented Jun 1, 2021

@blueorangutan test centos7 vmware-67u3

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests

@yadvr
Copy link
Member

yadvr commented Jun 1, 2021

@blueorangutan test centos7 xenserver-71

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + xenserver-71) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian Build Failed (tid-815)

@blueorangutan
Copy link

Trillian Build Failed (tid-814)

@blueorangutan
Copy link

Trillian test result (tid-858)
Environment: xenserver-72 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37475 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4643-t858-xenserver-72.zip
Intermittent failure detected: /marvin/tests/smoke/test_list_ids_parameter.py
Intermittent failure detected: /marvin/tests/smoke/test_volumes.py
Smoke tests completed. 88 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@blueorangutan
Copy link

Trillian test result (tid-859)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37368 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4643-t859-vmware-67u3.zip
Intermittent failure detected: /marvin/tests/smoke/test_list_ids_parameter.py
Smoke tests completed. 88 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@yadvr yadvr merged commit 083646b into master Jun 8, 2021
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.

9 participants