From 4acedc8308a13763d118a8bf7502bd159580670a Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Sat, 28 Aug 2021 10:30:31 +0530 Subject: [PATCH] Fix failure to scp diagnostic data file from SSVM on ubuntu based env (#5384) --- .../apache/cloudstack/diagnostics/DiagnosticsServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/apache/cloudstack/diagnostics/DiagnosticsServiceImpl.java b/server/src/main/java/org/apache/cloudstack/diagnostics/DiagnosticsServiceImpl.java index 0184a44ff39..f5bba77b2ab 100644 --- a/server/src/main/java/org/apache/cloudstack/diagnostics/DiagnosticsServiceImpl.java +++ b/server/src/main/java/org/apache/cloudstack/diagnostics/DiagnosticsServiceImpl.java @@ -340,8 +340,8 @@ public class DiagnosticsServiceImpl extends ManagerBase implements PluggableServ File dataDirectory = new File(dataDirectoryInSecondaryStore); boolean existsInSecondaryStore = dataDirectory.exists() || dataDirectory.mkdir(); if (existsInSecondaryStore) { - // scp from system VM to mounted sec storage directory - File permKey = new File("/var/cloudstack/management/.ssh/id_rsa"); + String homeDir = System.getProperty("user.home"); + File permKey = new File(homeDir + "/.ssh/id_rsa"); SshHelper.scpFrom(vmSshIp, 3922, "root", permKey, dataDirectoryInSecondaryStore, diagnosticsFile); }