Skip to content

Commit 367acca

Browse files
committed
List only those hosts matching source host arch in multi-arch zones
1 parent 5aa79a6 commit 367acca

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

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

47+
<<<<<<< Updated upstream
48+
=======
49+
import com.cloud.cpu.CPU;
50+
import com.cloud.utils.security.CertificateHelper;
51+
>>>>>>> Stashed changes
4752
import org.apache.cloudstack.acl.ControlledEntity;
4853
import org.apache.cloudstack.acl.SecurityChecker;
4954
import org.apache.cloudstack.affinity.AffinityGroupProcessor;
@@ -1612,6 +1617,10 @@ public Ternary<Pair<List<? extends Host>, Integer>, List<? extends Host>, Map<Ho
16121617
logger.debug("Hosts having capacity and suitable for migration: {}", suitableHosts);
16131618
}
16141619

1620+
// Only list hosts of the same architecture as the source Host
1621+
CPU.CPUArch hostArch = srcHost.getArch();
1622+
suitableHosts = suitableHosts.stream().filter(h -> h.getArch() == hostArch).collect(Collectors.toList());
1623+
16151624
return new Ternary<>(otherHosts, suitableHosts, requiresStorageMotion);
16161625
}
16171626

0 commit comments

Comments
 (0)