René's URL Explorer Experiment


Title: VM migration with disks fails between local storage hypervisors if the VM template is deleted · Issue #10246 · apache/cloudstack · GitHub

Open Graph Title: VM migration with disks fails between local storage hypervisors if the VM template is deleted · Issue #10246 · apache/cloudstack

X Title: VM migration with disks fails between local storage hypervisors if the VM template is deleted · Issue #10246 · apache/cloudstack

Description: problem When trying to migrate a virtual machine between two local storage hypervisors, the migration fails if the VM template is removed. I did some reasearch, and have figured out the possible root cause of it. First, the template is n...

Open Graph Description: problem When trying to migrate a virtual machine between two local storage hypervisors, the migration fails if the VM template is removed. I did some reasearch, and have figured out the possible ro...

X Description: problem When trying to migrate a virtual machine between two local storage hypervisors, the migration fails if the VM template is removed. I did some reasearch, and have figured out the possible ro...

Opengraph URL: https://github.com/apache/cloudstack/issues/10246

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"VM migration with disks fails between local storage hypervisors if the VM template is deleted","articleBody":"### problem\n\nWhen trying to migrate a virtual machine between two local storage hypervisors, the migration fails if the VM template is removed.\n\nI did some reasearch, and have figured out the possible root cause of it. \n\nFirst, the template is not found here: [StorageSystemDataMotionStrategy.java:2158](https://github.com/apache/cloudstack/blob/4.20/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java#L2158)\nTherefore, the system thinks this VM does not have a template.\n\nAs the result, the system thinks this VM does not have any backing files, and tries to perform full clone migration: [MigrateKVMAsync.java:128](https://github.com/apache/cloudstack/blob/4.20/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/MigrateKVMAsync.java#L128). This seems to be the right migration option, the documentation says it will perform the migration of all the VMs disks: [VIR_MIGRATE_NON_SHARED_INC](https://libvirt.org/html/libvirt-libvirt-domain.html#VIR_MIGRATE_NON_SHARED_INC)\nBut there is a catch: the QCOW2 images have to be precreated on the destination machine with the correct size.\n\nThere is a method that would copy the template from the secondary storage to the destination host: [KvmNonManagedStorageDataMotionStrategy.java:220](https://github.com/apache/cloudstack/blob/4.20/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/KvmNonManagedStorageDataMotionStrategy.java#L220-L235), but there is no method to just create a QCOW2 file with the specific size at the specific path.\n\n\n### versions\n\n4.20\n\n### The steps to reproduce the bug\n\n1. Take two KVM hypervisors with local storage pools.\n2. Create a virtual machine from a template on one of them.\n3. Delete this template after the test virtual machine was started.\n4. Try to migrate the virtual machine with its storage to the other hypervisor.\n5. It will fail with an error telling that the backing file does not exist on the target machine:\n```\n2025-01-22 12:41:08,662 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-1:[ctx-9e293509, job-226]) (logid:61e8bd24) Unexpected exception while executing org.apache.cloudstack.api.command.admin.vm.MigrateVirtualMachineWithVolumeCmd com.cloud.utils.exception.CloudRuntimeException: Failed to migrate VM [VM instance {\"id\":18,\"instanceName\":\"i-2-18-VM\",\"type\":\"User\",\"uuid\":\"d3b043ff-716a-4bc8-b20e-639853b0babe\"}] along with its volumes due to [com.cloud.utils.exception.CloudRuntimeException: Copy volume(s) to storage(s) [{volume: \"33\", from: \"3\", to:\"4\"}] and VM to host [{vm: \"18\", from: \"2\", to:\"4\"}] failed in StorageSystemDataMotionStrategy.copyAsync. Error message: [Exception during migrate: org.libvirt.LibvirtException: Path '/var/lib/libvirt/images/bb51c27d-ca94-4cda-a74e-cec07295ce26' is not accessible: No such file or directory].].\n\tat org.apache.cloudstack.engine.orchestration.VolumeOrchestrator.migrateVolumes(VolumeOrchestrator.java:1444)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)\n\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n....\n```\n\n### What to do about it?\n\nIt would be nice to fix the storage migration when the VM template was removed.\n\nI would like to try to develop a fix myself but my knowledge of Cloudstack internals is not enough to know where to look.\nI'd need some guidance how to properly develop the fix, for example point me to the right files where I can look. ","author":{"url":"https://github.com/phsm","@type":"Person","name":"phsm"},"datePublished":"2025-01-23T08:13:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/10246/cloudstack/issues/10246"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f8948d32-202f-26b1-6ee1-7b0f2ff5fc65
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9D6E:3891D8:9CC8B3:E7D505:6A4E1D8C
html-safe-nonce4a184ddc145c66029b3c8030ab12878312c0d87eb232e518bc1db2c54711f46f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDZFOjM4OTFEODo5Q0M4QjM6RTdENTA1OjZBNEUxRDhDIiwidmlzaXRvcl9pZCI6IjM3NDAxMDI0Mzk5MDgyODU4MzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd039b9f7b9520261a9c29ac875177ffe9ad1fc0e9c86580783716a3dfd348cfd
hovercard-subject-tagissue:2806218593
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/cloudstack/10246/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7cf42a05542c4af9b41a3fff6ca7f1b8b46a2430fba9761a4bb14f934410a9ee/apache/cloudstack/issues/10246
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7cf42a05542c4af9b41a3fff6ca7f1b8b46a2430fba9761a4bb14f934410a9ee/apache/cloudstack/issues/10246
og:image:altproblem When trying to migrate a virtual machine between two local storage hypervisors, the migration fails if the VM template is removed. I did some reasearch, and have figured out the possible ro...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamephsm
hostnamegithub.com
expected-hostnamegithub.com
None030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0
turbo-cache-controlno-preview
go-importgithub.com/apache/cloudstack git https://github.com/apache/cloudstack.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id9759448
octolytics-dimension-repository_nwoapache/cloudstack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id9759448
octolytics-dimension-repository_network_root_nwoapache/cloudstack
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5fe497b4815fcce3df76c0e246faa739a82c3124
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/cloudstack/issues/10246#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fissues%2F10246
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fissues%2F10246
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=apache%2Fcloudstack
Reloadhttps://github.com/apache/cloudstack/issues/10246
Reloadhttps://github.com/apache/cloudstack/issues/10246
Reloadhttps://github.com/apache/cloudstack/issues/10246
Please reload this pagehttps://github.com/apache/cloudstack/issues/10246
apache https://github.com/apache
cloudstackhttps://github.com/apache/cloudstack
Notifications https://github.com/login?return_to=%2Fapache%2Fcloudstack
Fork 1.3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Star 3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Code https://github.com/apache/cloudstack
Issues 536 https://github.com/apache/cloudstack/issues
Pull requests 267 https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality 0 https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
Code https://github.com/apache/cloudstack
Issues https://github.com/apache/cloudstack/issues
Pull requests https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
VM migration with disks fails between local storage hypervisors if the VM template is deletedhttps://github.com/apache/cloudstack/issues/10246#top
unplannedhttps://github.com/apache/cloudstack/milestone/19
https://github.com/phsm
phsmhttps://github.com/phsm
on Jan 23, 2025https://github.com/apache/cloudstack/issues/10246#issue-2806218593
StorageSystemDataMotionStrategy.java:2158https://github.com/apache/cloudstack/blob/4.20/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java#L2158
MigrateKVMAsync.java:128https://github.com/apache/cloudstack/blob/4.20/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/MigrateKVMAsync.java#L128
VIR_MIGRATE_NON_SHARED_INChttps://libvirt.org/html/libvirt-libvirt-domain.html#VIR_MIGRATE_NON_SHARED_INC
KvmNonManagedStorageDataMotionStrategy.java:220https://github.com/apache/cloudstack/blob/4.20/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/KvmNonManagedStorageDataMotionStrategy.java#L220-L235
unplannedNo due datehttps://github.com/apache/cloudstack/milestone/19
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.