You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/03/02 06:47:30 UTC

[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #5831: [WIP] SystemVM optimizations

Pearl1594 commented on a change in pull request #5831:
URL: https://github.com/apache/cloudstack/pull/5831#discussion_r817392008



##########
File path: core/src/main/java/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java
##########
@@ -173,12 +174,33 @@ private Answer execute(final SetupKeyStoreCommand cmd) {
         return new SetupKeystoreAnswer(result.getDetails());
     }
 
+    private void scpFileToIdentifyPatching(String routerIp, String path, String filename, String content) throws InterruptedException {
+        String errMsg = "Failed to scp file: %s to system VM";
+        for (int retries = 15; retries > 0; retries--) {
+            try {
+                _vrDeployer.createFileInVR(routerIp, path, filename, content);
+            } catch (Exception e) {
+                errMsg += ", retrying";
+                s_logger.error(String.format(errMsg, filename), e);
+                Thread.sleep(2000);
+            }
+        }
+    }
     private Answer execute(final SetupCertificateCommand cmd) {
-        final String args = String.format("/usr/local/cloud/systemvm/conf/agent.properties " +
+        String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME);
+        if (!org.apache.commons.lang3.StringUtils.isEmpty(routerName) && (routerName.startsWith("s-") || routerName.startsWith("v-"))) {
+            try {
+                scpFileToIdentifyPatching(cmd.getRouterAccessIp(), "/usr/local/cloud/systemvm/conf/", KeyStoreUtils.CERT_FILENAME, cmd.getCertificate());

Review comment:
       @rohityadavcloud could you please explain this point. Thanks




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org