-
Notifications
You must be signed in to change notification settings - Fork 1.2k
KVM live storage migration intra cluster from NFS source and destination #2983
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
KVM live storage migration intra cluster from NFS source and destination #2983
Conversation
...tion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
Outdated
Show resolved
Hide resolved
...tion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
Show resolved
Hide resolved
...rc/test/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapperTest.java
Show resolved
Hide resolved
DaanHoogland
left a comment
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.
looks good overall, some comments. A biggy is; there is no integration test. That would seem needed for a functional change like this. @nvazquez /cc @rhtyd @borisstoyanov ?
| public boolean executeInSequence() { | ||
| return false; | ||
| } | ||
| } No newline at end of file |
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.
Add a newline here :)
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.
Done, thanks
|
|
||
| -- PR#1448 update description of 'execute.in.sequence.network.element.commands' parameter to reflect an unused command that has been removed. The removed class command is 'UserDataCommand'. | ||
| update `cloud`.`configuration` set description = 'If set to true, DhcpEntryCommand, SavePasswordCommand, VmDataCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is false.' where name = 'execute.in.sequence.network.element.commands'; | ||
| update `cloud`.`configuration` set description = 'If set to true, DhcpEntryCommand, SavePasswordCommand, VmDataCommand will be synchronized on the agent side. If set to false, these commands become asynchronous. Default value is false.' where name = 'execute.in.sequence.network.element.commands'; |
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.
Update by accident of this file?
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.
Had previously included an update sql on the hypervisor_cappabilities to enable live storage motion on KVM. But due to conflicting versions on qemu just decided to remove it and must have removed an end of line or extra space, will sort it out
|
|
||
| private String getQemuImgPathScript = String.format("which %s >& /dev/null; " + | ||
| "if [ $? -gt 0 ]; then echo \"%s\"; else echo \"%s\"; fi", | ||
| cloudQemuImgPath, _qemuImgPath, cloudQemuImgPath); |
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.
We have a Qemu utility in the KVM code, can't we offload this there?
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.
As this feature requires qemu-img command supporting snapshots I have introduced this check. This cloud-qemu-img can be included on KVM hosts to support snapshots as per: http://www.nux.ro/oldblog/archive/2014/01/Taking_KVM_volume_snapshots_with_Cloudstack_4_2_on_CentOS_6_5.html
If cloud-qemu-img is present then we can use it, and if not just qemu-img. It is also done this way on scripts: https://github.com/apache/cloudstack/search?q=cloud-qemu-img&unscoped_q=cloud-qemu-img.
|
|
||
| /* The qemu-img binary. We expect this to be in $PATH */ | ||
| public String _qemuImgPath = "qemu-img"; | ||
| private String cloudQemuImgPath = "cloud-qemu-img"; |
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.
This binary does not exist on Ubuntu/Debian. Why the name change?
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.
Just to make sure it works with snapshot support. If the binary is present on the KVM host it will be used, and if not just the qemu-img.
|
Thanks @wido @DaanHoogland for reviewing, I'll address your comments soon. Along with @borisstoyanov we'll be adding integration tests on this PR. |
|
Feature specification link added to the PR description |
|
@nvazquez Hi Nicolas - Just an FYI that I plan to look at this tomorrow. |
|
Thanks @mike-tutkowski that's great |
mike-tutkowski
left a comment
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.
This looks good. I just had the one comment on the code.
...tion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
Show resolved
Hide resolved
...tion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java
Show resolved
Hide resolved
borisstoyanov
left a comment
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.
@nvazquez, I think this one is missing the marvin tests we created in the private repo
50de309 to
5439cf3
Compare
5439cf3 to
224b74d
Compare
|
@blueorangutan package |
1 similar comment
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2856 |
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3662)
|
|
@nvazquez can you check the |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2864 |
|
@blueorangutan package |
|
@nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2865 |
|
@blueorangutan test |
|
@nvazquez a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-3669)
|
|
@rhtyd marvin test failure fixed, now all tests are passing |
Considering that we have addressed a considerable effort on allowing KVM to perform storage data motion, this PR proposes updating the 'hypervisor_capabilities' table setting the 'storage_motion_supported' to '1' for KVM. PRs that implemented KVM storage motion features: Non-managed storages apache#2997 KVM VM live migration with ROOT volume on file storage type apache#2983 KVM live storage migration intra cluster from NFS source and destination Managed storages apache#2298 CLOUDSTACK-9620: Enhancements for managed storage Signed-off-by: Rohit Yadav <[email protected]>
- Removes CentOS6/el6 packaging (voting thread reference https://markmail.org/message/u3ka4hwn2lzwiero) - Add upgrade path from 4.13 to 4.14 - Enable live storage migration support for KVM by default as el6 is deprecated - PRs using live storage migration #2997 KVM VM live migration with ROOT volume on file storage type #2983 KVM live storage migration intra cluster from NFS source and destination #2298 CLOUDSTACK-9620: Enhancements for managed storage Signed-off-by: Rohit Yadav <[email protected]>
Description
Feature Specification: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=95653548
Live storage migration on KVM under these conditions:
In order to enable this functionality, database should be updated in order to enable live storage capacibilty for KVM, if previous conditions are met. This is due to existing conflicts between qemu and libvirt versions. This has been tested on CentOS 6 hosts.
Additional notes:
storage_motion_supported=1in the hypervisor_capability table for KVM. This is done by default as the feature may not work in some environments, read below.On CentOS7 the error we see is:
" error: unable to execute QEMU command 'migrate': this feature or command is not currently supported"(reference https://ask.openstack.org/en/question/94186/live-migration-unable-to-execute-qemu-command-migrate/). Reading through various lists looks like the migrate feature with qemu may be available with paid versions of RHEL-EV but not centos7 however this works with CentOS6.Fix for CentOS 7:
yum install qemu-kvm-common-ev-2.3.0-29.1.el7.x86_64 qemu-kvm-ev-2.3.0-29.1.el7.x86_64 qemu-img-ev-2.3.0-29.1.el7.x86_64Types of changes
Screenshots (if appropriate):
How Has This Been Tested?
Tested on environment having 2 KVM CentOS 6 hosts.
Note: CentOS 7 hosts report an issue around qemu version:
org.libvirt.LibvirtException: internal error: unable to execute QEMU command 'migrate': this feature or command is not currently supportedFix for CentOS 7:
yum install qemu-kvm-common-ev-2.3.0-29.1.el7.x86_64 qemu-kvm-ev-2.3.0-29.1.el7.x86_64 qemu-img-ev-2.3.0-29.1.el7.x86_64