Skip to content

Commit 9093af6

Browse files
committed
Check MIGRATE_VM_ACROSS_CLUSTERS in zone setting
1 parent 50ac4af commit 9093af6

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3228,7 +3228,7 @@ public boolean checkIfVmHasClusterWideVolumes(Long vmId) {
32283228

32293229
@Override
32303230
public DataCenterDeployment getMigrationDeployment(final Long vmId, final Host host, final Long poolId, final ExcludeList excludes) {
3231-
if (MIGRATE_VM_ACROSS_CLUSTERS.value() && !checkIfVmHasClusterWideVolumes(vmId)) {
3231+
if (MIGRATE_VM_ACROSS_CLUSTERS.valueIn(host.getDataCenterId()) && !checkIfVmHasClusterWideVolumes(vmId)) {
32323232
s_logger.info("Searching for hosts in the zone for vm migration");
32333233
List<Long> clustersToExcluded = _clusterDao.listAllClusters(host.getDataCenterId());
32343234
List<ClusterVO> clusterList = _clusterDao.listByDcHyType(host.getDataCenterId(), host.getHypervisorType().toString());

server/src/main/java/com/cloud/resource/ResourceManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ private boolean doMaintain(final long hostId) {
12661266
List<HostVO> hosts = listAllUpAndEnabledHosts(Host.Type.Routing, host.getClusterId(), host.getPodId(), host.getDataCenterId());
12671267
if (hosts == null || hosts.isEmpty()) {
12681268
s_logger.warn("Unable to find a host for vm migration in cluster: " + host.getClusterId());
1269-
if (MIGRATE_VM_ACROSS_CLUSTERS.value()) {
1269+
if (MIGRATE_VM_ACROSS_CLUSTERS.valueIn(host.getDataCenterId())) {
12701270
s_logger.info("Looking for hosts across different clusters in zone: " + host.getDataCenterId());
12711271
hosts = listAllUpAndEnabledHosts(Host.Type.Routing, null, null, host.getDataCenterId());
12721272
if (hosts == null || hosts.isEmpty()) {

0 commit comments

Comments
 (0)