| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@DaanHoogland a [SF] 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. |
Sorry, something went wrong.
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6283 |
Sorry, something went wrong.
Codecov ReportAttention: 308 lines in your changes are missing coverage. Please review.
@@ Coverage Diff @@
## main #7659 +/- ##
=============================================
+ Coverage 18.25% 28.93% +10.68%
- Complexity 17824 31007 +13183
=============================================
Files 5100 5251 +151
Lines 346393 368752 +22359
Branches 49768 53759 +3991
=============================================
+ Hits 63217 106682 +43465
+ Misses 274118 247425 -26693
- Partials 9058 14645 +5587
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Sorry, something went wrong.
|
hey @BryanMLima , I saw the issue with functional description that came with this. I haven't yet read it and just reacted to the lint output: Check hooks apply to the repository......................................Passed check for case conflicts.................................................Passed check vcs permalinks.....................................................Passed fix end of files.........................................................Failed - hook id: end-of-file-fixer - exit code: 1 - files were modified by this hook Fixing server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/PresetVariables.java Fixing api/src/main/java/org/apache/cloudstack/api/command/admin/storage/heuristics/CreateSecondaryStorageSelectorCmd.java Fixing server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/Snapshot.java Fixing api/src/main/java/org/apache/cloudstack/api/command/admin/storage/heuristics/UpdateSecondaryStorageSelectorCmd.java Fixing server/src/main/java/org/apache/cloudstack/storage/heuristics/HeuristicRuleHelper.java Fixing server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariable.java Fixing engine/schema/src/main/java/org/apache/cloudstack/secstorage/dao/SecondaryStorageHeuristicDaoImpl.java Fixing engine/schema/src/main/java/org/apache/cloudstack/secstorage/HeuristicVO.java Fixing server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/SecondaryStorage.java Fixing api/src/main/java/org/apache/cloudstack/secstorage/heuristics/HeuristicPurpose.java Fixing api/src/main/java/org/apache/cloudstack/api/response/SecondaryStorageHeuristicsResponse.java Fixing engine/schema/src/main/java/org/apache/cloudstack/secstorage/dao/SecondaryStorageHeuristicDao.java Fixing server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/Volume.java Fixing api/src/main/java/org/apache/cloudstack/secstorage/heuristics/Heuristic.java Fixing server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/Template.java mixed line ending........................................................Passed |
Sorry, something went wrong.
Thanks, I always forget about these. |
Sorry, something went wrong.
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Sorry, something went wrong.
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Sorry, something went wrong.
|
@BryanMLima , conflict :( can you resolve it? |
Sorry, something went wrong.
|
@BryanMLima any documentation available that provides some guidance on the usage of this feature? Any plans to implement a UI? |
Sorry, something went wrong.
There was a problem hiding this comment.
(SS-SelectorPR) 🐱 > create secondarystorageselector name=KVMtemplatesonly description=KVMtemplatesonly type=TEMPLATE zoneid=a2a9fafd-43fb-4508-915e-d3c836a7e972 heuristicrule="function directToDedicatedQCOW2Pool(pool) {return pool.uuid === '92dc82ff-c3cc-4756-928f-6802c358f599';} if (template.format === 'QCOW2') {secondaryStorages.filter(directToDedicatedQCOW2Pool)[0].uuid}"
{
"heuristics": {
"created": "2023-11-15T11:42:50+0000",
"description": "KVMtemplatesonly",
"heuristicrule": "function directToDedicatedQCOW2Pool(pool) {return pool.uuid === '92dc82ff-c3cc-4756-928f-6802c358f599';} if (template.format === 'QCOW2') {secondaryStorages.filter(directToDedicatedQCOW2Pool)[0].uuid}",
"id": "1d9070e9-5d12-4159-9e7c-de0793c87e24",
"name": "KVMtemplatesonly",
"type": "TEMPLATE",
"zoneid": "a2a9fafd-43fb-4508-915e-d3c836a7e972"
}
}
On register template:
due to [javax.script.ScriptException: TypeError: Cannot read property "uuid" from undefined in <eval> at line number 1]
at org.apache.cloudstack.utils.jsinterpreter.JsInterpreter.executeScriptInThread(JsInterpreter.java:121)
Specific UUID:
create secondarystorageselector name=KVMtemplatesonly-specifc description=KVMtemplatesonly-specific type=TEMPLATE zoneid=a2a9fafd-43fb-4508-915e-d3c836a7e972 heuristicrule="function findStorageWithSpecificUuid(pool) { return pool.uuid === '92dc82ff-c3cc-4756-928f-6802c358f599'; } secondaryStorages.filter(findStorageWithSpecificUuid)[0].uuid"
On register template:
java.util.concurrent.ExecutionException: javax.script.ScriptException: TypeError: Cannot read property "uuid" from undefined in <eval> at line number 1
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
Sorry, something went wrong.
@rajujith currently, the only documentation (more like a feature specification) is described in issue #7654; though, I pretend to add a proper documentation of this feature in the official documentation of CloudStack. Regarding the implementation of the UI for this feature, it is planned, however, it is not a priority at the moment.
@rajujith thanks for testing this PR. Regarding item 3), could you provide more details of this testing? This feature only allows one heuristic rule per type, if you tried to dedicate a secondary storage to a domain for a specific type, you need to edit the same heuristic rule to dedicate to another domain. In the future, this feature could allow multiple heuristic rules for the same type in a zone, allowing operators to specify the order in which each rule would be verified. Regarding item 4), the description of this PR and the issue presented the uuid for the secondarystorage variable in the JS script; however, it is the id that is provided in the script. I apologise for the confusion, I already fixed this in both the PR and the issue description's. |
Sorry, something went wrong.
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7892 |
Sorry, something went wrong.
Even the CI needs to rest a bit, right? 😂 |
Sorry, something went wrong.
|
@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
Sorry, something went wrong.
|
[SF] Trillian test result (tid-8451)
|
Sorry, something went wrong.
|
@BryanMLima I updated the rules for scenarios 3) and 4). Now they are working fine. list secondarystorageselectors zoneid=a2a9fafd-43fb-4508-915e-d3c836a7e972 |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
This PR aims to add the possibility to direct resources (Volumes, Templates, Snapshots and ISOs) to a specific secondary storage through rules written in JavaScript that will only affect new allocated resources. This feature is fully described in issue #7654.
Fixes: #7654
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
Unit tests were added to validate the functionality of the implemented methods. Besides this, the overall functionality was tested in a local lab with two secondary storage available, creating basic JS rules and validating that the resource was allocated according to the heuristic rule. Below, there are some examples used in the tests, based on the variables available for each resource type specified in the specification of the feature proposal.