This is an automated email from the ASF dual-hosted git repository.
weizhou pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.20 by this push:
new 6f931dbd005 agent: increase timeout for host arch retrieval (#11254)
(#11822)
6f931dbd005 is described below
commit 6f931dbd005c26f0df9da7cf88e5bde707442d85
Author: Rohit Yadav <[email protected]>
AuthorDate: Tue Oct 14 14:23:45 2025 +0530
agent: increase timeout for host arch retrieval (#11254) (#11822)
Cherry-picked from 44f80648a9ea818e34997416aabbcd95cb03f847
Signed-off-by: Abhishek Kumar <[email protected]>
Co-authored-by: Abhishek Kumar <[email protected]>
---
agent/src/main/java/com/cloud/agent/Agent.java | 7 +++----
.../main/java/org/apache/cloudstack/utils/linux/KVMHostInfo.java | 4 ++--
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/agent/src/main/java/com/cloud/agent/Agent.java
b/agent/src/main/java/com/cloud/agent/Agent.java
index 2e7b61fbd51..23b5e790eb9 100644
--- a/agent/src/main/java/com/cloud/agent/Agent.java
+++ b/agent/src/main/java/com/cloud/agent/Agent.java
@@ -93,7 +93,6 @@ import com.cloud.utils.nio.Link;
import com.cloud.utils.nio.NioClient;
import com.cloud.utils.nio.NioConnection;
import com.cloud.utils.nio.Task;
-import com.cloud.utils.script.OutputInterpreter;
import com.cloud.utils.script.Script;
/**
@@ -598,9 +597,9 @@ public class Agent implements HandlerFactory,
IAgentControl, AgentStatusUpdater
}
protected String getAgentArch() {
- final Script command = new Script("/usr/bin/arch", 500, logger);
- final OutputInterpreter.OneLineParser parser = new
OutputInterpreter.OneLineParser();
- return command.execute(parser);
+ String arch =
Script.runSimpleBashScript(Script.getExecutableAbsolutePath("arch"), 2000);
+ logger.debug("Arch for agent: {} found: {}", _name, arch);
+ return arch;
}
@Override
diff --git
a/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/linux/KVMHostInfo.java
b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/linux/KVMHostInfo.java
index cee07421314..0792d09d975 100644
---
a/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/linux/KVMHostInfo.java
+++
b/plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/linux/KVMHostInfo.java
@@ -58,7 +58,7 @@ public class KVMHostInfo {
private long reservedMemory;
private long overCommitMemory;
private List<String> capabilities = new ArrayList<>();
- private static String cpuArchCommand = "/usr/bin/arch";
+ private static String cpuArchRetrieveExecutable = "arch";
private static List<String> cpuInfoFreqFileNames =
List.of("/sys/devices/system/cpu/cpu0/cpufreq/base_frequency","/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq");
public KVMHostInfo(long reservedMemory, long overCommitMemory, long
manualSpeed, int reservedCpus) {
@@ -248,6 +248,6 @@ public class KVMHostInfo {
private String getCPUArchFromCommand() {
LOGGER.info("Fetching host CPU arch");
- return Script.runSimpleBashScript(cpuArchCommand);
+ return
Script.runSimpleBashScript(Script.getExecutableAbsolutePath(cpuArchRetrieveExecutable));
}
}