-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Veeam: get templateId from vm instance if vm is created from ISO #10705
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
Veeam: get templateId from vm instance if vm is created from ISO #10705
Conversation
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
@weizhouapache , I think we can suffice with a unit test for this one, do you agree? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10705 +/- ##
============================================
- Coverage 16.18% 16.18% -0.01%
+ Complexity 13305 13301 -4
============================================
Files 5657 5657
Lines 498467 498471 +4
Branches 60491 60492 +1
============================================
- Hits 80696 80659 -37
- Misses 408790 408837 +47
+ Partials 8981 8975 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
yes, will add @DaanHoogland |
harikrishna-patnala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM
it seems it needs much effort to add the unit test,as the VMGuruTest does not have unit test for |
|
@blueorangutan package |
|
@rohityadavcloud 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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13310 |
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14121 |
|
As this is for veeam, wil we settle for regression testing, @weizhouapache ? |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
I think we should test with veeam at least. |
|
[SF] Trillian test result (tid-13744)
|
vishesh92
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm
|
moving to 4.20.3 due to inactivity |
|
@weizhouapache Could you please rebase this to 4.20? |
2791ec5 to
b1a6ef9
Compare
@abh1sar sure,done |
|
@blueorangutan package |
|
@weizhouapache 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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15670 |
abh1sar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with Veeam 12.3.
- Created an Instance using ISO.
- Took Backup
- Stopped Instance
- Restore the backup
Before Fix:
VMware] due to: [Cannot invoke "java.lang.Long.longValue()" because the return value of "com.cloud.hypervisor.guru.VMwareGuru.getImportingVMTemplate(java.util.List, long, com.cloud.hypervisor.vmware.mo.DatacenterMO, String, java.lang.Long, long, java.util.Map, org.apache.cloudstack.backup.Backup)" is null]. java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "com.cloud.hypervisor.guru.VMwareGuru.getImportingVMTemplate(java.util.List, long, com.cloud.hypervisor.vmware.mo.DatacenterMO, String, java.lang.Long, long, java.util.Map, org.apache.cloudstack.backup.Backup)" is null
at com.cloud.hypervisor.guru.VMwareGuru.importVirtualMachineFromBackup(VMwareGuru.java:1176)
at org.apache.cloudstack.backup.BackupManagerImpl.importRestoredVM(BackupManagerImpl.java:600)
at org.apache.cloudstack.backup.BackupManagerImpl.restoreBackup(BackupManagerImpl.java:666)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.apache.cloudstack.network.contrail.management.EventUtils$EventInterceptor.invoke(EventUtils.java:109)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:52)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
at jdk.proxy3/jdk.proxy3.$Proxy371.restoreBackup(Unknown Source)
at org.apache.cloudstack.api.command.user.backup.RestoreBackupCmd.execute(RestoreBackupCmd.java:77)
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:173)
at com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:110)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:661)
at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
at org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.run(AsyncJobManagerImpl.java:609)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
After Fix:
Restored finished without any error.
2025-11-07 10:42:09,483 DEBUG [c.c.a.ApiServer] (API-Job-Executor-13:[ctx-adc78ab9, job-66, ctx-894693c6]) (logid:6fb9f493) Retrieved cmdEventType from job info: BACKUP.RESTORE
2025-11-07 10:42:09,484 DEBUG [o.a.c.f.j.i.AsyncJobManagerImpl$5] (API-Job-Executor-13:[ctx-adc78ab9, job-66]) (logid:6fb9f493) Done executing org.apache.cloudstack.api.command.user.backup.RestoreBackupCmd for job-66
Description
This PR fixes #9440
The ROOT volume of vm from ISO does not have template_id (which is NULL)
We can get the template_id of vm_instance instead
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?