Skip to content

Commit 618b6d0

Browse files
sureshanapartiLocharla, Sandeep
authored andcommitted
Deployment plan fixes for VM with last host, and last host in maintenance (apache#12062)
* Deployment plan fixes for VM with last host - Consider last host when it is not in maintenance - Fail deployment when user requests for last host consideration and last host doesn't exists or in maintenance * changes * msg update with vm/host name * address comments * Exclude last hosts with error or degraded state as well, for vm deploy * review changes
1 parent 796c824 commit 618b6d0

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ public Long migrate(final HaWorkVO work) {
837837
if (checkAndCancelWorkIfNeeded(work)) {
838838
return null;
839839
}
840-
logger.info("Migration attempt: for VM {}from host {}. Starting attempt: {}/{} times.", vm, srcHost, 1 + work.getTimesTried(), _maxRetries);
840+
logger.info("Migration attempt: for {} from {}. Starting attempt: {}/{} times.", vm, srcHost, 1 + work.getTimesTried(), _maxRetries);
841841

842842
if (VirtualMachine.State.Stopped.equals(vm.getState())) {
843843
logger.info(String.format("vm %s is Stopped, skipping migrate.", vm));
@@ -847,8 +847,6 @@ public Long migrate(final HaWorkVO work) {
847847
logger.info(String.format("VM %s is running on a different host %s, skipping migration", vm, vm.getHostId()));
848848
return null;
849849
}
850-
logger.info("Migration attempt: for VM " + vm.getUuid() + "from host id " + srcHostId +
851-
". Starting attempt: " + (1 + work.getTimesTried()) + "/" + _maxRetries + " times.");
852850

853851
try {
854852
work.setStep(Step.Migrating);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1563,7 +1563,7 @@ private boolean doMaintain(final long hostId) {
15631563
throw new CloudRuntimeException("There are active VMs using the host's local storage pool. Please stop all VMs on this host that use local storage.");
15641564
}
15651565
} else {
1566-
logger.info("Maintenance: scheduling migration of VM {} from host {}", vm, host);
1566+
logger.info("Maintenance: scheduling migration of {} from {}", vm, host);
15671567
_haMgr.scheduleMigration(vm, HighAvailabilityManager.ReasonType.HostMaintenance);
15681568
}
15691569
}

0 commit comments

Comments
 (0)