Skip to content

Conversation

@sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Feb 17, 2025

Description

This PR adds import/migration support for external VMware VMs in any folders/subfolders other than the root folder ('vm') of datacenter, from KVM hosts (using ovftool).

Fixes #10400

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Manually tested the VMware VMs import for the VMs created in root folder ('vm'), folder & subfolder.

VMwareVmsInFolders
[root@kvm1 ~]# ps -ef|grep ovftool
root       38585   37625 54 16:54 ?        00:00:05 /root/ovftool/ovftool.bin --noSSLVerify vi://administrator%40vsphere.local:********@10.1.33.168/Trillian/vm/fd8dda05-07f1-4160-84fa-37ec42aeff0e /mnt/22fe2ce5-1e80-3af4-b1e5-05ffa3ad4e05/911923cb-e570-4ae9-b266-fc40030ad1e0/

[root@kvm1 ~]# grep "VM path" /var/log/cloudstack/agent/agent.log
2025-02-17 16:54:28,826 INFO  [resource.wrapper.LibvirtConvertInstanceCommandWrapper] (agentRequest-Handler-2:null) (logid:6c03048c) VM path: vm

[root@kvm2 ~]# ps -ef|grep ovftool
root       42230   41346 53 16:50 ?        00:00:15 /root/ovftool/ovftool.bin --noSSLVerify vi://administrator%40vsphere.local:********@10.1.33.168/Trillian/vm/MyTestFolder/Test/newvm /mnt/22fe2ce5-1e80-3af4-b1e5-05ffa3ad4e05/c28b36f7-9c55-4c67-8c5a-d139cf6fe218/

[root@kvm2 ~]# ps -ef|grep ovftool
root       42725   41346 54 16:55 ?        00:00:01 /root/ovftool/ovftool.bin --noSSLVerify vi://administrator%40vsphere.local:********@10.1.33.168/Trillian/vm/MyTestFolder/testvm /mnt/22fe2ce5-1e80-3af4-b1e5-05ffa3ad4e05/3b907bd3-2534-44ab-8ab7-3c2b7ac88688/

[root@kvm2 ~]# grep "VM path" /var/log/cloudstack/agent/agent.log
2025-02-17 16:50:26,513 INFO  [resource.wrapper.LibvirtConvertInstanceCommandWrapper] (agentRequest-Handler-4:null) (logid:1f799005) VM path: vm/MyTestFolder/Test
2025-02-17 16:55:33,977 INFO  [resource.wrapper.LibvirtConvertInstanceCommandWrapper] (agentRequest-Handler-4:null) (logid:ce3ee4ab) VM path: vm/MyTestFolder

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

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@codecov
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

Attention: Patch coverage is 2.94118% with 33 lines in your changes missing coverage. Please review.

Project coverage is 15.15%. Comparing base (212f2a3) to head (f590d14).
Report is 2 commits behind head on 4.19.

Files with missing lines Patch % Lines
...m/cloud/hypervisor/vmware/mo/VirtualMachineMO.java 0.00% 16 Missing ⚠️
.../org/apache/cloudstack/vm/UnmanagedInstanceTO.java 0.00% 6 Missing ⚠️
.../java/com/cloud/agent/api/to/RemoteInstanceTO.java 0.00% 5 Missing ⚠️
.../wrapper/LibvirtConvertInstanceCommandWrapper.java 20.00% 4 Missing ⚠️
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java 0.00% 1 Missing ⚠️
...com/cloud/hypervisor/vmware/util/VmwareHelper.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.19   #10411      +/-   ##
============================================
- Coverage     15.15%   15.15%   -0.01%     
+ Complexity    11318    11316       -2     
============================================
  Files          5413     5413              
  Lines        474670   474702      +32     
  Branches      57890    57894       +4     
============================================
- Hits          71953    71945       -8     
- Misses       394668   394711      +43     
+ Partials       8049     8046       -3     
Flag Coverage Δ
uitests 4.29% <ø> (ø)
unittests 15.87% <2.94%> (-0.01%) ⬇️

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.

@sureshanaparti sureshanaparti changed the title VMware Import - Support external VMware VMs in any folders/subfolders other than the root folder of datacenter VMware Import - Support external VMware VMs in any folders/subfolders other than the root folder of datacenter (from KVM hosts) Feb 17, 2025
@blueorangutan
Copy link

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

@apache apache deleted a comment from blueorangutan Feb 17, 2025
@apache apache deleted a comment from blueorangutan Feb 17, 2025
@sureshanaparti sureshanaparti marked this pull request as ready for review February 18, 2025 06:27
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 vmware to kvm from a external centre which has a vm inside a folder and the import was successful

root@ref-trl-7982-k-Mu24-kiran-chavala-kvm1:~# ps -ef |grep ovf
root       18670   16195 67 07:07 ?        00:00:59 /root/bin/ovftool.bin --noSSLVerify vi://Administrator%40vsphere.local:P%[email protected]/Trillian/vm/newfolder/New Virtual Machine /mnt/218f7f40-87f7-31c2-a8b1-ca376dcff488/3809aae0-1a97-4a2b-abfc-0e9841aa68e9/

root@ref-trl-7982-k-Mu24-kiran-chavala-kvm1:~# grep "VM path" /var/log/cloudstack/agent/agent.log
2025-02-18 07:07:13,762 INFO  [resource.wrapper.LibvirtConvertInstanceCommandWrapper] (agentRequest-Handler-3:null) (logid:ae63321c) VM path: vm/newfolder

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

clgtm

@DaanHoogland DaanHoogland merged commit b9ebc7b into apache:4.19 Feb 18, 2025
24 of 25 checks passed
@DaanHoogland DaanHoogland deleted the vmware-import-support-for-vms-in-folders branch February 18, 2025 08:23
DaanHoogland added a commit to shapeblue/cloudstack that referenced this pull request Feb 21, 2025
…s other than the root folder ('vm') of datacenter (apache#10411)"

This reverts commit b9ebc7b.
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
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.

VMware to KVM migration failed with error: Locator does not refer to an object

4 participants