Skip to content

Fix Vmware to KVM migration issue - #8485

Merged
shwstppr merged 1 commit into
apache:mainfrom
shapeblue:fix-rc1-vmware-to-kvm-bug
Jan 11, 2024
Merged

Fix Vmware to KVM migration issue#8485
shwstppr merged 1 commit into
apache:mainfrom
shapeblue:fix-rc1-vmware-to-kvm-bug

Conversation

@nvazquez

Copy link
Copy Markdown
Contributor

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
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@codecov

codecovBot commented Jan 9, 2024

Copy link
Copy Markdown

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

FilesPatch %Lines
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java50.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 
FlagCoverage Δ
simulator-marvin-tests24.65% <0.00%> (+0.02%)⬆️
uitests4.39% <ø> (ø)
unit-tests16.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
Copy Markdown

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

@rajujithrajujith left a comment

Copy link
Copy Markdown
Contributor

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.

@shwstpprshwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code LGTM

@shwstpprshwstppr added this to the 4.19.0.0 milestone Jan 10, 2024

@sureshanapartisureshanaparti left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

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
Copy Markdown
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));
longsize = rootDisk.getCapacity() / Resource.ResourceType.bytesToGiB;
if (size <= 0) {
size = 1;
}
allDetails.put(VmDetailConstants.ROOT_DISK_SIZE, String.valueOf(size));

Copy link
Copy Markdown
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
Copy Markdown

[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:

TestResultTime (s)Test File
test_08_migrate_vmError43.79test_vm_life_cycle.py
test_01_verify_ipv6_vpcFailure606.29test_vpc_ipv6.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACLFailure1217.99test_vpc_redundant.py
test_05_rvpc_multi_tiersFailure699.22test_vpc_redundant.py
test_05_rvpc_multi_tiersError699.23test_vpc_redundant.py

@shwstppr

Copy link
Copy Markdown
Contributor

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

@shwstppr
shwstppr merged commit 64f4480 into apache:mainJan 11, 2024
@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 freeto 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

@nvazquez@blueorangutan@sureshanaparti@shwstppr@DaanHoogland@rajujith