diff --git a/api/src/org/apache/cloudstack/context/CallContext.java b/api/src/org/apache/cloudstack/context/CallContext.java index 0457c332b1b..f80b921d9c7 100644 --- a/api/src/org/apache/cloudstack/context/CallContext.java +++ b/api/src/org/apache/cloudstack/context/CallContext.java @@ -252,6 +252,8 @@ public class CallContext { if (!stack.isEmpty()) { s_currentContext.set(stack.peek()); + } else { + s_currentContext.set(null); } return context; diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index 805ecce169b..6b73f4d730f 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -3048,7 +3048,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } if(VmJobEnabled.value()) { - if (ping.getHostVmStateReport() != null && ping.getHostVmStateReport().size() > 0) { + if (ping.getHostVmStateReport() != null) { _syncMgr.processHostVmStatePingReport(agentId, ping.getHostVmStateReport()); } } diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java index 635603f00eb..633295884bc 100644 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachinePowerStateSyncImpl.java @@ -66,6 +66,9 @@ public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStat private void processReport(long hostId, Map translatedInfo) { + if (s_logger.isDebugEnabled()) + s_logger.debug("Process VM state report. host: " + hostId + ", number of records in report: " + translatedInfo.size()); + for (Map.Entry entry : translatedInfo.entrySet()) { if (s_logger.isDebugEnabled()) @@ -105,6 +108,9 @@ public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStat } } } + + if (s_logger.isDebugEnabled()) + s_logger.debug("Done with process of VM state report. host: " + hostId); } @Override diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java index 129d9cae52c..86c65421fde 100644 --- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/AsyncJobExecutionContext.java @@ -207,7 +207,7 @@ public class AsyncJobExecutionContext { public static String getOriginJobId() { AsyncJobExecutionContext context = AsyncJobExecutionContext.getCurrentExecutionContext(); if (context != null && context.getJob() != null) - return "Job-" + context.getJob().getId(); + return "" + context.getJob().getId(); return ""; } diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 33e7462c6c6..bbe15c8730d 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -324,9 +324,9 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe static { s_powerStatesTable = new HashMap(); s_powerStatesTable.put(Types.VmPowerState.HALTED, PowerState.PowerOff); - s_powerStatesTable.put(Types.VmPowerState.PAUSED, PowerState.PowerOn); + s_powerStatesTable.put(Types.VmPowerState.PAUSED, PowerState.PowerOff); s_powerStatesTable.put(Types.VmPowerState.RUNNING, PowerState.PowerOn); - s_powerStatesTable.put(Types.VmPowerState.SUSPENDED, PowerState.PowerOn); + s_powerStatesTable.put(Types.VmPowerState.SUSPENDED, PowerState.PowerOff); s_powerStatesTable.put(Types.VmPowerState.UNRECOGNIZED, PowerState.PowerUnknown); } @@ -2524,7 +2524,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } if (vm_map == null) { - return null; + return vmStates; } for (VM.Record record : vm_map.values()) { if (record.isControlDomain || record.isASnapshot || record.isATemplate) { @@ -4927,7 +4927,6 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } if (srr.shared) { Host host = Host.getByUuid(conn, _host.uuid); - boolean found = false; for (PBD pbd : pbds) { PBD.Record pbdr = pbd.getRecord(conn);