Skip to content
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

New Feature: Import VMware VMs into KVM #7881

Merged
merged 77 commits into from Dec 7, 2023

Conversation

nvazquez
Copy link
Contributor

@nvazquez nvazquez commented Aug 19, 2023

Description

This PR adds the capability in CloudStack to convert VMware Instances disk(s) to KVM using virt-v2v and import them as CloudStack instances. It enables CloudStack operators to import VMware instances from vSphere into a KVM cluster managed by CloudStack. vSphere/VMware setup might be managed by CloudStack or be a standalone setup.

  • CloudStack will let the administrator select a VM from an existing VMware vCenter in the CloudStack environment or external vCenter requesting vCenter IP, Datacenter name and credentials.
  • The migrated VM will be imported as a KVM instance
  • The migration is done through virt-v2v: https://access.redhat.com/articles/1351473, https://www.ovirt.org/develop/release-management/features/virt/virt-v2v-integration.html
  • The migration process timeout can be set by the setting convert.instance.process.timeout
  • Before attempting the virt-v2v migration, CloudStack will create a clone of the source VM on VMware. The clone VM will be removed after the registration process finishes.
  • CloudStack will delegate the migration action to a KVM host and the host will attempt to migrate the VM invoking virt-v2v. In case the guest OS is not supported then CloudStack will handle the error operation as a failure
  • The migration process using virt-v2v may not be a fast process
  • CloudStack will not perform any check about the guest OS compatibility for the virt-v2v library as indicated on: https://access.redhat.com/articles/1351473.

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

  • Create a VMware CloudStack environment
  • Create single disk and multidisk VMs on CloudStack, start and stop them.
  • Create another KVM CloudStack environment
  • import VMs from Vmware to KVM
  • Deploy VMs

Docs PR: apache/cloudstack-documentation#342

@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a [SF] 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.

@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Merging #7881 (5784dad) into main (121531e) will decrease coverage by 9.17%.
The diff coverage is 0.61%.

@@             Coverage Diff              @@
##               main    #7881      +/-   ##
============================================
- Coverage     29.19%   20.02%   -9.17%     
+ Complexity    31015    19769   -11246     
============================================
  Files          5181     5056     -125     
  Lines        365255   344074   -21181     
  Branches      53427    49562    -3865     
============================================
- Hits         106646    68914   -37732     
- Misses       243988   265110   +21122     
+ Partials      14621    10050    -4571     
Flag Coverage Δ
simulator-marvin-tests 21.40% <0.77%> (-3.76%) ⬇️
uitests 4.47% <0.00%> (-0.03%) ⬇️
unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...main/java/com/cloud/hypervisor/HypervisorGuru.java 100.00% <ø> (ø)
...n/java/org/apache/cloudstack/api/ApiConstants.java 40.90% <ø> (ø)
...udstack/api/response/VmwareDatacenterResponse.java 0.00% <ø> (ø)
...rc/main/java/com/cloud/storage/StorageManager.java 80.64% <100.00%> (-16.03%) ⬇️
...src/main/java/com/cloud/dc/VmwareDatacenterVO.java 7.89% <ø> (ø)
...hypervisor/vmware/dao/VmwareDatacenterDaoImpl.java 54.54% <ø> (ø)
...ain/java/com/cloud/storage/StorageManagerImpl.java 21.81% <ø> (-4.07%) ⬇️
ui/src/components/widgets/TooltipLabel.vue 100.00% <ø> (ø)
...va/com/cloud/agent/properties/AgentProperties.java 0.00% <0.00%> (ø)
ui/src/views/compute/DeployVM.vue 0.00% <0.00%> (ø)
... and 24 more

... and 1583 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6830

@nvazquez
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-7480)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 46813 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7881-t7480-kvm-centos7.zip
Smoke tests completed. 110 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestISOUsage>:setup Error 0.00 test_usage.py
test_01_template_usage Error 12.41 test_usage.py
test_02_upgrade_kubernetes_cluster Failure 541.70 test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_cluster Failure 847.20 test_kubernetes_clusters.py
test_01_create_template Error 12.41 test_templates.py
test_CreateTemplateWithDuplicateName Error 22.73 test_templates.py
test_03_delete_template Error 1.07 test_templates.py

@github-actions
Copy link

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

@nvazquez nvazquez changed the title [WIP] New Feature: Register KVM templates from migrated VMware VM [WIP] New Feature: Migrate VMware VMs to KVM Aug 24, 2023
@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a [SF] 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
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6874

@nvazquez
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a [SL] 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
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7900

Copy link

github-actions bot commented Dec 4, 2023

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

@nvazquez
Copy link
Contributor Author

nvazquez commented Dec 4, 2023

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a [SL] 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.

@andrijapanicsb andrijapanicsb marked this pull request as ready for review December 6, 2023 10:51
Copy link
Contributor

@andrijapanicsb andrijapanicsb left a comment

Choose a reason for hiding this comment

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

LGTM after review and manual testing

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM, manually tested it

Copy link
Contributor

@NuxRo NuxRo left a comment

Choose a reason for hiding this comment

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

LGTM

@nvazquez
Copy link
Contributor Author

nvazquez commented Dec 6, 2023

@blueorangutan package

@DaanHoogland
Copy link
Contributor

@shwstppr , i think we are done here

@shwstppr
Copy link
Contributor

shwstppr commented Dec 6, 2023

@DaanHoogland yes but the last test run is from 7 days back. Should we run a new round and merge tomorrow if all is good?

@shwstppr
Copy link
Contributor

shwstppr commented Dec 6, 2023

@blueorangutan package

@blueorangutan
Copy link

@shwstppr a [SL] 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
Copy link

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7948

@shwstppr
Copy link
Contributor

shwstppr commented Dec 6, 2023

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-8489)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 46383 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7881-t8489-kvm-centos7.zip
Smoke tests completed. 120 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_08_migrate_vm Error 0.06 test_vm_life_cycle.py

@shwstppr shwstppr merged commit 371ad9f into apache:main Dec 7, 2023
24 of 26 checks passed
@apache apache deleted a comment from shwstppr Dec 7, 2023
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Dec 11, 2023
This PR adds the capability in CloudStack to convert VMware Instances disk(s) to KVM using virt-v2v and import them as CloudStack instances. It enables CloudStack operators to import VMware instances from vSphere into a KVM cluster managed by CloudStack. vSphere/VMware setup might be managed by CloudStack or be a standalone setup.

    CloudStack will let the administrator select a VM from an existing VMware vCenter in the CloudStack environment or external vCenter requesting vCenter IP, Datacenter name and credentials.
    The migrated VM will be imported as a KVM instance
    The migration is done through virt-v2v: https://access.redhat.com/articles/1351473, https://www.ovirt.org/develop/release-management/features/virt/virt-v2v-integration.html
    The migration process timeout can be set by the setting convert.instance.process.timeout
    Before attempting the virt-v2v migration, CloudStack will create a clone of the source VM on VMware. The clone VM will be removed after the registration process finishes.
    CloudStack will delegate the migration action to a KVM host and the host will attempt to migrate the VM invoking virt-v2v. In case the guest OS is not supported then CloudStack will handle the error operation as a failure
    The migration process using virt-v2v may not be a fast process
    CloudStack will not perform any check about the guest OS compatibility for the virt-v2v library as indicated on: https://access.redhat.com/articles/1351473.
shwstppr pushed a commit to apache/cloudstack-documentation that referenced this pull request Jan 17, 2024
Documentation for Import VMware VMs into KVM PR: apache/cloudstack#7881
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.

None yet

8 participants