Skip to content

Commit d38bf8a

Browse files
author
Prachi Damle
committed
More log statements to debug
1 parent 0f565f2 commit d38bf8a

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎plugins/affinity-group-processors/host-anti-affinity/src/org/apache/cloudstack/affinity/HostAntiAffinityProcessor.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,18 @@ public void process(VirtualMachineProfile<? extends VirtualMachine> vmProfile, D
6868
if (groupVM != null && !groupVM.isRemoved()) {
6969
if (groupVM.getHostId() != null) {
7070
avoid.addHost(groupVM.getHostId());
71+
if (s_logger.isDebugEnabled()) {
72+
s_logger.debug("Added host " + groupVM.getHostId() + " to avoid set, since VM "
73+
+ groupVM.getId() + " is present on the host");
74+
}
7175
} else if (VirtualMachine.State.Stopped.equals(groupVM.getState())
7276
&& groupVM.getLastHostId() != null) {
7377
avoid.addHost(groupVM.getLastHostId());
78+
if (s_logger.isDebugEnabled()) {
79+
s_logger.debug("Added host " + groupVM.getLastHostId() + " to avoid set, since VM "
80+
+ groupVM.getId() + " is present on the host, in Stopped state");
81+
}
82+
7483
}
7584
}
7685
}

‎server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ public UserVm updateVMAffinityGroups(Long vmId, List<Long> affinityGroupIds) {
310310
}
311311
}
312312
_affinityGroupVMMapDao.updateMap(vmId, affinityGroupIds);
313+
if (s_logger.isDebugEnabled()) {
314+
s_logger.debug("Updated VM :" + vmId + " affinity groups to =" + affinityGroupIds);
315+
}
313316
// APIResponseHelper will pull out the updated affinitygroups.
314317
return vmInstance;
315318

0 commit comments

Comments
 (0)