Skip to content

KVM: Option to deploy a VM with existing volume/snapshot - #10503

Merged
sureshanaparti merged 8 commits into
apache:mainfrom
storpool:deploy-vm-with-existing-volume-or-snapshot
Jul 14, 2025
Merged

KVM: Option to deploy a VM with existing volume/snapshot#10503
sureshanaparti merged 8 commits into
apache:mainfrom
storpool:deploy-vm-with-existing-volume-or-snapshot

Conversation

@slavkap

Copy link
Copy Markdown
Contributor

Description

This PR allows the users to deploy virtual machines with an existing volume or a snapshot.
For now it is limited only for KVM hypervisors and Zone-wide storage pools

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

  • Major
  • Minor

How Has This Been Tested?

Environment
OS - Rocky Linux 8.9
2 Zones with one agent host on each
hypervisor KVM

Tested manually and with smoke tests with StorPool and NFS as a primary storage

@codecov

codecovBot commented Mar 5, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.90%. Comparing base (16c60c7) to head (b36e05b).
⚠️ Report is 186 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (16c60c7) and HEAD (b36e05b). Click for more details.

HEAD has 1 upload less than BASE
FlagBASE (16c60c7)HEAD (b36e05b)
unittests10
Additional details and impacted files
@@ Coverage Diff @@## main #10503 +/- ##
=============================================
- Coverage 16.57% 3.90% -12.68% 
=============================================
Files 5743 414 -5329 Lines 510494 33746 -476748 Branches 62075 6075 -56000 =============================================
- Hits 84617 1317 -83300 + Misses 416415 32273 -384142 + Partials 9462 156 -9306 
FlagCoverage Δ
uitests3.90% <ø> (ø)
unittests?

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.

@bernardodemarcobernardodemarco added this to the 4.21.0 milestone Mar 5, 2025
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

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

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

TestResultTime (s)Test File
ContextSuite context=TestSharedNetworkWithConfigDrive>:setupError1520.36test_network.py
test_01_deploy_vm_with_existing_volumeError7.34test_vm_lifecycle_with_snapshot_or_volume.py
test_02_deploy_vm_with_existing_snapshotError0.06test_vm_lifecycle_with_snapshot_or_volume.py
test_03_deploy_vm_with_existing_volume_deleted_templateFailure861.05test_vm_lifecycle_with_snapshot_or_volume.py
test_04_deploy_vm_with_existing_snapshot_deleted_templateFailure862.76test_vm_lifecycle_with_snapshot_or_volume.py
test_05_deploy_vm_with_existing_snapshot_deleted_volumeFailure847.20test_vm_lifecycle_with_snapshot_or_volume.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

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

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

TestResultTime (s)Test File
ContextSuite context=TestSharedNetworkWithConfigDrive>:setupError1520.50test_network.py
test_01_deploy_vm_with_existing_volumeError0.00test_vm_lifecycle_with_snapshot_or_volume.py
test_02_deploy_vm_with_existing_snapshotError0.00test_vm_lifecycle_with_snapshot_or_volume.py
test_03_deploy_vm_with_existing_volume_deleted_templateError0.00test_vm_lifecycle_with_snapshot_or_volume.py
test_04_deploy_vm_with_existing_snapshot_deleted_templateError0.00test_vm_lifecycle_with_snapshot_or_volume.py
test_05_deploy_vm_with_existing_snapshot_deleted_volumeError0.00test_vm_lifecycle_with_snapshot_or_volume.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

@slavkap the tests fail because the self doesn't have a snapshot that was supposed to be created in the class setup method. Is this a timing issue?

@slavkap

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@slavkap
slavkapforce-pushed the deploy-vm-with-existing-volume-or-snapshot branch from d8b4872 to b8d9dcbCompareJune 24, 2025 14:43
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

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

Comment threadtest/integration/smoke/test_vm_lifecycle_with_snapshot_or_volume.py Outdated
Comment threadtest/integration/plugins/storpool/test_storpool_tiers.py
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-13598)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 54578 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10503-t13598-kvm-ol8.zip
Smoke tests completed. 141 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_01_deployVMInSharedNetworkFailure472.97test_network.py

@slavkap

Copy link
Copy Markdown
ContributorAuthor

Hi all,
I believe that the test failure is not related to the changes in the PR. It fails while trying to list the mount path with the error:

AssertionError: False is not true : After umount directory should be empty but contains: ['sudo: unable to resolve host VM-5cc1cc35-742a-46bc-ae8c-6785a06829bf: Temporary failure in name resolution']

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

Code LGTM - haven't tested it. Only one minor non-blocking comment left

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

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

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

TestResultTime (s)Test File

@DaanHooglandDaanHoogland mentioned this pull request Jul 4, 2025
@DaanHooglandDaanHoogland linked an issue Jul 6, 2025 that may be closed by this pull request
@sureshanapartisureshanaparti moved this from Done to In Progress in Apache CloudStack 4.21.0Jul 14, 2025
@sureshanaparti
sureshanaparti merged commit 54b44cc into apache:mainJul 14, 2025
24 of 26 checks passed
@github-project-automationgithub-project-automationBot moved this from In Progress to Done in Apache CloudStack 4.21.0Jul 14, 2025
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jul 16, 2025
* Option to deploy a VM with existing volume/snapshot
* smoke test changes
check if the hypervisor is KVM
check if the primary storage's scope is ZONE wide
* skip all tests if the storage isn't Zone-Wide and the hypervisor isn't KVM
* support StorPool tags
add StorPool tags to a volume created from snapshot or to a volume which
will be attached as a ROOT to a new VM
* Add StorPool tags on the new ROOT volume
* Add the StorPool's tags when volume is created from a snapshot or a
volume is attached as a ROOT to a VM
* Addressed review
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Streamlined Instance Cloning Deploy VM from Snapshot

9 participants

@slavkap@DaanHoogland@blueorangutan@rp-@weizhouapache@rajujith@nvazquez@sureshanaparti@bernardodemarco