Skip to content

[Vmware] Improve listing of Vmware Datacenter VMs for migration to KVM #10770

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

Open
wants to merge 6 commits into
base: 4.19
Choose a base branch
from

Conversation

nvazquez
Copy link
Contributor

@nvazquez nvazquez commented Apr 24, 2025

Description

This PR improves the listing of Vmware VMs for KVM migration tool to reduce the timeout observed while listing VMs on a datacenter. The improvement is performed in two stages:

  • First stage: Datacenter VMs listing -> use thin listing of VMs instead of obtaining all its disks and NICs (Invoke the listVmwareDcVms API setting the datacentername parameter only)
  • Second stage: When selecting a VM to import -> perform the full information retrieval of the selected VM including its disks and NICs information (Invoke the listVmwareDcVms API setting the datacentername, hostname and virtualmachinename parameter)

It was originally added by PR: #9925 but reverted as it caused unintended regression affecting the VM console access (#10634).

Fixes: #9782

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?

Tested against Vmware vCenter datacenter with 200+ VMs, listing times reduced significantly from 30 seconds to <1 second for the entire datacenter VMs

Same command time difference against the same vCenter: (time cmk list vmwaredcvms vcenter=XXXX datacentername=XXXX username=XXXX password=XXXX page=1 pagesize=10 filter=name)

Before:

real	0m35.755s
user	0m0.087s
sys	0m0.016s

After:

real	0m0.468s
user	0m0.076s
sys	0m0.013s

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

Copy link

codecov bot commented Apr 24, 2025

Codecov Report

Attention: Patch coverage is 0.86207% with 115 lines in your changes missing coverage. Please review.

Project coverage is 15.16%. Comparing base (55c8138) to head (ab29fd8).
Report is 11 commits behind head on 4.19.

Files with missing lines Patch % Lines
...in/java/com/cloud/hypervisor/vmware/mo/BaseMO.java 1.88% 52 Missing ⚠️
...d/hypervisor/vmware/manager/VmwareManagerImpl.java 0.00% 51 Missing ⚠️
...ack/api/command/admin/zone/ListVmwareDcVmsCmd.java 0.00% 9 Missing ⚠️
...a/com/cloud/hypervisor/vmware/mo/DatacenterMO.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               4.19   #10770    +/-   ##
==========================================
  Coverage     15.16%   15.16%            
- Complexity    11332    11335     +3     
==========================================
  Files          5412     5414     +2     
  Lines        475033   475197   +164     
  Branches      57963    57990    +27     
==========================================
+ Hits          72048    72073    +25     
- Misses       394930   395063   +133     
- Partials       8055     8061     +6     
Flag Coverage Δ
uitests 4.28% <ø> (-0.02%) ⬇️
unittests 15.89% <0.86%> (+<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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

@blueorangutan
Copy link

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

@nvazquez
Copy link
Contributor Author

@blueorangutan test ol8 vmware-70u3

@blueorangutan
Copy link

@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests

@Pearl1594 Pearl1594 moved this to In Progress in ACS 4.20.1 Apr 24, 2025
@blueorangutan
Copy link

[SF] Trillian test result (tid-13127)
Environment: vmware-70u3 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 79615 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10770-t13127-vmware-70u3.zip
Smoke tests completed. 127 look OK, 6 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_role_account_acls Failure 3.97 test_dynamicroles.py
test_role_account_acls_multiple_mgmt_servers Failure 3.33 test_dynamicroles.py
test_01_events_resource Error 355.18 test_events_resource.py
test_04_deploy_vm_for_other_user_and_test_vm_operations Error 122.44 test_network_permissions.py
test_01_restore_vm Error 3607.45 test_restore_vm.py
test_02_restore_vm_allocated_root Error 10.30 test_restore_vm.py
test_12_destroy_cpvm Error 6.36 test_ssvm.py
test_01_deploy_vm_on_specific_host Error 19.06 test_vm_deployment_planner.py
test_02_deploy_vm_on_specific_cluster Error 3607.06 test_vm_deployment_planner.py
test_03_deploy_vm_on_specific_pod Error 2.57 test_vm_deployment_planner.py
test_04_deploy_vm_on_host_override_pod_and_cluster Error 4.56 test_vm_deployment_planner.py
test_05_deploy_vm_on_cluster_override_pod Error 15.80 test_vm_deployment_planner.py

…/api/command/admin/zone/ListVmwareDcHostsCmd.java

Co-authored-by: Suresh Kumar Anaparti <[email protected]>
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland 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 13184

@nvazquez
Copy link
Contributor Author

@blueorangutan test ol8 vmware-70u3

@blueorangutan
Copy link

@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13159)
Environment: vmware-70u3 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 51831 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10770-t13159-vmware-70u3.zip
Smoke tests completed. 130 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_role_account_acls Failure 3.55 test_dynamicroles.py
test_role_account_acls_multiple_mgmt_servers Failure 3.54 test_dynamicroles.py
test_01_events_resource Error 320.53 test_events_resource.py
test_01_events_resource Error 320.54 test_events_resource.py
test_04_deploy_vm_for_other_user_and_test_vm_operations Error 117.94 test_network_permissions.py

Copy link
Member

@rohityadavcloud rohityadavcloud left a comment

Choose a reason for hiding this comment

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

Left one remark, otherwise LGTM - this needs testing

@nvazquez nvazquez changed the title [Vmware][UI] Fix Timeout listing Vmware Datacenter VMs for migration to KVM [Vmware] Improve listing of Vmware Datacenter VMs for migration to KVM May 5, 2025
@nvazquez
Copy link
Contributor Author

nvazquez commented May 5, 2025

Hi @sureshanaparti @DaanHoogland @rohityadavcloud I could improve the listing reducing the time significantly by excluding the disks and NICs information on the initial listing and then obtaining them when the user selects the VM (I have updated the PR description to explain the new behavior). Can you please re-review?

@nvazquez
Copy link
Contributor Author

nvazquez commented May 5, 2025

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

@nvazquez
Copy link
Contributor Author

nvazquez commented May 5, 2025

@blueorangutan test ol8 vmware-70u3

@blueorangutan
Copy link

@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + vmware-70u3) has been kicked to run smoke tests

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.

clgg,

powerState == VirtualMachinePowerState.POWERED_OFF ? UnmanagedInstanceTO.PowerState.PowerOff : UnmanagedInstanceTO.PowerState.PowerUnknown;
}

protected List<UnmanagedInstanceTO> convertVmsObjectContentsToUnmanagedInstances(List<ObjectContent> ocs, String keyword) throws Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

complexity of this method is a bit high, would be nice to modularise it a bit.

@DaanHoogland
Copy link
Contributor

as this functionality was implemented in 4.19.2 (but with side effects) and thus would be a regression if not merged, I marked this as BLOCKER.

@blueorangutan
Copy link

[SF] Trillian test result (tid-13205)
Environment: vmware-70u3 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 49843 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10770-t13205-vmware-70u3.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

[UI] Timeout listing Vmware Datacenter VMs for migration to KVM
7 participants