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 367accacff2b5d697de643728680841ba6a89e31
Author: Pearl Dsilva <[email protected]>
AuthorDate: Tue Feb 11 08:25:07 2025 -0500

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

diff --git a/server/src/main/java/com/cloud/server/ManagementServerImpl.java 
b/server/src/main/java/com/cloud/server/ManagementServerImpl.java
index 9ffad8b8418..db085d1980a 100644
--- a/server/src/main/java/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/main/java/com/cloud/server/ManagementServerImpl.java
@@ -44,6 +44,11 @@ import javax.crypto.spec.SecretKeySpec;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+<<<<<<< Updated upstream
+=======
+import com.cloud.cpu.CPU;
+import com.cloud.utils.security.CertificateHelper;
+>>>>>>> Stashed changes
 import org.apache.cloudstack.acl.ControlledEntity;
 import org.apache.cloudstack.acl.SecurityChecker;
 import org.apache.cloudstack.affinity.AffinityGroupProcessor;
@@ -1612,6 +1617,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);
     }
 

Reply via email to