692692import com .cloud .dc .dao .PodVlanMapDao ;
693693import com .cloud .dc .dao .VlanDao ;
694694import com .cloud .deploy .DataCenterDeployment ;
695+ import com .cloud .deploy .DeploymentPlan ;
695696import com .cloud .deploy .DeploymentPlanner ;
696697import com .cloud .deploy .DeploymentPlanner .ExcludeList ;
697698import com .cloud .deploy .DeploymentPlanningManager ;
@@ -1465,7 +1466,8 @@ protected boolean zoneWideVolumeRequiresStorageMotion(PrimaryDataStore volumeDat
14651466 * @param keyword Keyword filter for host search
14661467 * @return Ternary containing: (all hosts with count, filtered compatible hosts, storage motion requirements map)
14671468 */
1468- protected Ternary <Pair <List <HostVO >, Integer >, List <HostVO >, Map <Host , Boolean >> getTechnicallyCompatibleHosts (
1469+ @ Override
1470+ public Ternary <Pair <List <? extends Host >, Integer >, List <? extends Host >, Map <Host , Boolean >> getTechnicallyCompatibleHosts (
14691471 final VirtualMachine vm ,
14701472 final Long startIndex ,
14711473 final Long pageSize ,
@@ -1474,7 +1476,8 @@ protected Ternary<Pair<List<HostVO>, Integer>, List<HostVO>, Map<Host, Boolean>>
14741476 // GPU check
14751477 if (_serviceOfferingDetailsDao .findDetail (vm .getServiceOfferingId (), GPU .Keys .pciDevice .toString ()) != null ) {
14761478 logger .info (" Live Migration of GPU enabled VM : " + vm .getInstanceName () + " is not supported" );
1477- return new Ternary <>(new Pair <>(new ArrayList <>(), 0 ), new ArrayList <>(), new HashMap <>());
1479+ return new Ternary <Pair <List <? extends Host >, Integer >, List <? extends Host >, Map <Host , Boolean >>(
1480+ new Pair <>(new ArrayList <>(), 0 ), new ArrayList <>(), new HashMap <>());
14781481 }
14791482
14801483 final long srcHostId = vm .getHostId ();
@@ -1571,7 +1574,8 @@ protected Ternary<Pair<List<HostVO>, Integer>, List<HostVO>, Map<Host, Boolean>>
15711574 }
15721575
15731576 if (CollectionUtils .isEmpty (filteredHosts )) {
1574- return new Ternary <>(new Pair <>(allHosts , allHostsPair .second ()), new ArrayList <>(), new HashMap <>());
1577+ return new Ternary <Pair <List <? extends Host >, Integer >, List <? extends Host >, Map <Host , Boolean >>(
1578+ new Pair <>(allHosts , allHostsPair .second ()), new ArrayList <>(), new HashMap <>());
15751579 }
15761580 } else {
15771581 final Long cluster = srcHost .getClusterId ();
@@ -1584,14 +1588,16 @@ protected Ternary<Pair<List<HostVO>, Integer>, List<HostVO>, Map<Host, Boolean>>
15841588 filteredHosts = allHosts ;
15851589 }
15861590
1587- final Pair <List <HostVO >, Integer > allHostsPairResult = new Pair <>(allHosts , allHostsPair .second ());
1591+ final Pair <List <? extends Host >, Integer > allHostsPairResult = new Pair <>(allHosts , allHostsPair .second ());
15881592 Pair <Boolean , List <HostVO >> uefiFilteredResult = filterUefiHostsForMigration (allHosts , filteredHosts , vm );
15891593 if (!uefiFilteredResult .first ()) {
1590- return new Ternary <>(allHostsPairResult , new ArrayList <>(), new HashMap <>());
1594+ return new Ternary <Pair <List <? extends Host >, Integer >, List <? extends Host >, Map <Host , Boolean >>(
1595+ allHostsPairResult , new ArrayList <>(), new HashMap <>());
15911596 }
15921597 filteredHosts = uefiFilteredResult .second ();
15931598
1594- return new Ternary <>(allHostsPairResult , filteredHosts , requiresStorageMotion );
1599+ return new Ternary <Pair <List <? extends Host >, Integer >, List <? extends Host >, Map <Host , Boolean >>(
1600+ allHostsPairResult , filteredHosts , requiresStorageMotion );
15951601 }
15961602
15971603 /**
@@ -1604,17 +1610,15 @@ protected Ternary<Pair<List<HostVO>, Integer>, List<HostVO>, Map<Host, Boolean>>
16041610 * @param vmList List of VMs with current/simulated placements for affinity processing
16051611 * @return ExcludeList containing hosts to avoid
16061612 */
1607- protected ExcludeList applyAffinityConstraints (
1608- final VirtualMachine vm ,
1609- final VirtualMachineProfile vmProfile ,
1610- final DataCenterDeployment plan ,
1611- final List <VirtualMachine > vmList ) {
1612-
1613+ @ Override
1614+ public ExcludeList applyAffinityConstraints (VirtualMachine vm , VirtualMachineProfile vmProfile , DeploymentPlan plan , List <VirtualMachine > vmList ) {
16131615 final ExcludeList excludes = new ExcludeList ();
16141616 excludes .addHost (vm .getHostId ());
16151617
16161618 if (dpdkHelper .isVMDpdkEnabled (vm .getId ())) {
1617- excludeNonDPDKEnabledHosts (plan , excludes );
1619+ if (plan instanceof DataCenterDeployment ) {
1620+ excludeNonDPDKEnabledHosts ((DataCenterDeployment ) plan , excludes );
1621+ }
16181622 }
16191623
16201624 // call affinitygroup chain
@@ -1649,7 +1653,7 @@ protected List<Host> getCapableSuitableHosts(
16491653 final VirtualMachine vm ,
16501654 final VirtualMachineProfile vmProfile ,
16511655 final DataCenterDeployment plan ,
1652- final List <HostVO > compatibleHosts ,
1656+ final List <? extends Host > compatibleHosts ,
16531657 final ExcludeList excludes ,
16541658 final Host srcHost ) {
16551659
@@ -1693,11 +1697,11 @@ public Ternary<Pair<List<? extends Host>, Integer>, List<? extends Host>, Map<Ho
16931697 validateVmForHostMigration (vm );
16941698
16951699 // Get technically compatible hosts (storage, hypervisor, UEFI)
1696- Ternary <Pair <List <HostVO >, Integer >, List <HostVO >, Map <Host , Boolean >> compatibilityResult =
1700+ Ternary <Pair <List <? extends Host >, Integer >, List <? extends Host >, Map <Host , Boolean >> compatibilityResult =
16971701 getTechnicallyCompatibleHosts (vm , startIndex , pageSize , keyword );
16981702
1699- Pair <List <HostVO >, Integer > allHostsPair = compatibilityResult .first ();
1700- List <HostVO > filteredHosts = compatibilityResult .second ();
1703+ Pair <List <? extends Host >, Integer > allHostsPair = compatibilityResult .first ();
1704+ List <? extends Host > filteredHosts = compatibilityResult .second ();
17011705 Map <Host , Boolean > requiresStorageMotion = compatibilityResult .third ();
17021706
17031707 // If no compatible hosts, return early
0 commit comments