-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support vm dynamic scaling with kvm #4878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DaanHoogland
merged 42 commits into
apache:main
from
GutoVeronezi:support-vm-dynamic-scalling-with-kvm
Aug 21, 2021
Merged
Changes from 27 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
cbdf98f
Create utility to centralize byte convertions
425ccde
Add/change toString definitions
a6bd180
Create Libvirt handler to ScaleVmCommand
cc29fd2
Enable dynamic scalling VM with KVM
125fbc0
Move config from interface to class and rename it
3290905
Configure VM max memory and cpu cores
8e5632d
Extract dpdk configuration to a method and test it
e970e33
Extract OS desc config to a method and test it
95d7e91
Extract guest resource def to a method and test it
b4587c9
Refactor LibvirtVMDef.GuestResourceDef
e9e2149
Refactor ScaleVmCommand
52c6a4b
Improve VMInstaVO toString()
0c61e01
Refactor upgradeRunningVirtualMachine method
04fc8a4
Turn int variables into long on utility
6c157a4
Verify if VM is scalable on KVMGuru
45d5d2d
Rename some KVMGuruTest's methods
fdafc2e
Change vm's xml to work with max memory
43b7a7e
Verify if service offering is dynamic before scale
0f00590
Create methods to retrieve data from domain
f727e03
Create def to hotplug memory
984aef3
Adjust the way command was scaling the VM
8cc3b86
Fix database persistence before executing command
4ff96ba
Send more info to host to improve log
668a402
Fix var name
6d5b7c2
Merge branch 'main' into support-vm-dynamic-scalling-with-kvm
GutoVeronezi acf781c
Fix missing "}"
607dc23
Undo unnecessary changes
81176dc
Address review
7559c12
Fix scale validation
9a7abde
Add VM prepared for dynamic scaling validation
ad23d39
Refactor LibvirtScaleVmCommandWrapper and improve unit tests
dac6e7f
Merge branch 'main' into support-vm-dynamic-scalling-with-kvm
GutoVeronezi 86cfa10
Merge remote-tracking branch 'apache-github/main' into HEAD
e65db10
Remove duplicated method
4cde5e3
Add RuntimeException check
c970aa5
Merge branch 'main' into support-vm-dynamic-scalling-with-kvm
GutoVeronezi ac1f2f8
Remove copyright from header
GutoVeronezi 267ebab
Remove copyright from header
GutoVeronezi 40bb25a
Remove copyright from header
GutoVeronezi 9ab2036
Remove copyright from header
GutoVeronezi b3c65f0
Remove copyright from header
GutoVeronezi a7ad61b
Update ByteScaleUtilsTest.java
GutoVeronezi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...rvisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtVmMemoryDeviceDef.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| /* | ||
| * Copyright 2021 The Apache Software Foundation. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.cloud.hypervisor.kvm.resource; | ||
|
|
||
| /** | ||
| * Provides the XML definition to a memory device which can be hotpluged to the VM.<br/> | ||
| * Memory is provided in KiB. | ||
| * | ||
| */ | ||
| public class LibvirtVmMemoryDeviceDef { | ||
|
|
||
| private final long memorySize; | ||
|
|
||
| public LibvirtVmMemoryDeviceDef(long memorySize) { | ||
| this.memorySize = memorySize; | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| StringBuilder response = new StringBuilder(); | ||
| response.append("<memory model='dimm'>"); | ||
| response.append("<target>"); | ||
| response.append(String.format("<size unit='KiB'>%s</size>", memorySize)); | ||
| response.append("<node>0</node>"); | ||
| response.append("</target>"); | ||
| response.append("</memory>"); | ||
|
|
||
| return response.toString(); | ||
| } | ||
|
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GutoVeronezi I think that these source code headers need to be updated removing Copyright as we discussed in another PR (sorry but I forgot which one xD)