cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

[KVM] Skip volumes on shared storage when live migrating VM with local volumes (root / datadisk)

Open GabrielBrascher opened this issue 2 years ago • 24 comments

Description

The new release Libvirt-Java v0.5.3 now supports virDomainMigrate3[1],[2], a powerful and flexible domain migrate command in Libvirt. This command allows pointing just the Root volume to be migrated, saving a lot of compute resources, network bandwidth, and time.

Likely, data disks hold TBs of data, while Root volumes hundreds of GBs. This allows saving crucial time, bandwidth, and processing.

It can easily save several hours to offload a KVM machine depending on the amount of VMs to be migrated and data disks attached to the respective VMs.

[1] Libvirt-Java [2] commit that added virtDomainMigrate3 into the Libvirt-Java Fore reference, PR https://github.com/apache/cloudstack/pull/6472 added libvirt-java v0.5.3 into CloudStack.

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)
  • [X] 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

  • [X] Major
  • [ ] Minor

Screenshots (if appropriate):

How Has This Been Tested?

Tested migration of VM with local Root (50GB) + data-disk (100GB)

  1. As an example, this is a scenario without this PR:
~# virsh domjobinfo i-2-345-VM
Job type:         Unbounded   
Operation:        Outgoing migration
Time elapsed:     17063        ms
Data processed:   2.938 GiB
Data remaining:   147.065 GiB
Data total:       150.004 GiB
File processed:   2.938 MiB
File remaining:   147.065 GiB
File total:       150.004 GiB

Data total 150.004 GiB

  1. When testing the same migration but with the changes of the PR:
~# virsh domjobinfo i-2-345-VM
Job type:         Unbounded   
Operation:        Outgoing migration
Time elapsed:     10300        ms
Data processed:   952.000 MiB
Data remaining:   49.070 GiB
Data total:       50.000 GiB
File processed:   952.000 MiB
File remaining:   49.070 GiB
File total:       50.000 GiB

Data total 50.000 GiB

GabrielBrascher avatar Jun 27 '22 12:06 GabrielBrascher

@blueorangutan package

DaanHoogland avatar Jun 27 '22 14:06 DaanHoogland

@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jun 27 '22 16:06 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_multiplication_x: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 3654

blueorangutan avatar Jun 27 '22 18:06 blueorangutan

@GabrielBrascher can you have a look on the conflicts

DaanHoogland avatar Jun 28 '22 07:06 DaanHoogland

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jun 28 '22 07:06 github-actions[bot]

@DaanHoogland I was going to fix the branch conflict but then realise that it happens on main but not on 4.17.

Do you guys feel like this would be fine to be added in 4.17.1? @harikrishna-patnala @rohityadavcloud @DaanHoogland @wido @nvazquez others Or should I target it to the main?

It could be placed as bugfix (since cloudstack migrates disks that are not desired due to Libvirt-Java 0.5.2 limitations). Could also be argued as an enhancement PR as migrations were working (but taking waaay too long).

GabrielBrascher avatar Jun 30 '22 11:06 GabrielBrascher

I see some work recently done that allows multiple volumes on local storage. I will double-check these new PRs and see potential risks as I've considered 1 local volume (root) to be mapped in the new Libvirt migration flow.

GabrielBrascher avatar Jun 30 '22 13:06 GabrielBrascher

I see some work recently done that allows multiple volumes on local storage. I will double-check these new PRs and see potential risks as I've considered 1 local volume (root) to be mapped in the new Libvirt migration flow.

so should we move this to draft, @GabrielBrascher ?

DaanHoogland avatar Jul 04 '22 10:07 DaanHoogland

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jul 13 '22 07:07 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jul 13 '22 07:07 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6509 (SL-JID-1949)

blueorangutan avatar Jul 13 '22 07:07 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jul 13 '22 07:07 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jul 13 '22 07:07 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6509 (SL-JID-1950)

blueorangutan avatar Jul 13 '22 08:07 blueorangutan

@blueorangutan package

sureshanaparti avatar Jul 13 '22 08:07 sureshanaparti

@sureshanaparti a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar Jul 13 '22 08:07 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 3760

blueorangutan avatar Jul 13 '22 08:07 blueorangutan

@GabrielBrascher Can you the fix these audit errors.

[ERROR] /jenkins/workspace/acs-centos7-pkg-builder/dist/rpmbuild/BUILD/cloudstack-4.18.0.0-SNAPSHOT/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java:27:8: Unused import - java.util.Collections. [UnusedImports]
[ERROR] /jenkins/workspace/acs-centos7-pkg-builder/dist/rpmbuild/BUILD/cloudstack-4.18.0.0-SNAPSHOT/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java:38:8: Unused import - java.util.stream.Collectors. [UnusedImports]

sureshanaparti avatar Jul 13 '22 11:07 sureshanaparti

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jul 14 '22 06:07 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jul 14 '22 06:07 blueorangutan

UI build: :heavy_check_mark: Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6509 (SL-JID-1958)

blueorangutan avatar Jul 14 '22 06:07 blueorangutan

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jul 27 '22 12:07 github-actions[bot]

Hi @GabrielBrascher, should we consider this for 4.17.1.0? Currently, it has conflicts, can you please check

shwstppr avatar Aug 03 '22 08:08 shwstppr