Skip to content

Commit eab5586

Browse files
committed
List only those hosts matching source host arch in multi-arch zones
1 parent 2739c01 commit eab5586

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/src/main/java/com/cloud/server/ManagementServerImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import javax.inject.Inject;
4545
import javax.naming.ConfigurationException;
4646

47+
import com.cloud.cpu.CPU;
4748
import com.cloud.utils.security.CertificateHelper;
4849
import org.apache.cloudstack.acl.ControlledEntity;
4950
import org.apache.cloudstack.acl.SecurityChecker;
@@ -1612,6 +1613,10 @@ public Ternary<Pair<List<? extends Host>, Integer>, List<? extends Host>, Map<Ho
16121613
logger.debug("Hosts having capacity and suitable for migration: {}", suitableHosts);
16131614
}
16141615

1616+
// Only list hosts of the same architecture as the source Host
1617+
CPU.CPUArch hostArch = srcHost.getArch();
1618+
suitableHosts = suitableHosts.stream().filter(h -> h.getArch() == hostArch).collect(Collectors.toList());
1619+
16151620
return new Ternary<>(otherHosts, suitableHosts, requiresStorageMotion);
16161621
}
16171622

0 commit comments

Comments
 (0)