Uh oh!
There was an error while loading. Please reload this page.
Add dynamic secondary storage selection - #7659
Conversation
DaanHoogland
commented
Jun 21, 2023
@blueorangutan package |
blueorangutan
commented
Jun 21, 2023
@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. |
blueorangutan
commented
Jun 21, 2023
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6283 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
DaanHoogland
commented
Jun 21, 2023
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: |
BryanMLima
commented
Jun 21, 2023
Thanks, I always forget about these. |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
DaanHoogland
commented
Nov 15, 2023
@BryanMLima , conflict :( can you resolve it? |
@BryanMLima any documentation available that provides some guidance on the usage of this feature? Any plans to implement a UI? |
rajujith
left a comment
There was a problem hiding this comment.
- I could dedicate a secondary storage for KVM snapshots.
- I could dedicate a secondary storage for a domain.
- I was unable to dedicate another secondary storage for a second domain in the same zone. I believe this might be a limitation?
- I faced the below issues while registering template with the following rules:
(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)
BryanMLima
commented
Nov 17, 2023
@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 |
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
DaanHoogland
commented
Dec 1, 2023
@blueorangutan package |
blueorangutan
commented
Dec 1, 2023
@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. |
blueorangutan
commented
Dec 1, 2023
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 7892 |
DaanHoogland
commented
Dec 1, 2023
@blueorangutan rest |
BryanMLima
commented
Dec 1, 2023
Even the CI needs to rest a bit, right? 😂 |
vishesh92
commented
Dec 1, 2023
@blueorangutan test |
blueorangutan
commented
Dec 1, 2023
@vishesh92 a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Dec 2, 2023
[SF] Trillian test result (tid-8451)
|
rajujith
commented
Dec 4, 2023
@BryanMLima I updated the rules for scenarios 3) and 4). Now they are working fine. list secondarystorageselectors zoneid=a2a9fafd-43fb-4508-915e-d3c836a7e972 |
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.