Repository: apache/cloudstack
Pull request #10546: Fix secondary storage selectors feature
Author: login: winterhazel
Labels: name: Severity:BLOCKER
name: type:regression
name: component:quota
name: component:storage
Created: 2025-03-11T16:35:48Z | Merged: 2025-03-24T11:07:06Z

### Description

The secondary storage selectors feature is not working in the 4.20 and main branches.

PR #9873 changed the return of `org.apache.cloudstack.storage.heuristics.presetvariables.GenericHeuristicPresetVariable#toString`; however, as this method is used to build the secondary storage selection script, the changes made it stop working.

Here's how the script looked like before #9873:

```js
secondaryStorages = [{"id":"f7e21c42-f621-4412-8994-36e077f0faec","protocol":"nfs","totalDiskSize":104028176384,"usedDiskSize":47059042304,"name":"sec"}, {"id":"0d88afc2-93eb-4070-8fbf-d8909f62364d","protocol":"nfs","totalDiskSize":104028176384,"usedDiskSize":47059042304,"name":"sec-2"}]; snapshot = {"hypervisorType":"KVM","size":52428800,"name":"e"}; account = {"domain":{"id":"40815ad7-28b2-11ef-a04e-6ac09c2b3d6b","name":"ROOT"},"id":"60b92e66-28b2-11ef-a04e-6ac09c2b3d6b","name":"admin"}; '0d88afc2-93eb-4070-8fbf-d8909f62364d';
```

And how it looks like now:

```js
secondaryStorages = [GenericHeuristicPresetVariable {"id":"865197af-0bcc-4041-b031-8e6590cf41c4","protocol":"nfs","totalDiskSize":51460964352,"usedDiskSize":37255905280,"name":"sec-a-zn-1"}, GenericHeuristicPresetVariable {"id":"16babc8c-a6e8-4bb3-b581-c37afad4b442","protocol":"nfs","totalDiskSize":51460964352,"usedDiskSize":37255905280,"name":"sec-b-zn-1"}]; snapshot = GenericHeuristicPresetVariable {"hypervisorType":"KVM","size":52428800,"name":"a"}; account = GenericHeuristicPresetVariable {"domain":"GenericHeuristicPresetVariable {\"id\":\"40815ad7-28b2-11ef-a04e-6ac09c2b3d6b\",\"name\":\"ROOT\"}","id":"60b92e66-28b2-11ef-a04e-6ac09c2b3d6b","name":"admin"}; '16babc8c-a6e8-4bb3-b581-c37afad4b442';
```

This PR reverts the method to its previous state.

### Types of changes

- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [X] 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
- [X] test (unit or integration test code)

### Feature/Enhancement Scale or Bug Severity

#### Bug Severity

- [X] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial

### How Has This Been Tested?

1. I created a heuristic rule to direct snapshots to a specific secondary storage

```
(admin) 🐢 > create secondarystorageselector description=a name=a zoneid=065b0fd8-f562-480a-b278-ea3d9306a326  heuristicrule="'0d88afc2-93eb-4070-8fbf-d8909f62364d';" type=SNAPSHOT
```

2. I tried to take a snapshot

Before the changes, the snapshot process would fail due to an exception thrown by the JS interpreter. Applying the patch made it work again and correctly directed the snapshot to the secondary storage that I specified.


Diff:
diff --git a/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/GenericPresetVariable.java b/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/GenericPresetVariable.java
index f59f23abdc15..7073d2760d73 100644
--- a/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/GenericPresetVariable.java
+++ b/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/GenericPresetVariable.java
@@ -49,8 +49,12 @@ public void setName(String name) {
         fieldNamesToIncludeInToString.add("name");
     }
 
+    /***
+     * Converts the preset variable into a valid JSON object that will be injected into the JS interpreter.
+     * This method should not be overridden or changed.
+     */
     @Override
-    public String toString() {
+    public final String toString() {
         return ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, fieldNamesToIncludeInToString.toArray(new String[0]));
     }
 }
diff --git a/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/Resource.java b/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/Resource.java
index b1dfbacbfcda..4f8a971b869e 100644
--- a/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/Resource.java
+++ b/framework/quota/src/main/java/org/apache/cloudstack/quota/activationrule/presetvariables/Resource.java
@@ -40,8 +40,12 @@ public void setDomainId(String domainId) {
         this.domainId = domainId;
     }
 
+    /***
+     * Converts the preset variable into a valid JSON object that will be injected into the JS interpreter.
+     * This method should not be overridden or changed.
+     */
     @Override
-    public String toString() {
+    public final String toString() {
         return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
     }
 
diff --git a/server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/Domain.java b/server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/Domain.java
index 6565c06bfbbb..704cbf4373e6 100644
--- a/server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/Domain.java
+++ b/server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/Domain.java
@@ -16,7 +16,7 @@
 // under the License.
 package org.apache.cloudstack.storage.heuristics.presetvariables;
 
-public class Domain extends GenericHeuristicPresetVariable{
+public class Domain extends GenericHeuristicPresetVariable {
     private String id;
 
     public String getId() {
diff --git a/server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariable.java b/server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariable.java
index 28d4327954e7..b85b7763eeee 100644
--- a/server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariable.java
+++ b/server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariable.java
@@ -36,10 +36,12 @@ public void setName(String name) {
         fieldNamesToIncludeInToString.add("name");
     }
 
+    /***
+     * Converts the preset variable into a valid JSON object that will be injected into the JS interpreter.
+     * This method should not be overridden or changed.
+     */
     @Override
-    public String toString() {
-        return String.format("GenericHeuristicPresetVariable %s",
-                ReflectionToStringBuilderUtils.reflectOnlySelectedFields(
-                        this, fieldNamesToIncludeInToString.toArray(new String[0])));
+    public final String toString() {
+        return ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, fieldNamesToIncludeInToString.toArray(new String[0]));
     }
 }
diff --git a/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/AccountTest.java b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/AccountTest.java
new file mode 100644
index 000000000000..f7610438b78c
--- /dev/null
+++ b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/AccountTest.java
@@ -0,0 +1,46 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.storage.heuristics.presetvariables;
+
+import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class AccountTest {
+
+    @Test
+    public void toStringTestReturnsValidJson() {
+        Account variable = new Account();
+        variable.setName("test name");
+        variable.setId("test id");
+
+        Domain domainVariable = new Domain();
+        domainVariable.setId("domain id");
+        domainVariable.setName("domain name");
+        variable.setDomain(domainVariable);
+
+        String expected = ReflectionToStringBuilderUtils.reflectOnlySelectedFields(variable, "name", "id", "domain");
+        String result = variable.toString();
+
+        Assert.assertEquals(expected, result);
+    }
+
+}
diff --git a/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/DomainTest.java b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/DomainTest.java
new file mode 100644
index 000000000000..a1ec6854ecc0
--- /dev/null
+++ b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/DomainTest.java
@@ -0,0 +1,41 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.storage.heuristics.presetvariables;
+
+import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class DomainTest {
+
+    @Test
+    public void toStringTestReturnsValidJson() {
+        Domain variable = new Domain();
+        variable.setName("test name");
+        variable.setId("test id");
+
+        String expected = ReflectionToStringBuilderUtils.reflectOnlySelectedFields(variable, "name", "id");
+        String result = variable.toString();
+
+        Assert.assertEquals(expected, result);
+    }
+
+}
diff --git a/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariableTest.java b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariableTest.java
new file mode 100644
index 000000000000..cd295e92caf3
--- /dev/null
+++ b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariableTest.java
@@ -0,0 +1,40 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.storage.heuristics.presetvariables;
+
+import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class GenericHeuristicPresetVariableTest {
+
+    @Test
+    public void toStringTestReturnsValidJson() {
+        GenericHeuristicPresetVariable variable = new GenericHeuristicPresetVariable();
+        variable.setName("test name");
+
+        String expected = ReflectionToStringBuilderUtils.reflectOnlySelectedFields(variable, "name");
+        String result = variable.toString();
+
+        Assert.assertEquals(expected, result);
+    }
+
+}
diff --git a/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/SecondaryStorageTest.java b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/SecondaryStorageTest.java
new file mode 100644
index 000000000000..a09386789cfd
--- /dev/null
+++ b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/SecondaryStorageTest.java
@@ -0,0 +1,45 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.storage.heuristics.presetvariables;
+
+import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class SecondaryStorageTest {
+
+    @Test
+    public void toStringTestReturnsValidJson() {
+        SecondaryStorage variable = new SecondaryStorage();
+        variable.setName("test name");
+        variable.setId("test id");
+        variable.setProtocol("test protocol");
+        variable.setUsedDiskSize(1L);
+        variable.setTotalDiskSize(2L);
+
+        String expected = ReflectionToStringBuilderUtils.reflectOnlySelectedFields(variable, "name", "id",
+                "protocol", "usedDiskSize", "totalDiskSize");
+        String result = variable.toString();
+
+        Assert.assertEquals(expected, result);
+    }
+
+}
diff --git a/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/SnapshotTest.java b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/SnapshotTest.java
new file mode 100644
index 000000000000..b8476cd8e462
--- /dev/null
+++ b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/SnapshotTest.java
@@ -0,0 +1,44 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.storage.heuristics.presetvariables;
+
+import com.cloud.hypervisor.Hypervisor;
+import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class SnapshotTest {
+
+    @Test
+    public void toStringTestReturnsValidJson() {
+        Snapshot variable = new Snapshot();
+        variable.setName("test name");
+        variable.setSize(1L);
+        variable.setHypervisorType(Hypervisor.HypervisorType.KVM);
+
+        String expected = ReflectionToStringBuilderUtils.reflectOnlySelectedFields(variable, "name", "size",
+                "hypervisorType");
+        String result = variable.toString();
+
+        Assert.assertEquals(expected, result);
+    }
+
+}
diff --git a/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/TemplateTest.java b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/TemplateTest.java
new file mode 100644
index 000000000000..2c1582befb20
--- /dev/null
+++ b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/TemplateTest.java
@@ -0,0 +1,46 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.storage.heuristics.presetvariables;
+
+import com.cloud.hypervisor.Hypervisor;
+import com.cloud.storage.Storage;
+import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class TemplateTest {
+
+    @Test
+    public void toStringTestReturnsValidJson() {
+        Template variable = new Template();
+        variable.setName("test name");
+        variable.setTemplateType(Storage.TemplateType.USER);
+        variable.setHypervisorType(Hypervisor.HypervisorType.KVM);
+        variable.setFormat(Storage.ImageFormat.QCOW2);
+
+        String expected = ReflectionToStringBuilderUtils.reflectOnlySelectedFields(variable, "name", "templateType",
+                "hypervisorType", "format");
+        String result = variable.toString();
+
+        Assert.assertEquals(expected, result);
+    }
+
+}
diff --git a/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/VolumeTest.java b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/VolumeTest.java
new file mode 100644
index 000000000000..e74ddc93ec5c
--- /dev/null
+++ b/server/src/test/java/org/apache/cloudstack/storage/heuristics/presetvariables/VolumeTest.java
@@ -0,0 +1,44 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.cloudstack.storage.heuristics.presetvariables;
+
+import com.cloud.storage.Storage;
+import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class VolumeTest {
+
+    @Test
+    public void toStringTestReturnsValidJson() {
+        Volume variable = new Volume();
+        variable.setName("test name");
+        variable.setFormat(Storage.ImageFormat.QCOW2);
+        variable.setSize(1L);
+
+        String expected = ReflectionToStringBuilderUtils.reflectOnlySelectedFields(variable, "name", "format",
+                "size");
+        String result = variable.toString();
+
+        Assert.assertEquals(expected, result);
+    }
+
+}


Reviews:
user: login: JoaoJandre
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-11T17:14:48Z
user: login: vishesh92
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-12T09:33:13Z
user: login: winterhazel
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-12T10:16:10Z
user: login: DaanHoogland
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-19T15:30:01Z

Review comments:
diff_hunk: @@ -38,8 +38,6 @@ public void setName(String name) {
 
     @Override
     public String toString() {
-        return String.format("GenericHeuristicPresetVariable %s",
-                ReflectionToStringBuilderUtils.reflectOnlySelectedFields(
-                        this, fieldNamesToIncludeInToString.toArray(new String[0])));
+        return ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, fieldNamesToIncludeInToString.toArray(new String[0]));
path: server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariable.java
user: login: vishesh92
body: @winterhazel PR looks good but can you add a comment to avoid similar issues in the future.
created_at: 2025-03-12T09:33:13Z
author_association: MEMBER
diff_hunk: @@ -38,8 +38,6 @@ public void setName(String name) {
 
     @Override
     public String toString() {
-        return String.format("GenericHeuristicPresetVariable %s",
-                ReflectionToStringBuilderUtils.reflectOnlySelectedFields(
-                        this, fieldNamesToIncludeInToString.toArray(new String[0])));
+        return ReflectionToStringBuilderUtils.reflectOnlySelectedFields(this, fieldNamesToIncludeInToString.toArray(new String[0]));
path: server/src/main/java/org/apache/cloudstack/storage/heuristics/presetvariables/GenericHeuristicPresetVariable.java
user: login: winterhazel
body: I'll add some tests 
created_at: 2025-03-12T10:16:09Z
author_association: MEMBER

PR comments:
user: login: winterhazel
created_at: 2025-03-11T16:39:26Z
body: @blueorangutan package
author_association: MEMBER
user: login: blueorangutan
created_at: 2025-03-11T16:40:03Z
body: @winterhazel 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.
author_association: NONE
user: login: codecov[bot]
created_at: 2025-03-11T16:46:07Z
body: ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/10546?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 16.01%. Comparing base [(`b8359e8`)](https://app.codecov.io/gh/apache/cloudstack/commit/b8359e8f62e23910e11548740e54aeb99a69ee93?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`f5859f0`)](https://app.codecov.io/gh/apache/cloudstack/commit/f5859f0fd489155d628cfa9fb324854ecaefbab5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> Report is 15 commits behind head on 4.20.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##               4.20   #10546   +/-   ##
=========================================
  Coverage     16.00%   16.01%           
- Complexity    13104    13115   +11     
=========================================
  Files          5651     5651           
  Lines        495841   495841           
  Branches      60044    60045    +1     
=========================================
+ Hits          79365    79411   +46     
+ Misses       407613   407566   -47     
- Partials       8863     8864    +1     
```

| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/10546/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/10546/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.00% <ø> (ø)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/10546/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `16.85% <100.00%> (+<0.01%)` | :arrow_up: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/10546?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
author_association: NONE
user: login: blueorangutan
created_at: 2025-03-11T17:44:34Z
body: Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12741
author_association: NONE
user: login: DaanHoogland
created_at: 2025-03-12T09:30:31Z
body: lgtm, @vishesh92 , can you check if there was a pressing reason the string `GenericHeuristicPresetVariable` was included in `toString()`?
author_association: CONTRIBUTOR
user: login: vishesh92
created_at: 2025-03-12T09:34:32Z
body: > lgtm, @vishesh92 , can you check if there was a pressing reason the string `GenericHeuristicPresetVariable` was included in `toString()`?

It was just to improve logging.
author_association: MEMBER
user: login: winterhazel
created_at: 2025-03-16T01:43:52Z
body: @blueorangutan package
author_association: MEMBER
user: login: blueorangutan
created_at: 2025-03-16T01:46:03Z
body: @winterhazel 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.
author_association: NONE
user: login: blueorangutan
created_at: 2025-03-16T02:53:21Z
body: Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12795
author_association: NONE
user: login: Pearl1594
created_at: 2025-03-21T18:54:52Z
body: @blueorangutan test
author_association: CONTRIBUTOR
user: login: blueorangutan
created_at: 2025-03-21T18:56:03Z
body: @Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
author_association: NONE
user: login: blueorangutan
created_at: 2025-03-22T12:45:03Z
body: <b>[SF] Trillian test result (tid-12802)</b>
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 61383 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10546-t12802-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:


Test | Result | Time (s) | Test File
--- | --- | --- | ---

author_association: NONE