{"action":"closed","number":2482,"pull_request":{"url":"https://api.github.com/repos/apache/cloudstack/pulls/2482","id":173776764,"html_url":"https://github.com/apache/cloudstack/pull/2482","diff_url":"https://github.com/apache/cloudstack/pull/2482.diff","patch_url":"https://github.com/apache/cloudstack/pull/2482.patch","issue_url":"https://api.github.com/repos/apache/cloudstack/issues/2482","number":2482,"state":"closed","locked":false,"title":"CLOUDSTACK-10321: CPU Cap for KVM","user":{"login":"nvazquez","id":5295080,"avatar_url":"https://avatars2.githubusercontent.com/u/5295080?v=4","gravatar_id":"","url":"https://api.github.com/users/nvazquez","html_url":"https://github.com/nvazquez","followers_url":"https://api.github.com/users/nvazquez/followers","following_url":"https://api.github.com/users/nvazquez/following{/other_user}","gists_url":"https://api.github.com/users/nvazquez/gists{/gist_id}","starred_url":"https://api.github.com/users/nvazquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvazquez/subscriptions","organizations_url":"https://api.github.com/users/nvazquez/orgs","repos_url":"https://api.github.com/users/nvazquez/repos","events_url":"https://api.github.com/users/nvazquez/events{/privacy}","received_events_url":"https://api.github.com/users/nvazquez/received_events","type":"User","site_admin":false},"body":"JIRA Ticket: https://issues.apache.org/jira/browse/CLOUDSTACK-10321\r\n\r\n## Context\r\nLibvirt has the concept of a 'period' and a 'quota'. If the period is 10000 microseconds, a quote can be set, say 5000 and the VM CPU will be limited to only using 5000 microseconds of CPU every 10000 microseconds. \r\nThis patch basically looks at the host CPU MHz (say 2000 MHz), looks at the VM's configured MHz (say 500 MHz), comes up with a percent (25%), then uses that against the period to come up with a quota number (2500). Additionally, it only applies appropriately when the service offering has the CPU cap option set/checkmarked.\r\n\r\n## Solution\r\nThese changes are restricted to the KVM hypervisor plugin, where creation of a VM (spec) will consider CPU cap (max speed) defined in the service offering to define and set quota/limits in the VM’s spec. This will set quota based on a fixed/pre-defined period value, and add respective flag/nodes in the VM/domain XML as documented here: https://libvirt.org/formatdomain.html#elementsCPUTuning \r\n\r\n## Behavior\r\n- Setting the CPU cap option on a service offering must cause the VM created with that CPU offering, to run at the MHz value set until the core it is running on becomes contended (under KVM)\r\n- If the CPU cap option is set in a service offering and the core that a VM is running on becomes contended, then (under KVM) the VM should receive the appropriate MHz according to its and the other VMs MHz values translated as 'shares' values.  (this is the current behaviour for contended and uncontended cores).","created_at":"2018-03-08T16:04:42Z","updated_at":"2018-03-14T18:21:25Z","closed_at":"2018-03-14T18:21:25Z","merged_at":"2018-03-14T18:21:25Z","merge_commit_sha":"74db647dbbaa224ffa5667a3203d53f48532d072","assignee":null,"assignees":[],"requested_reviewers":[{"login":"DaanHoogland","id":2486961,"avatar_url":"https://avatars1.githubusercontent.com/u/2486961?v=4","gravatar_id":"","url":"https://api.github.com/users/DaanHoogland","html_url":"https://github.com/DaanHoogland","followers_url":"https://api.github.com/users/DaanHoogland/followers","following_url":"https://api.github.com/users/DaanHoogland/following{/other_user}","gists_url":"https://api.github.com/users/DaanHoogland/gists{/gist_id}","starred_url":"https://api.github.com/users/DaanHoogland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaanHoogland/subscriptions","organizations_url":"https://api.github.com/users/DaanHoogland/orgs","repos_url":"https://api.github.com/users/DaanHoogland/repos","events_url":"https://api.github.com/users/DaanHoogland/events{/privacy}","received_events_url":"https://api.github.com/users/DaanHoogland/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/apache/cloudstack/milestones/5","html_url":"https://github.com/apache/cloudstack/milestone/5","labels_url":"https://api.github.com/repos/apache/cloudstack/milestones/5/labels","id":3033298,"number":5,"title":"4.11.1.0","description":"Milestone covering PRs for the next 4.11.1.0 release. All PRs using this milestone should send PR against the 4.11 branch.","creator":{"login":"DaanHoogland","id":2486961,"avatar_url":"https://avatars1.githubusercontent.com/u/2486961?v=4","gravatar_id":"","url":"https://api.github.com/users/DaanHoogland","html_url":"https://github.com/DaanHoogland","followers_url":"https://api.github.com/users/DaanHoogland/followers","following_url":"https://api.github.com/users/DaanHoogland/following{/other_user}","gists_url":"https://api.github.com/users/DaanHoogland/gists{/gist_id}","starred_url":"https://api.github.com/users/DaanHoogland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaanHoogland/subscriptions","organizations_url":"https://api.github.com/users/DaanHoogland/orgs","repos_url":"https://api.github.com/users/DaanHoogland/repos","events_url":"https://api.github.com/users/DaanHoogland/events{/privacy}","received_events_url":"https://api.github.com/users/DaanHoogland/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":24,"state":"open","created_at":"2018-01-13T20:06:17Z","updated_at":"2018-03-14T18:21:25Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/apache/cloudstack/pulls/2482/commits","review_comments_url":"https://api.github.com/repos/apache/cloudstack/pulls/2482/comments","review_comment_url":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cloudstack/issues/2482/comments","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/bcea7d6593b4b021ec6cb607f4df6e69dbd6654a","head":{"label":"shapeblue:cpucapkvm","ref":"cpucapkvm","sha":"bcea7d6593b4b021ec6cb607f4df6e69dbd6654a","user":{"login":"shapeblue","id":6001764,"avatar_url":"https://avatars1.githubusercontent.com/u/6001764?v=4","gravatar_id":"","url":"https://api.github.com/users/shapeblue","html_url":"https://github.com/shapeblue","followers_url":"https://api.github.com/users/shapeblue/followers","following_url":"https://api.github.com/users/shapeblue/following{/other_user}","gists_url":"https://api.github.com/users/shapeblue/gists{/gist_id}","starred_url":"https://api.github.com/users/shapeblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shapeblue/subscriptions","organizations_url":"https://api.github.com/users/shapeblue/orgs","repos_url":"https://api.github.com/users/shapeblue/repos","events_url":"https://api.github.com/users/shapeblue/events{/privacy}","received_events_url":"https://api.github.com/users/shapeblue/received_events","type":"Organization","site_admin":false},"repo":{"id":35481491,"name":"cloudstack","full_name":"shapeblue/cloudstack","owner":{"login":"shapeblue","id":6001764,"avatar_url":"https://avatars1.githubusercontent.com/u/6001764?v=4","gravatar_id":"","url":"https://api.github.com/users/shapeblue","html_url":"https://github.com/shapeblue","followers_url":"https://api.github.com/users/shapeblue/followers","following_url":"https://api.github.com/users/shapeblue/following{/other_user}","gists_url":"https://api.github.com/users/shapeblue/gists{/gist_id}","starred_url":"https://api.github.com/users/shapeblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shapeblue/subscriptions","organizations_url":"https://api.github.com/users/shapeblue/orgs","repos_url":"https://api.github.com/users/shapeblue/repos","events_url":"https://api.github.com/users/shapeblue/events{/privacy}","received_events_url":"https://api.github.com/users/shapeblue/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shapeblue/cloudstack","description":"The upstream repository is at http://github.com/apache/cloudstack. This is ShapeBlue's support/patch branches and Apache CloudStack™ backup","fork":true,"url":"https://api.github.com/repos/shapeblue/cloudstack","forks_url":"https://api.github.com/repos/shapeblue/cloudstack/forks","keys_url":"https://api.github.com/repos/shapeblue/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shapeblue/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shapeblue/cloudstack/teams","hooks_url":"https://api.github.com/repos/shapeblue/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/shapeblue/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/shapeblue/cloudstack/events","assignees_url":"https://api.github.com/repos/shapeblue/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/shapeblue/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/shapeblue/cloudstack/tags","blobs_url":"https://api.github.com/repos/shapeblue/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shapeblue/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shapeblue/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/shapeblue/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shapeblue/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/shapeblue/cloudstack/languages","stargazers_url":"https://api.github.com/repos/shapeblue/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/shapeblue/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/shapeblue/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/shapeblue/cloudstack/subscription","commits_url":"https://api.github.com/repos/shapeblue/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/shapeblue/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/shapeblue/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/shapeblue/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/shapeblue/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/shapeblue/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shapeblue/cloudstack/merges","archive_url":"https://api.github.com/repos/shapeblue/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shapeblue/cloudstack/downloads","issues_url":"https://api.github.com/repos/shapeblue/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/shapeblue/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/shapeblue/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/shapeblue/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shapeblue/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/shapeblue/cloudstack/releases{/id}","deployments_url":"https://api.github.com/repos/shapeblue/cloudstack/deployments","created_at":"2015-05-12T10:22:21Z","updated_at":"2016-12-08T09:26:57Z","pushed_at":"2018-03-13T17:23:32Z","git_url":"git://github.com/shapeblue/cloudstack.git","ssh_url":"git@github.com:shapeblue/cloudstack.git","clone_url":"https://github.com/shapeblue/cloudstack.git","svn_url":"https://github.com/shapeblue/cloudstack","homepage":"http://shapeblue.com/packages","size":533915,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":3,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"apache:4.11","ref":"4.11","sha":"da8cf8c3703178b0570ae34b5f5338dd704b8c73","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":9759448,"name":"cloudstack","full_name":"apache/cloudstack","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/cloudstack","description":"Mirror of Apache Cloudstack","fork":false,"url":"https://api.github.com/repos/apache/cloudstack","forks_url":"https://api.github.com/repos/apache/cloudstack/forks","keys_url":"https://api.github.com/repos/apache/cloudstack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cloudstack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cloudstack/teams","hooks_url":"https://api.github.com/repos/apache/cloudstack/hooks","issue_events_url":"https://api.github.com/repos/apache/cloudstack/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cloudstack/events","assignees_url":"https://api.github.com/repos/apache/cloudstack/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cloudstack/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cloudstack/tags","blobs_url":"https://api.github.com/repos/apache/cloudstack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cloudstack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cloudstack/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cloudstack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cloudstack/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cloudstack/languages","stargazers_url":"https://api.github.com/repos/apache/cloudstack/stargazers","contributors_url":"https://api.github.com/repos/apache/cloudstack/contributors","subscribers_url":"https://api.github.com/repos/apache/cloudstack/subscribers","subscription_url":"https://api.github.com/repos/apache/cloudstack/subscription","commits_url":"https://api.github.com/repos/apache/cloudstack/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cloudstack/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cloudstack/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cloudstack/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cloudstack/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cloudstack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cloudstack/merges","archive_url":"https://api.github.com/repos/apache/cloudstack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cloudstack/downloads","issues_url":"https://api.github.com/repos/apache/cloudstack/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cloudstack/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cloudstack/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cloudstack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cloudstack/labels{/name}","releases_url":"https://api.github.com/repos/apache/cloudstack/releases{/id}","deployments_url":"https://api.github.com/repos/apache/cloudstack/deployments","created_at":"2013-04-29T22:27:12Z","updated_at":"2018-03-14T09:45:34Z","pushed_at":"2018-03-14T18:21:25Z","git_url":"git://github.com/apache/cloudstack.git","ssh_url":"git@github.com:apache/cloudstack.git","clone_url":"https://github.com/apache/cloudstack.git","svn_url":"https://github.com/apache/cloudstack","homepage":null,"size":521137,"stargazers_count":547,"watchers_count":547,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":610,"mirror_url":null,"archived":false,"open_issues_count":114,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":610,"open_issues":114,"watchers":547,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/2482"},"html":{"href":"https://github.com/apache/cloudstack/pull/2482"},"issue":{"href":"https://api.github.com/repos/apache/cloudstack/issues/2482"},"comments":{"href":"https://api.github.com/repos/apache/cloudstack/issues/2482/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/2482/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cloudstack/pulls/2482/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cloudstack/statuses/bcea7d6593b4b021ec6cb607f4df6e69dbd6654a"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"DaanHoogland","id":2486961,"avatar_url":"https://avatars1.githubusercontent.com/u/2486961?v=4","gravatar_id":"","url":"https://api.github.com/users/DaanHoogland","html_url":"https://github.com/DaanHoogland","followers_url":"https://api.github.com/users/DaanHoogland/followers","following_url":"https://api.github.com/users/DaanHoogland/following{/other_user}","gists_url":"https://api.github.com/users/DaanHoogland/gists{/gist_id}","starred_url":"https://api.github.com/users/DaanHoogland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaanHoogland/subscriptions","organizations_url":"https://api.github.com/users/DaanHoogland/orgs","repos_url":"https://api.github.com/users/DaanHoogland/repos","events_url":"https://api.github.com/users/DaanHoogland/events{/privacy}","received_events_url":"https://api.github.com/users/DaanHoogland/received_events","type":"User","site_admin":false},"comments":31,"review_comments":13,"maintainer_can_modify":false,"commits":4,"additions":419,"deletions":3,"changed_files":7}}
{"actor":{"display_login":"DaanHoogland"}}