You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pe...@apache.org on 2025/02/11 13:23:02 UTC

(cloudstack) branch list-only-src-arch-hosts created (now eab55863b58)

This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a change to branch list-only-src-arch-hosts
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


      at eab55863b58 List only those hosts matching source host arch in multi-arch zones

This branch includes the following new commits:

     new eab55863b58 List only those hosts matching source host arch in multi-arch zones

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(cloudstack) 01/01: List only those hosts matching source host arch in multi-arch zones

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch list-only-src-arch-hosts
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit eab55863b583cbc4932be9dd8663b0f2059c4f4b
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Tue Feb 11 08:22:51 2025 -0500

    List only those hosts matching source host arch in multi-arch zones
---
 server/src/main/java/com/cloud/server/ManagementServerImpl.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/server/src/main/java/com/cloud/server/ManagementServerImpl.java b/server/src/main/java/com/cloud/server/ManagementServerImpl.java
index 76d2943e18c..9d51cf02990 100644
--- a/server/src/main/java/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/main/java/com/cloud/server/ManagementServerImpl.java
@@ -44,6 +44,7 @@ import javax.crypto.spec.SecretKeySpec;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import com.cloud.cpu.CPU;
 import com.cloud.utils.security.CertificateHelper;
 import org.apache.cloudstack.acl.ControlledEntity;
 import org.apache.cloudstack.acl.SecurityChecker;
@@ -1612,6 +1613,10 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
             logger.debug("Hosts having capacity and suitable for migration: {}", suitableHosts);
         }
 
+        // Only list hosts of the same architecture as the source Host
+        CPU.CPUArch hostArch = srcHost.getArch();
+        suitableHosts = suitableHosts.stream().filter(h -> h.getArch() == hostArch).collect(Collectors.toList());
+
         return new Ternary<>(otherHosts, suitableHosts, requiresStorageMotion);
     }