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

Allow VMWare import via another host #9787

Merged
merged 16 commits into from
Nov 28, 2024

Conversation

vishesh92
Copy link
Member

@vishesh92 vishesh92 commented Oct 14, 2024

Description

This PR allows importing of a VM on VMWare via another host. This is useful in cases when import in the current cluster is not possible due to different versions of virt-v2v.

Docs PR: apache/cloudstack-documentation#453

Import from VMWare to KVM consists of these steps

  1. ovf import (done by MS if ovftool is missing)
  2. virt-v2v conversion and exporting kvm image to secondary storage or primary storage
  3. import kvm image on the host

Earlier, step 2 & 3 were executed together on the destination host using a single Command from MS to Agent.

After the changes, we split the Command into 2 separate Commands.

  • Command 1 is only for conversion using virt-v2v.
  • Command 2 is only for importing the images in the destination cluster.

Now, you can select the host you want to use for the conversion which can be in a different kvm cluster from the destination cluster for the import.

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)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@vishesh92 vishesh92 force-pushed the allow-import-via-another-host branch from ea54ade to e881ee7 Compare October 14, 2024 06:11
@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 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.

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 57.79817% with 138 lines in your changes missing coverage. Please review.

Project coverage is 15.12%. Comparing base (0602f46) to head (25da9a7).
Report is 39 commits behind head on 4.19.

Files with missing lines Patch % Lines
.../LibvirtImportConvertedInstanceCommandWrapper.java 57.06% 66 Missing and 16 partials ⚠️
...loud/agent/api/ImportConvertedInstanceCommand.java 25.00% 18 Missing ⚠️
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java 79.76% 14 Missing and 3 partials ⚠️
...cloud/agent/api/ImportConvertedInstanceAnswer.java 18.18% 9 Missing ⚠️
.../wrapper/LibvirtConvertInstanceCommandWrapper.java 45.45% 5 Missing and 1 partial ⚠️
...e/cloudstack/api/command/admin/vm/ImportVmCmd.java 0.00% 3 Missing ⚠️
...ava/com/cloud/agent/api/ConvertInstanceAnswer.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19    #9787      +/-   ##
============================================
- Coverage     15.80%   15.12%   -0.68%     
- Complexity    11198    11251      +53     
============================================
  Files          5038     5407     +369     
  Lines        443852   473639   +29787     
  Branches      52578    57750    +5172     
============================================
+ Hits          70137    71655    +1518     
- Misses       365912   393986   +28074     
- Partials       7803     7998     +195     
Flag Coverage Δ
uitests 4.30% <ø> (?)
unittests 15.84% <57.79%> (+0.04%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link

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

@vishesh92
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

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

@vishesh92 vishesh92 force-pushed the allow-import-via-another-host branch from a443ef2 to 8a824de Compare October 14, 2024 18:25
@vishesh92
Copy link
Member Author

@blueorangutan package

@apache apache deleted a comment from blueorangutan Oct 14, 2024
@apache apache deleted a comment from blueorangutan Oct 14, 2024
@blueorangutan
Copy link

@vishesh92 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]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11342

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_03_secured_to_nonsecured_vm_migration Error 393.89 test_vm_life_cycle.py

@vishesh92 vishesh92 force-pushed the allow-import-via-another-host branch from 8a824de to 7c05af8 Compare October 15, 2024 06:52
@vishesh92 vishesh92 force-pushed the allow-import-via-another-host branch from 7c05af8 to 1bdc357 Compare October 15, 2024 06:54
@apache apache deleted a comment from blueorangutan Oct 15, 2024
@apache apache deleted a comment from blueorangutan Oct 15, 2024
@vishesh92 vishesh92 force-pushed the allow-import-via-another-host branch from 3054efe to 3a1cefd Compare October 15, 2024 07:31
@vishesh92 vishesh92 added this to the 4.19.2.0 milestone Oct 15, 2024
@apache apache deleted a comment from blueorangutan Oct 15, 2024
@apache apache deleted a comment from blueorangutan Oct 15, 2024
@vishesh92 vishesh92 force-pushed the allow-import-via-another-host branch from 3a1cefd to 892c045 Compare October 15, 2024 08:25
@apache apache deleted a comment from blueorangutan Oct 15, 2024
@blueorangutan
Copy link

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

@kiranchavala
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@kiranchavala 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]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11491

@vishesh92 vishesh92 force-pushed the allow-import-via-another-host branch from 872ecae to 86c61ca Compare November 11, 2024 06:26
@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 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]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11540

@kiranchavala
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File
test_04_create_template_with_checksum_md5 Error 65.80 test_templates.py
test_05_create_template_with_no_checksum Error 65.80 test_templates.py

Copy link
Contributor

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM

Tested the improvement to the vmware to kvm import which allows a different kvm in a zone with a different virt-v2v version to import the vm

Test Case Execution Result
The import vm api should work with the both parameters importinstancehostid" and "convertinstancehostid"" Pass
All the Storage pools associated with the destination cluster should be displayed Pass
Hosts which are in disabled state should work for convertinstancehostid"" Pass
Hosts which are in disabled state should fail for importinstancehostid"" Pass
Hosts which are in Maintainence state should fail for importinstancehostid" and "convertinstancehostid"" Pass
Correct Exception message should be shown if the virt-v2v tool fails Pass
zone wide storage pools should be displayed if the convert instance host and import host are different Pass
Disabled clusters should not be shownallowed for destination cluster Pass

@vishesh92 vishesh92 marked this pull request as ready for review November 18, 2024 04:55
@vishesh92
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@vishesh92 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]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11576

@vishesh92
Copy link
Member Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

Test Result Time (s) Test File

@DaanHoogland DaanHoogland merged commit 37eec06 into apache:4.19 Nov 28, 2024
25 of 26 checks passed
@DaanHoogland DaanHoogland deleted the allow-import-via-another-host branch November 28, 2024 16:50
DaanHoogland added a commit that referenced this pull request Dec 3, 2024
* 4.20:
  UI: Tooltip on the host information card to display the CPU speed in MHz and the memory value in MB (to 3 decimal places) (#9971)
  UI: Allow accounts of the `User` type to add other accounts or users to projects through UI (#9927)
  enable to create VPC portfowarding rules with source cidr (#7081)
  Add new column `last_id` to the table volumes (#9759)
  Allow VMWare import via another host (#9787)
  Linstor: add support for ISO block devices and direct download (#9792)
  get expunged VM data for job result (#9949)
  fix section divider display on auth page (#9966)
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Dec 12, 2024
Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Dec 12, 2024
* 4.20:
  UI: Tooltip on the host information card to display the CPU speed in MHz and the memory value in MB (to 3 decimal places) (apache#9971)
  UI: Allow accounts of the `User` type to add other accounts or users to projects through UI (apache#9927)
  enable to create VPC portfowarding rules with source cidr (apache#7081)
  Add new column `last_id` to the table volumes (apache#9759)
  Allow VMWare import via another host (apache#9787)
  Linstor: add support for ISO block devices and direct download (apache#9792)
  get expunged VM data for job result (apache#9949)
  fix section divider display on auth page (apache#9966)
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.

5 participants