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 e6cbf8a98239281a171bee19481c1f4184de357a 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 | 6 ++++++ 1 file changed, 6 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..d391e55bce3 100644 --- a/server/src/main/java/com/cloud/server/ManagementServerImpl.java +++ b/server/src/main/java/com/cloud/server/ManagementServerImpl.java @@ -44,6 +44,8 @@ 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; import org.apache.cloudstack.affinity.AffinityGroupProcessor; @@ -1612,6 +1614,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); }
