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

Fix Vmware to KVM migration issue #8485

Merged
merged 1 commit into from Jan 11, 2024

Conversation

nvazquez
Copy link
Contributor

@nvazquez nvazquez commented Jan 9, 2024

Description

This PR fixes the Vmware to KVM migration issue on main branch

Fixes: #8473

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

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?

  • Deploy mixed env Vmware + KVM zone
  • Install virt-v2v in a KVM host
  • Create VM in Vmware
  • Unmanage VM
  • Import VM selecting source hypervisor = Vmware, action = Migrate existing instances to KVM, migration host = the host with virt-v2v installed -> import succeeds

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

@nvazquez
Copy link
Contributor Author

nvazquez commented Jan 9, 2024

@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 Jan 9, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (d6ac91f) 30.74% compared to head (0afa632) 30.76%.

Files Patch % Lines
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8485      +/-   ##
============================================
+ Coverage     30.74%   30.76%   +0.01%     
- Complexity    33930    33943      +13     
============================================
  Files          5341     5341              
  Lines        374918   374918              
  Branches      54534    54534              
============================================
+ Hits         115286   115360      +74     
+ Misses       244374   244306      -68     
+ Partials      15258    15252       -6     
Flag Coverage Δ
simulator-marvin-tests 24.65% <0.00%> (+0.02%) ⬆️
uitests 4.39% <ø> (ø)
unit-tests 16.46% <50.00%> (-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.

@blueorangutan
Copy link

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

Copy link
Collaborator

@rajujith rajujith left a comment

Choose a reason for hiding this comment

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

LGTM. Migration completed without any error.

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

Code LGTM

@shwstppr shwstppr added this to the 4.19.0.0 milestone Jan 10, 2024
Copy link
Contributor

@sureshanaparti sureshanaparti left a comment

Choose a reason for hiding this comment

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

changes LGTM

@sureshanaparti
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@@ -1111,7 +1111,7 @@ private UserVm importVirtualMachineInternal(final UnmanagedInstanceTO unmanagedI
}
}
allDetails.put(VmDetailConstants.ROOT_DISK_CONTROLLER, rootDisk.getController());
if (cluster.getHypervisorType() != Hypervisor.HypervisorType.VMware) {
if (cluster.getHypervisorType() == Hypervisor.HypervisorType.KVM && isImportUnmanagedFromSameHypervisor) {
allDetails.put(VmDetailConstants.ROOT_DISK_SIZE, String.valueOf(rootDisk.getCapacity() / Resource.ResourceType.bytesToGiB));
Copy link
Contributor

Choose a reason for hiding this comment

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

@nvazquez I think we need to here make sure the minimum is 1. i.e.

Suggested change
allDetails.put(VmDetailConstants.ROOT_DISK_SIZE, String.valueOf(rootDisk.getCapacity() / Resource.ResourceType.bytesToGiB));
long size = rootDisk.getCapacity() / Resource.ResourceType.bytesToGiB;
if (size <= 0) {
size = 1;
}
allDetails.put(VmDetailConstants.ROOT_DISK_SIZE, String.valueOf(size));

Copy link
Contributor

Choose a reason for hiding this comment

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

i added this to #8488 so ignore here and now

@blueorangutan
Copy link

[SF] Trillian test result (tid-8776)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 51257 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8485-t8776-kvm-centos7.zip
Smoke tests completed. 118 look OK, 3 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 43.79 test_vm_life_cycle.py
test_01_verify_ipv6_vpc Failure 606.29 test_vpc_ipv6.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 1217.99 test_vpc_redundant.py
test_05_rvpc_multi_tiers Failure 699.22 test_vpc_redundant.py
test_05_rvpc_multi_tiers Error 699.23 test_vpc_redundant.py

@shwstppr
Copy link
Contributor

Test failures are env related with one hypervisor host remaining in connecting state

@shwstppr shwstppr merged commit 64f4480 into apache:main Jan 11, 2024
25 checks passed
@shwstppr shwstppr deleted the fix-rc1-vmware-to-kvm-bug branch January 11, 2024 06:32
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jan 12, 2024
This PR fixes the Vmware to KVM migration issue on main branch

Fixes: apache#8473
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Import instances from VMware into a KVM cluster fails
6 participants