Skip to content

Commit 73eccb4

Browse files
Remove "VM" on logs as vm.toString() already appends VM-<details>
1 parent 5227089 commit 73eccb4

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4486,15 +4486,15 @@ private void orchestrateMigrateForScale(final String vmUuid, final long srcHostI
44864486
throw new CloudRuntimeException("Unable to complete migration for " + vm);
44874487
}
44884488
} catch (final OperationTimedoutException e) {
4489-
s_logger.debug(String.format("Error while checking the vm %s on %s", vm, dstHost), e);
4489+
s_logger.debug(String.format("Error while checking the %s on %s", vm, dstHost), e);
44904490
}
44914491

44924492
migrated = true;
44934493
} finally {
44944494
if (!migrated) {
44954495
s_logger.info("Migration was unsuccessful. Cleaning up: " + vm);
44964496

4497-
String alertSubject = String.format("Unable to migrate VM [%s] from %s in Zone [%s] and Pod [%s].",
4497+
String alertSubject = String.format("Unable to migrate %s from %s in Zone [%s] and Pod [%s].",
44984498
vm.getInstanceName(), fromHost, dest.getDataCenter().getName(), dest.getPod().getName());
44994499
String alertBody = "Migrate Command failed. Please check logs.";
45004500
_alertMgr.sendAlert(alertType, fromHost.getDataCenterId(), fromHost.getPodId(), alertSubject, alertBody);

engine/schema/src/main/java/com/cloud/dc/ClusterVO.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,6 @@ public PartitionType partitionType() {
199199

200200
@Override
201201
public String toString() {
202-
return String.format("Cluster [{id: \"%s\", name: \"%s\", uuid: \"%s\"}]", id, name, uuid);
202+
return String.format("Cluster {id: \"%s\", name: \"%s\", uuid: \"%s\"}", id, name, uuid);
203203
}
204204
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ protected boolean attemptMaintain(HostVO host) throws NoTransitionException {
15391539
boolean hasPendingMigrationRetries = false;
15401540
for (VMInstanceVO vmInstanceVO : allVmsOnHost) {
15411541
if (_haMgr.hasPendingMigrationsWork(vmInstanceVO.getId())) {
1542-
s_logger.info(String.format("Attempting maintenance for %s found pending migration for VM %s.", host, vmInstanceVO));
1542+
s_logger.info(String.format("Attempting maintenance for %s found pending migration for %s.", host, vmInstanceVO));
15431543
hasPendingMigrationRetries = true;
15441544
break;
15451545
}
@@ -2501,16 +2501,16 @@ public void deleteRoutingHost(final HostVO host, final boolean isForced, final b
25012501
}
25022502
for (final VMInstanceVO vm : vms) {
25032503
if ((! HighAvailabilityManager.ForceHA.value() && !vm.isHaEnabled()) || vm.getState() == State.Stopping) {
2504-
s_logger.debug(String.format("Stopping VM: %s as a part of hostDelete: %s",vm, host));
2504+
s_logger.debug(String.format("Stopping %s as a part of hostDelete for %s",vm, host));
25052505
try {
25062506
_haMgr.scheduleStop(vm, host.getId(), WorkType.Stop);
25072507
} catch (final Exception e) {
2508-
final String errorMsg = String.format("There was an error stopping the VM: %s as a part of hostDelete: %s", vm, host);
2508+
final String errorMsg = String.format("There was an error stopping the %s as a part of hostDelete for %s", vm, host);
25092509
s_logger.debug(errorMsg, e);
25102510
throw new UnableDeleteHostException(errorMsg + "," + e.getMessage());
25112511
}
25122512
} else if ((HighAvailabilityManager.ForceHA.value() || vm.isHaEnabled()) && (vm.getState() == State.Running || vm.getState() == State.Starting)) {
2513-
s_logger.debug(String.format("Scheduling restart for VM: %s, state: %s on host: %s.", vm, vm.getState(), host));
2513+
s_logger.debug(String.format("Scheduling restart for %s, state: %s on host: %s.", vm, vm.getState(), host));
25142514
_haMgr.scheduleRestart(vm, false);
25152515
}
25162516
}

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5255,7 +5255,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) {
52555255
}
52565256
});
52575257
} catch (Exception e) {
5258-
s_logger.warn(String.format("Unable to update VM disk statistics for vm %s from %s", userVm.getInstanceName(), host), e);
5258+
s_logger.warn(String.format("Unable to update VM disk statistics for %s from %s", userVm.getInstanceName(), host), e);
52595259
}
52605260
}
52615261
}

0 commit comments

Comments
 (0)