Skip to content

New feature: Resource count (CPU/RAM) take only running vms into calculation#3760

Merged
DaanHoogland merged 3 commits into
apache:masterfrom
ustcweizhou:4.14.0-resource-count-running-vms-only
Jan 30, 2020
Merged

New feature: Resource count (CPU/RAM) take only running vms into calculation#3760
DaanHoogland merged 3 commits into
apache:masterfrom
ustcweizhou:4.14.0-resource-count-running-vms-only

Conversation

@ustcweizhou
Copy link
Copy Markdown
Contributor

Description

Stopped VMs do not use CPU/RAM actually.
A new global configuration resource.count.running.vms.only is added to determine whether resource (cpu/memory) of only running vms (including Starting/Stopping) will be taken into calculation of resource consumption.

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?

all testing in test/integration/component/test_resource_count_running_vms.py passed, including
deploy/start/stop/reboot a vm
update a vm with displayvm
destroy/expunge vm

tested with resource.count.running.vms.only is true and false both.

Two issues found in the testing: #3758 #3759

@luhaijiao
Copy link
Copy Markdown

This is introducing a flexible way to calculate the resource only for running VMs. It's particulalry useful for some customer senario, e.g. quota calculation.

Thanks weizhou !

@svenvogel
Copy link
Copy Markdown
Contributor

@weizhouapache nice feature. its good to get the calculation in a better state.

@andrijapanicsb
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@andrijapanicsb 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-528

@andrijapanicsb
Copy link
Copy Markdown
Contributor

@blueorangutan test

@wido wido self-requested a review January 15, 2020 20:21
Copy link
Copy Markdown
Contributor

@wido wido left a comment

Choose a reason for hiding this comment

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

LGTM based on code

@blueorangutan
Copy link
Copy Markdown

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

@andrijapanicsb
Copy link
Copy Markdown
Contributor

wow, it only took 2 days for the monkey to kick the tests... nice

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-780)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 40049 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3760-t780-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 76 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_hostha_enable_ha_when_host_in_maintenance Error 303.51 test_hostha_kvm.py

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 28, 2020

@ustcweizhou can you fix the merge conflict?

@ustcweizhou ustcweizhou force-pushed the 4.14.0-resource-count-running-vms-only branch from 6e7b7a5 to 1412acd Compare January 28, 2020 09:34
@weizhouapache
Copy link
Copy Markdown
Member

@rhtyd rebased with latest master

@yadvr yadvr closed this Jan 29, 2020
@yadvr yadvr reopened this Jan 29, 2020
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 29, 2020

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rhtyd 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-688

Copy link
Copy Markdown
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.

good code with tests added. work to Wei standard! standard style remark; big methods are getting bigger, no biggy (in this case)

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

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

@apache apache deleted a comment from blueorangutan Jan 29, 2020
@apache apache deleted a comment from blueorangutan Jan 29, 2020
@blueorangutan
Copy link
Copy Markdown

Packaging result: ✖centos6 ✔centos7 ✔debian. JID-698

@DaanHoogland
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

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

@blueorangutan
Copy link
Copy Markdown

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

Test Result Time (s) Test File

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 30, 2020

@ustcweizhou can you check the one failing Travis test?

…ce consumption of only running vms

Stopped VMs do not use CPU/RAM actually.
A new global configuration resource.count.running.vms.only is added to determine whether resource (cpu/memory) of only running vms (including Starting/Stopping) will be taken into calculation of resource consumption.
@ustcweizhou ustcweizhou force-pushed the 4.14.0-resource-count-running-vms-only branch from 1412acd to c8b1f38 Compare January 30, 2020 08:23
@weizhouapache
Copy link
Copy Markdown
Member

@rhtyd
rebased with latest master
let's see if travis test fails again.

@DaanHoogland
Copy link
Copy Markdown
Contributor

all travis failures are long logs. merging

@DaanHoogland DaanHoogland merged commit ac581d1 into apache:master Jan 30, 2020
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 30, 2020

@ustcweizhou a new marvin test was added to component, if it's a fast tests (doesn't take time to run) - please move to smoke and also add it to .travis.yml cc @DaanHoogland

@DaanHoogland
Copy link
Copy Markdown
Contributor

@rhtyd we already suffer from failures due to long logs. I think we must skim the load we lay on travis. (someday soon)

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 30, 2020

@DaanHoogland tests added to component are not run by default, so it's like not adding the test in the first place. A new job runner/block can be easily added to Travis. We've like 20 odd jobs/runs per PR.

@DaanHoogland
Copy link
Copy Markdown
Contributor

we are using 18. is 20 the maximum that you know, @rhtyd ? I would like to see each test run for each change, but that may be too costly.

ustcweizhou added a commit to ustcweizhou/cloudstack that referenced this pull request Feb 28, 2020
…ulation (apache#3760)

* marvin: check resource count of more types

* New feature: add flag resource.count.running.vms.only to count resource consumption of only running vms

Stopped VMs do not use CPU/RAM actually.
A new global configuration resource.count.running.vms.only is added to determine whether resource (cpu/memory) of only running vms (including Starting/Stopping) will be taken into calculation of resource consumption.

* Add integration test for resource count of only running vms
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