Skip to content

StoragePoolType as class#8544

Merged
yadvr merged 18 commits intoapache:mainfrom
shapeblue:storagepooltype-as-class
Feb 5, 2024
Merged

StoragePoolType as class#8544
yadvr merged 18 commits intoapache:mainfrom
shapeblue:storagepooltype-as-class

Conversation

@sureshanaparti
Copy link
Copy Markdown
Contributor

Description

This PR moves the StoragePoolType from an Enum to a class that is largely compatible with Enum. This allows for storage pool plugins to be added dynamically without needing to hard code an enum value into the core code. We are trying to be Enum compatible to avoid having to refactor much of the code where these are used.

To do this, on the KVM agent side we needed to move from annotation based StoragePoolTypes on the StorageAdaptors to having an adaptor method report the StoragePoolType. This was because annotations aren't dynamic enough to be able to use StoragePoolTypes that aren't static.

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

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

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

codecov bot commented Jan 22, 2024

Codecov Report

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

Comparison is base (6d916ca) 30.85% compared to head (47d455b) 21.76%.
Report is 38 commits behind head on main.

Files Patch % Lines
.../hypervisor/kvm/storage/KVMStoragePoolManager.java 0.00% 25 Missing ⚠️
api/src/main/java/com/cloud/storage/Storage.java 74.46% 8 Missing and 4 partials ⚠️
.../hypervisor/kvm/storage/LibvirtStorageAdaptor.java 0.00% 10 Missing ⚠️
.../cloud/agent/transport/StoragePoolTypeAdaptor.java 37.50% 4 Missing and 1 partial ⚠️
...c/main/java/com/cloud/utils/db/GenericDaoBase.java 82.35% 2 Missing and 1 partial ⚠️
.../hypervisor/kvm/storage/ScaleIOStorageAdaptor.java 0.00% 2 Missing ⚠️
...ain/java/com/cloud/storage/StorageManagerImpl.java 33.33% 2 Missing ⚠️
...cloudstack/storage/datastore/db/StoragePoolVO.java 50.00% 0 Missing and 1 partial ⚠️
...ud/hypervisor/kvm/storage/FiberChannelAdapter.java 0.00% 1 Missing ⚠️
...hypervisor/kvm/storage/IscsiAdmStorageAdaptor.java 0.00% 1 Missing ⚠️
... and 7 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8544      +/-   ##
============================================
- Coverage     30.85%   21.76%   -9.09%     
+ Complexity    34048    22317   -11731     
============================================
  Files          5341     5212     -129     
  Lines        374861   353060   -21801     
  Branches      54518    50573    -3945     
============================================
- Hits         115659    76854   -38805     
- Misses       243973   265088   +21115     
+ Partials      15229    11118    -4111     
Flag Coverage Δ
simulator-marvin-tests 23.30% <46.51%> (-1.46%) ⬇️
uitests 4.39% <ø> (-0.01%) ⬇️
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.

@blueorangutan
Copy link
Copy Markdown

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

@kiranchavala
Copy link
Copy Markdown
Member

@blueorangutan test matrix

@blueorangutan
Copy link
Copy Markdown

@kiranchavala a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

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

Test Result Time (s) Test File
test_create_pvlan_network Error 0.06 test_pvlan.py
test_08_upgrade_kubernetes_ha_cluster Failure 987.07 test_kubernetes_clusters.py

Copy link
Copy Markdown
Member

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM, Tested by adding various types of primary storage and performed basic operations

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 24, 2024

@blueorangutan test matrix

@blueorangutan
Copy link
Copy Markdown

@rohityadavcloud a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti 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 8431

@blueorangutan
Copy link
Copy Markdown

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

Test Result Time (s) Test File
test_01_vpc_site2site_vpn_multiple_options Failure 308.87 test_vpc_vpn.py

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-8932)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 54034 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8544-t8932-xenserver-71.zip
Smoke tests completed. 121 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti 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 8462

@sureshanaparti
Copy link
Copy Markdown
Contributor Author

@blueorangutan test matrix

@blueorangutan
Copy link
Copy Markdown

@sureshanaparti a [SL] Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-8977)
Environment: xenserver-71 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43297 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8544-t8977-xenserver-71.zip
Smoke tests completed. 120 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_cancel_host_maintenace_with_no_migration_jobs Error 308.39 test_host_maintenance.py

@blueorangutan
Copy link
Copy Markdown

[SF] Trillian test result (tid-8979)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server r8
Total time taken: 49449 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr8544-t8979-vmware-67u3.zip
Smoke tests completed. 120 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_balanced_drs_algorithm Error 433.44 test_cluster_drs.py

Copy link
Copy Markdown
Contributor

@JoaoJandre JoaoJandre left a comment

Choose a reason for hiding this comment

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

CLGTM, didn't test it

Copy link
Copy Markdown
Member

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM, tested manually was able to add cluster of type "DatastoreCluster"

Copy link
Copy Markdown
Member

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

LGTM, tested with some storage related operations

@yadvr yadvr merged commit 8ea9fc9 into apache:main Feb 5, 2024
@yadvr yadvr deleted the storagepooltype-as-class branch February 5, 2024 07:57
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Feb 7, 2024
* StoragePoolType as a class

* Fix agent side StoragePoolType enum to class

* Handle StoragePoolType for StoragePoolJoinVO

* Since StoragePoolType is a class, it cannot be converted by @Enumerated annotation.
Implemented conveter class and logic to utilize @convert annotation.

* Fix UserVMJoinVO for StoragePoolType

* fixed missing imports

* Since StoragePoolType is a class, it cannot be converted by @Enumerated annotation.
Implemented conveter class and logic to utilize @convert annotation.

* Fixed equals for the enum.

* removed not needed try/catch for prepareAttribute

* Added license to the file.

* Implemented "supportsPhysicalDiskCopy" for storage adaptor.

Co-authored-by: mprokopchuk <mprokopchuk@apple.com>

* Add javadoc to StoragePoolType class

* Add unit test for StoragePoolType comparisons

* StoragePoolType "==" and ".equals()" fix.

* Fix StoragePoolType for FiberChannelAdapter

* Fix for abstract storage adaptor set up issue

* review comments

* Pass StoragePoolType object for poolType dao attribute

---------

Co-authored-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: mprokopchuk <mprokopchuk@apple.com>
Co-authored-by: mprokopchuk <mprokopchuk@gmail.com>
@vishesh92 vishesh92 mentioned this pull request Mar 21, 2024
13 tasks
Sign up for free to 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.

8 participants