-
Notifications
You must be signed in to change notification settings - Fork 1.2k
check tags while fetching storage pool for importing vm #9764
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
Conversation
@blueorangutan package |
@vishesh92 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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #9764 +/- ##
=========================================
Coverage 15.13% 15.13%
- Complexity 11265 11272 +7
=========================================
Files 5408 5408
Lines 473900 473946 +46
Branches 57791 57809 +18
=========================================
+ Hits 71705 71725 +20
- Misses 394192 394203 +11
- Partials 8003 8018 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 11268 |
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
@vishesh92 check/fix unit tests. |
@blueorangutan package |
@vishesh92 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 11276 |
@blueorangutan test |
@vishesh92 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
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. Could you describe your tests @vishesh92 ?
[SF] Trillian test result (tid-11613)
|
I am still testing it. Let me make this PR as a draft for now. |
There are some issues. I will continue on this after #9787. |
61ebded
to
2479d6a
Compare
2479d6a
to
8e473f3
Compare
@blueorangutan package |
@vishesh92 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 11909 |
5128522
to
df3083c
Compare
df3083c
to
5e3c0f5
Compare
@blueorangutan package |
@vishesh92 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 11954 |
@blueorangutan test keepEnv |
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian Build Failed (tid-12013) |
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 still
[SF] Trillian test result (tid-12016)
|
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.
LGTM
Steps to reproduce the issue
-
Launch a Cloudstack environment with 2 clusters vmware and kvm
-
Tag the Primay storages associated with vmware cluster (t1)
-
Tag the Primay storages associated with kvm cluster (t2)
-
Create a compute offering with storage tag (t1)
-
Create a 2 disk offerings vmware disk offering with tag (t1) and kvm disk offering with tag (t2)
-
Launch a vm on vmware cluster with compute offering (mentioned in step 4) and a data disk offering (t1 )
-
Import a VM from VMWare cluster to kvmcluster. Specify the disk offering for the disk (t2)
Before fix
Exception observed and the vm import fails
2025-01-02 10:59:58,629 DEBUG [c.c.s.VolumeApiServiceImpl] (API-Job-Executor-75:[ctx-6f2e67f9, job-173, ctx-ca492698]) (logid:bf43ecb6) Destination storage pool [551184a2-ff07-338a-b271-55975f6be3c7] accepts tags [tag4]? false
2025-01-02 10:59:58,629 ERROR [o.a.c.v.UnmanagedVMsManagerImpl] (API-Job-Executor-75:[ctx-6f2e67f9, job-173, ctx-ca492698]) (logid:bf43ecb6) Error importing VM: Disk offering: ff026253-1000-4a32-be90-92eaa3aa163d is not compatible with storage pool: 551184a2-ff07-338a-b271-55975f6be3c7 of unmanaged disk: 25-2000 com.cloud.exception.InvalidParameterValueException: Disk offering: ff026253-1000-4a32-be90-92eaa3aa163d is not compatible with storage pool: 551184a2-ff07-338a-b271-55975f6be3c7 of unmanaged disk: 25-2000
After fix , no exception observed and able to import the vm successful
2025-01-02 11:29:43,701 DEBUG [c.c.s.VolumeApiServiceImpl] (API-Job-Executor-52:ctx-aa2e87b2 job-113 ctx-697a3a12) (logid:5e8257b0) Destination storage pool has tags [%s], and the disk offering has no tags. Therefore, they are compatible.
2025-01-02 11:29:43,703 DEBUG [c.c.s.VolumeApiServiceImpl] (API-Job-Executor-52:ctx-aa2e87b2 job-113 ctx-697a3a12) (logid:5e8257b0) Destination storage pool [10242ad6-ae25-3fd8-8507-3e78e254b28c] accepts tags [tag3]? true
* 4.19: check tags while fetching storage pool for importing vm (#9764)
Description
This PR fixes #9670
Details
This pull request includes several changes to the
UnmanagedVMsManagerImpl
class to enhance the handling of disk offerings during the import and conversion of unmanaged instances. The most important changes include modifications to thegetStoragePool
method, updates to the conversion and import logic, and adjustments to the test cases.Enhancements to disk offering handling:
server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
: Modified thegetStoragePool
method to accept an additionaldiskOfferingTags
parameter and updated the logic to ensure the storage pool supports the disk offering. [1] [2] [3]Updates to conversion and import logic:
server/src/main/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImpl.java
: Updated various methods to include disk offering tags and ensure compatibility with storage pools, such ascheckUnmanagedDiskAndOfferingForImport
,importDisk
,importUnmanagedInstanceFromVmwareToKvm
,sanitizeConvertedInstance
,checkConversionSupportOnHost
,convertVmwareInstanceToKVMWithOVFOnConvertLocation
, andconvertVmwareInstanceToKVMAfterExportingOVFToConvertLocation
. [1] [2] [3] [4] [5] [6] [7]Adjustments to test cases:
server/src/test/java/org/apache/cloudstack/vm/UnmanagedVMsManagerImplTest.java
: Updated the test methodsimportUnmanagedInstanceTest
andbaseTestImportVmFromVmwareToKvm
to mock thedoesTargetStorageSupportDiskOffering
method and ensure the tests reflect the new disk offering logic. [1] [2]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?