Skip to content

Fix KVM import and list unmanaged VMs - #8445

Merged
shwstppr merged 2 commits into
apache:mainfrom
storpool:fix-vm-ingestion
Jan 10, 2024
Merged

Fix KVM import and list unmanaged VMs#8445
shwstppr merged 2 commits into
apache:mainfrom
storpool:fix-vm-ingestion

Conversation

@slavkap

@slavkapslavkap commented Jan 4, 2024

Copy link
Copy Markdown
Contributor

Description

This PR fixes part (issues 2 and3) of #8439 and depends on #8433

1 - Fix of VM insert for VMs with StorPool volumes
2 - Fix of the list/insert unmanaged VMs with RBD volumes

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

manually tested

@codecov

codecovBot commented Jan 4, 2024

Copy link
Copy Markdown

Codecov Report

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

Comparison is base (d6ac91f) 30.74% compared to head (8921119) 22.98%.
Report is 3 commits behind head on main.

FilesPatch %Lines
...er/LibvirtGetUnmanagedInstancesCommandWrapper.java0.00%11 Missing ⚠️
.../apache/cloudstack/vm/UnmanagedVMsManagerImpl.java0.00%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #8445 +/- ##
============================================
- Coverage 30.74% 22.98% -7.77% + Complexity 33930 23732 -10198 
============================================
Files 5341 5209 -132 Lines 374918 352870 -22048 Branches 54534 50543 -3991 ============================================
- Hits 115286 81100 -34186 - Misses 244374 260108 +15734 + Partials 15258 11662 -3596 
FlagCoverage Δ
simulator-marvin-tests24.62% <0.00%> (-0.01%)⬇️
uitests4.39% <ø> (ø)
unit-tests?

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.

@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr 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
Copy Markdown

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

@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@shwstpprshwstppr added this to the 4.19.0.0 milestone Jan 5, 2024
@blueorangutan

Copy link
Copy Markdown

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

TestResultTime (s)Test File
test_02_trigger_shutdownFailure336.70test_safe_shutdown.py
test_07_deploy_kubernetes_ha_clusterFailure3611.63test_kubernetes_clusters.py
test_08_upgrade_kubernetes_ha_clusterFailure0.04test_kubernetes_clusters.py
test_09_delete_kubernetes_ha_clusterFailure0.04test_kubernetes_clusters.py
test_10_vpc_tier_kubernetes_clusterFailure42.62test_kubernetes_clusters.py
ContextSuite context=TestKubernetesCluster>:teardownError90.87test_kubernetes_clusters.py

pools.addAll(primaryDataStoreDao.listByDataCenterId(zone.getId()));
for (StoragePool pool : pools) {
if (pool.getPath().endsWith(dsName)) {
if (StringUtils.containsAny(pool.getPath(), dsName, dsPath)) {

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.

aren't we replacing a bug with a bug here (nitpicking maybe but genuine question)
path.endswith("bla") is different from StringUtils.containsAny(path, "bla", "blob")
considder paths:

  • "bla/blah"
  • "bla/blob"
  • "bla/bleb"
    Neither would match the first condition, and though the first is supposed to match the second condition (as I understand) the other two seem false positives to me.

Am I misinterpreting this @slavkap ?

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.

Adding to @DaanHoogland's comment, perhaps we can add a condition to keep the current check for non RBD disks? Raising a concern since the Vmware import of unmanaged instances uses the same code

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

thanks @DaanHoogland, @nvazquez! I've changed it to check only path vs dsPath. Neither for KVM/VMware we need to check for the datastore name in the primary storage path

pools.addAll(primaryDataStoreDao.listByDataCenterId(zone.getId()));
for (StoragePool pool : pools) {
if (pool.getPath().endsWith(dsName)) {
if (StringUtils.containsAny(pool.getPath(), dsName, dsPath)) {

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.

Adding to @DaanHoogland's comment, perhaps we can add a condition to keep the current check for non RBD disks? Raising a concern since the Vmware import of unmanaged instances uses the same code

@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

1 - Fix of VM insert for VMs with StorPool volumes
2 - Fix of list/insert unmanaged VMs with RBD volumes
@blueorangutan

Copy link
Copy Markdown

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

Chech if the pool path contains the datastore path. There is no need to
check for the datastore name because for VMware it get the datastore
UUID which isn't relevant with the primary storage path in CS
@nvazquez

Copy link
Copy Markdown
Contributor

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

@blueorangutan

Copy link
Copy Markdown

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

@nvazqueznvazquez 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 - tested OK on a mixed Vmware+KVM env and observe no regressions on KVM or Vmware import

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

clgtm and did similar tests to @nvazquez (not well communicated but very well tested.) of course we might have missed some corner cases still. Let's merge however.

@shwstppr
shwstppr merged commit c569fe9 into apache:mainJan 10, 2024
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jan 12, 2024
VM import fixes
1 - Fix of VM insert for VMs with StorPool volumes
2 - Fix of list/insert unmanaged VMs with RBD volumes
@sureshanapartisureshanaparti mentioned this pull request Feb 28, 2024
Sign up for freeto 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

@slavkap@shwstppr@blueorangutan@nvazquez@DaanHoogland