http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/deploy/FirstFitPlanner.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/deploy/FirstFitPlanner.java b/server/src/com/cloud/deploy/FirstFitPlanner.java index 8fa25bd..1be85b0 100644 --- a/server/src/com/cloud/deploy/FirstFitPlanner.java +++ b/server/src/com/cloud/deploy/FirstFitPlanner.java @@ -32,7 +32,6 @@ import org.apache.cloudstack.framework.config.ConfigKey; import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; -import org.apache.log4j.Logger; import com.cloud.capacity.Capacity; import com.cloud.capacity.CapacityManager; @@ -70,7 +69,6 @@ import com.cloud.vm.dao.VMInstanceDao; @Local(value = DeploymentPlanner.class) public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPlanner, Configurable { - private static final Logger s_logger = Logger.getLogger(FirstFitPlanner.class); @Inject protected HostDao _hostDao; @Inject @@ -127,8 +125,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla //check if datacenter is in avoid set if (avoid.shouldAvoid(dc)) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("DataCenter id = '" + dc.getId() + "' provided is in avoid set, DeploymentPlanner cannot allocate the VM, returning."); + if (logger.isDebugEnabled()) { + logger.debug("DataCenter id = '" + dc.getId() + "' provided is in avoid set, DeploymentPlanner cannot allocate the VM, returning."); } return null; } @@ -136,29 +134,29 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla List<Long> clusterList = new ArrayList<Long>(); if (plan.getClusterId() != null) { Long clusterIdSpecified = plan.getClusterId(); - s_logger.debug("Searching resources only under specified Cluster: " + clusterIdSpecified); + logger.debug("Searching resources only under specified Cluster: " + clusterIdSpecified); ClusterVO cluster = _clusterDao.findById(plan.getClusterId()); if (cluster != null) { if (avoid.shouldAvoid(cluster)) { - s_logger.debug("The specified cluster is in avoid set, returning."); + logger.debug("The specified cluster is in avoid set, returning."); } else { clusterList.add(clusterIdSpecified); removeClustersCrossingThreshold(clusterList, avoid, vmProfile, plan); } } else { - s_logger.debug("The specified cluster cannot be found, returning."); + logger.debug("The specified cluster cannot be found, returning."); avoid.addCluster(plan.getClusterId()); return null; } } else if (plan.getPodId() != null) { //consider clusters under this pod only Long podIdSpecified = plan.getPodId(); - s_logger.debug("Searching resources only under specified Pod: " + podIdSpecified); + logger.debug("Searching resources only under specified Pod: " + podIdSpecified); HostPodVO pod = _podDao.findById(podIdSpecified); if (pod != null) { if (avoid.shouldAvoid(pod)) { - s_logger.debug("The specified pod is in avoid set, returning."); + logger.debug("The specified pod is in avoid set, returning."); } else { clusterList = scanClustersForDestinationInZoneOrPod(podIdSpecified, false, vmProfile, plan, avoid); if (clusterList == null) { @@ -166,12 +164,12 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla } } } else { - s_logger.debug("The specified Pod cannot be found, returning."); + logger.debug("The specified Pod cannot be found, returning."); avoid.addPod(plan.getPodId()); return null; } } else { - s_logger.debug("Searching all possible resources under this Zone: " + plan.getDataCenterId()); + logger.debug("Searching all possible resources under this Zone: " + plan.getDataCenterId()); boolean applyAllocationAtPods = Boolean.parseBoolean(_configDao.getValue(Config.ApplyAllocationAlgorithmToPods.key())); if (applyAllocationAtPods) { @@ -228,23 +226,23 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla if (!podsWithCapacity.isEmpty()) { if (avoid.getPodsToAvoid() != null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Removing from the podId list these pods from avoid set: " + avoid.getPodsToAvoid()); + if (logger.isDebugEnabled()) { + logger.debug("Removing from the podId list these pods from avoid set: " + avoid.getPodsToAvoid()); } podsWithCapacity.removeAll(avoid.getPodsToAvoid()); } if (!isRootAdmin(vmProfile)) { List<Long> disabledPods = listDisabledPods(plan.getDataCenterId()); if (!disabledPods.isEmpty()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Removing from the podId list these pods that are disabled: " + disabledPods); + if (logger.isDebugEnabled()) { + logger.debug("Removing from the podId list these pods that are disabled: " + disabledPods); } podsWithCapacity.removeAll(disabledPods); } } } else { - if (s_logger.isDebugEnabled()) { - s_logger.debug("No pods found having a host with enough capacity, returning."); + if (logger.isDebugEnabled()) { + logger.debug("No pods found having a host with enough capacity, returning."); } return null; } @@ -253,8 +251,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla prioritizedPodIds = reorderPods(podCapacityInfo, vmProfile, plan); if (prioritizedPodIds == null || prioritizedPodIds.isEmpty()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("No Pods found for destination, returning."); + if (logger.isDebugEnabled()) { + logger.debug("No Pods found for destination, returning."); } return null; } @@ -262,7 +260,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla List<Long> clusterList = new ArrayList<Long>(); //loop over pods for (Long podId : prioritizedPodIds) { - s_logger.debug("Checking resources under Pod: " + podId); + logger.debug("Checking resources under Pod: " + podId); List<Long> clustersUnderPod = scanClustersForDestinationInZoneOrPod(podId, false, vmProfile, plan, avoid); if (clustersUnderPod != null) { clusterList.addAll(clustersUnderPod); @@ -270,8 +268,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla } return clusterList; } else { - if (s_logger.isDebugEnabled()) { - s_logger.debug("No Pods found after removing disabled pods and pods in avoid list, returning."); + if (logger.isDebugEnabled()) { + logger.debug("No Pods found after removing disabled pods and pods in avoid list, returning."); } return null; } @@ -338,7 +336,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla // Remove clusters crossing disabled threshold clusterListForVmAllocation.removeAll(clustersCrossingThreshold); - s_logger.debug("Cannot allocate cluster list " + clustersCrossingThreshold.toString() + " for vm creation since their allocated percentage" + + logger.debug("Cannot allocate cluster list " + clustersCrossingThreshold.toString() + " for vm creation since their allocated percentage" + " crosses the disable capacity threshold defined at each cluster/ at global value for capacity Type : " + capacity + ", skipping these clusters"); } @@ -358,8 +356,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla List<Long> prioritizedClusterIds = clusterCapacityInfo.first(); if (!prioritizedClusterIds.isEmpty()) { if (avoid.getClustersToAvoid() != null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Removing from the clusterId list these clusters from avoid set: " + avoid.getClustersToAvoid()); + if (logger.isDebugEnabled()) { + logger.debug("Removing from the clusterId list these clusters from avoid set: " + avoid.getClustersToAvoid()); } prioritizedClusterIds.removeAll(avoid.getClustersToAvoid()); } @@ -372,8 +370,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla disabledClusters = listDisabledClusters(plan.getDataCenterId(), id); } if (!disabledClusters.isEmpty()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Removing from the clusterId list these clusters that are disabled/clusters under disabled pods: " + disabledClusters); + if (logger.isDebugEnabled()) { + logger.debug("Removing from the clusterId list these clusters that are disabled/clusters under disabled pods: " + disabledClusters); } prioritizedClusterIds.removeAll(disabledClusters); } @@ -382,8 +380,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla removeClustersCrossingThreshold(prioritizedClusterIds, avoid, vmProfile, plan); } else { - if (s_logger.isDebugEnabled()) { - s_logger.debug("No clusters found having a host with enough capacity, returning."); + if (logger.isDebugEnabled()) { + logger.debug("No clusters found having a host with enough capacity, returning."); } return null; } @@ -391,8 +389,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla List<Long> clusterList = reorderClusters(id, isZone, clusterCapacityInfo, vmProfile, plan); return clusterList; //return checkClustersforDestination(clusterList, vmProfile, plan, avoid, dc); } else { - if (s_logger.isDebugEnabled()) { - s_logger.debug("No clusters found after removing disabled clusters and clusters in avoid list, returning."); + if (logger.isDebugEnabled()) { + logger.debug("No clusters found after removing disabled clusters and clusters in avoid list, returning."); } return null; } @@ -443,8 +441,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla //although an aggregate value may be false indicator that a cluster can host a vm, it will at the least eliminate those clusters which definitely cannot //we need clusters having enough cpu AND RAM to host this particular VM and order them by aggregate cluster capacity - if (s_logger.isDebugEnabled()) { - s_logger.debug("Listing clusters in order of aggregate capacity, that have (atleast one host with) enough CPU and RAM capacity under this " + + if (logger.isDebugEnabled()) { + logger.debug("Listing clusters in order of aggregate capacity, that have (atleast one host with) enough CPU and RAM capacity under this " + (isZone ? "Zone: " : "Pod: ") + id); } String capacityTypeToOrder = _configDao.getValue(Config.HostCapacityTypeToOrderClusters.key()); @@ -454,19 +452,19 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla } List<Long> clusterIdswithEnoughCapacity = _capacityDao.listClustersInZoneOrPodByHostCapacities(id, requiredCpu, requiredRam, capacityType, isZone); - if (s_logger.isTraceEnabled()) { - s_logger.trace("ClusterId List having enough CPU and RAM capacity: " + clusterIdswithEnoughCapacity); + if (logger.isTraceEnabled()) { + logger.trace("ClusterId List having enough CPU and RAM capacity: " + clusterIdswithEnoughCapacity); } Pair<List<Long>, Map<Long, Double>> result = _capacityDao.orderClustersByAggregateCapacity(id, capacityType, isZone); List<Long> clusterIdsOrderedByAggregateCapacity = result.first(); //only keep the clusters that have enough capacity to host this VM - if (s_logger.isTraceEnabled()) { - s_logger.trace("ClusterId List in order of aggregate capacity: " + clusterIdsOrderedByAggregateCapacity); + if (logger.isTraceEnabled()) { + logger.trace("ClusterId List in order of aggregate capacity: " + clusterIdsOrderedByAggregateCapacity); } clusterIdsOrderedByAggregateCapacity.retainAll(clusterIdswithEnoughCapacity); - if (s_logger.isTraceEnabled()) { - s_logger.trace("ClusterId List having enough CPU and RAM capacity & in order of aggregate capacity: " + clusterIdsOrderedByAggregateCapacity); + if (logger.isTraceEnabled()) { + logger.trace("ClusterId List having enough CPU and RAM capacity & in order of aggregate capacity: " + clusterIdsOrderedByAggregateCapacity); } return result; @@ -478,8 +476,8 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla //although an aggregate value may be false indicator that a pod can host a vm, it will at the least eliminate those pods which definitely cannot //we need pods having enough cpu AND RAM to host this particular VM and order them by aggregate pod capacity - if (s_logger.isDebugEnabled()) { - s_logger.debug("Listing pods in order of aggregate capacity, that have (atleast one host with) enough CPU and RAM capacity under this Zone: " + zoneId); + if (logger.isDebugEnabled()) { + logger.debug("Listing pods in order of aggregate capacity, that have (atleast one host with) enough CPU and RAM capacity under this Zone: " + zoneId); } String capacityTypeToOrder = _configDao.getValue(Config.HostCapacityTypeToOrderClusters.key()); short capacityType = Capacity.CAPACITY_TYPE_CPU; @@ -488,19 +486,19 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla } List<Long> podIdswithEnoughCapacity = _capacityDao.listPodsByHostCapacities(zoneId, requiredCpu, requiredRam, capacityType); - if (s_logger.isTraceEnabled()) { - s_logger.trace("PodId List having enough CPU and RAM capacity: " + podIdswithEnoughCapacity); + if (logger.isTraceEnabled()) { + logger.trace("PodId List having enough CPU and RAM capacity: " + podIdswithEnoughCapacity); } Pair<List<Long>, Map<Long, Double>> result = _capacityDao.orderPodsByAggregateCapacity(zoneId, capacityType); List<Long> podIdsOrderedByAggregateCapacity = result.first(); //only keep the clusters that have enough capacity to host this VM - if (s_logger.isTraceEnabled()) { - s_logger.trace("PodId List in order of aggregate capacity: " + podIdsOrderedByAggregateCapacity); + if (logger.isTraceEnabled()) { + logger.trace("PodId List in order of aggregate capacity: " + podIdsOrderedByAggregateCapacity); } podIdsOrderedByAggregateCapacity.retainAll(podIdswithEnoughCapacity); - if (s_logger.isTraceEnabled()) { - s_logger.trace("PodId List having enough CPU and RAM capacity & in order of aggregate capacity: " + podIdsOrderedByAggregateCapacity); + if (logger.isTraceEnabled()) { + logger.trace("PodId List having enough CPU and RAM capacity & in order of aggregate capacity: " + podIdsOrderedByAggregateCapacity); } return result;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/event/dao/EventJoinDaoImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/event/dao/EventJoinDaoImpl.java b/server/src/com/cloud/event/dao/EventJoinDaoImpl.java index 313c372..8a1578b 100644 --- a/server/src/com/cloud/event/dao/EventJoinDaoImpl.java +++ b/server/src/com/cloud/event/dao/EventJoinDaoImpl.java @@ -20,7 +20,6 @@ import java.util.List; import javax.ejb.Local; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.api.response.EventResponse; @@ -37,7 +36,6 @@ import com.cloud.utils.db.SearchCriteria; @Component @Local(value = {EventJoinDao.class}) public class EventJoinDaoImpl extends GenericDaoBase<EventJoinVO, Long> implements EventJoinDao { - public static final Logger s_logger = Logger.getLogger(EventJoinDaoImpl.class); private SearchBuilder<EventJoinVO> vrSearch; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/AbstractInvestigatorImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/AbstractInvestigatorImpl.java b/server/src/com/cloud/ha/AbstractInvestigatorImpl.java index 147cecd..b65865e 100644 --- a/server/src/com/cloud/ha/AbstractInvestigatorImpl.java +++ b/server/src/com/cloud/ha/AbstractInvestigatorImpl.java @@ -23,7 +23,6 @@ import java.util.Map; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; @@ -40,7 +39,6 @@ import com.cloud.utils.db.QueryBuilder; import com.cloud.utils.db.SearchCriteria.Op; public abstract class AbstractInvestigatorImpl extends AdapterBase implements Investigator { - private static final Logger s_logger = Logger.getLogger(AbstractInvestigatorImpl.class); @Inject private final HostDao _hostDao = null; @@ -90,32 +88,32 @@ public abstract class AbstractInvestigatorImpl extends AdapterBase implements In try { Answer pingTestAnswer = _agentMgr.send(hostId, new PingTestCommand(testHostIp)); if (pingTestAnswer == null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("host (" + testHostIp + ") returns Unknown (null) answer"); + if (logger.isDebugEnabled()) { + logger.debug("host (" + testHostIp + ") returns Unknown (null) answer"); } return Status.Unknown; } if (pingTestAnswer.getResult()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("host (" + testHostIp + ") has been successfully pinged, returning that host is up"); + if (logger.isDebugEnabled()) { + logger.debug("host (" + testHostIp + ") has been successfully pinged, returning that host is up"); } // computing host is available, but could not reach agent, return false return Status.Up; } else { - if (s_logger.isDebugEnabled()) { - s_logger.debug("host (" + testHostIp + ") cannot be pinged, returning Unknown (I don't know) state"); + if (logger.isDebugEnabled()) { + logger.debug("host (" + testHostIp + ") cannot be pinged, returning Unknown (I don't know) state"); } return Status.Unknown; } } catch (AgentUnavailableException e) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", trapped AgentUnavailableException returning Unknown state"); + if (logger.isDebugEnabled()) { + logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", trapped AgentUnavailableException returning Unknown state"); } return Status.Unknown; } catch (OperationTimedoutException e) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", trapped OperationTimedoutException returning Unknown state"); + if (logger.isDebugEnabled()) { + logger.debug("host (" + testHostIp + "): " + e.getLocalizedMessage() + ", trapped OperationTimedoutException returning Unknown state"); } return Status.Unknown; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/CheckOnAgentInvestigator.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/CheckOnAgentInvestigator.java b/server/src/com/cloud/ha/CheckOnAgentInvestigator.java index b2e333f..3a7fdf4 100644 --- a/server/src/com/cloud/ha/CheckOnAgentInvestigator.java +++ b/server/src/com/cloud/ha/CheckOnAgentInvestigator.java @@ -19,7 +19,6 @@ package com.cloud.ha; import javax.ejb.Local; import javax.inject.Inject; -import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.api.CheckVirtualMachineAnswer; @@ -34,7 +33,6 @@ import com.cloud.vm.VirtualMachine.PowerState; @Local(value = Investigator.class) public class CheckOnAgentInvestigator extends AdapterBase implements Investigator { - private final static Logger s_logger = Logger.getLogger(CheckOnAgentInvestigator.class); @Inject AgentManager _agentMgr; @@ -52,17 +50,17 @@ public class CheckOnAgentInvestigator extends AdapterBase implements Investigato try { CheckVirtualMachineAnswer answer = (CheckVirtualMachineAnswer)_agentMgr.send(vm.getHostId(), cmd); if (!answer.getResult()) { - s_logger.debug("Unable to get vm state on " + vm.toString()); + logger.debug("Unable to get vm state on " + vm.toString()); throw new UnknownVM(); } - s_logger.debug("Agent responded with state " + answer.getState().toString()); + logger.debug("Agent responded with state " + answer.getState().toString()); return answer.getState() == PowerState.PowerOn; } catch (AgentUnavailableException e) { - s_logger.debug("Unable to reach the agent for " + vm.toString() + ": " + e.getMessage()); + logger.debug("Unable to reach the agent for " + vm.toString() + ": " + e.getMessage()); throw new UnknownVM(); } catch (OperationTimedoutException e) { - s_logger.debug("Operation timed out for " + vm.toString() + ": " + e.getMessage()); + logger.debug("Operation timed out for " + vm.toString() + ": " + e.getMessage()); throw new UnknownVM(); } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/HighAvailabilityManagerExtImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerExtImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerExtImpl.java index 56db8ef..b2f8a96 100644 --- a/server/src/com/cloud/ha/HighAvailabilityManagerExtImpl.java +++ b/server/src/com/cloud/ha/HighAvailabilityManagerExtImpl.java @@ -64,8 +64,8 @@ public class HighAvailabilityManagerExtImpl extends HighAvailabilityManagerImpl protected class UsageServerMonitorTask extends ManagedContextRunnable { @Override protected void runInContext() { - if (s_logger.isInfoEnabled()) { - s_logger.info("checking health of usage server"); + if (logger.isInfoEnabled()) { + logger.info("checking health of usage server"); } try { @@ -80,8 +80,8 @@ public class HighAvailabilityManagerExtImpl extends HighAvailabilityManagerImpl isRunning = true; } } - if (s_logger.isDebugEnabled()) { - s_logger.debug("usage server running? " + isRunning + ", heartbeat: " + lastHeartbeat); + if (logger.isDebugEnabled()) { + logger.debug("usage server running? " + isRunning + ", heartbeat: " + lastHeartbeat); } } finally { txn.close(); @@ -98,7 +98,7 @@ public class HighAvailabilityManagerExtImpl extends HighAvailabilityManagerImpl _alertMgr.clearAlert(AlertManager.AlertType.ALERT_TYPE_USAGE_SERVER, 0, 0); } } catch (Exception ex) { - s_logger.warn("Error while monitoring usage job", ex); + logger.warn("Error while monitoring usage job", ex); } } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java index bec1fd5..880a400 100644 --- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java +++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java @@ -29,7 +29,6 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.apache.log4j.NDC; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; @@ -104,7 +103,6 @@ import com.cloud.vm.dao.VMInstanceDao; @Local(value = { HighAvailabilityManager.class }) public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvailabilityManager, ClusterManagerListener { - protected static final Logger s_logger = Logger.getLogger(HighAvailabilityManagerImpl.class); WorkerThread[] _workers; boolean _stopped; long _timeToSleep; @@ -209,13 +207,13 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai for (Investigator investigator : investigators) { hostState = investigator.isAgentAlive(host); if (hostState != null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug(investigator.getName() + " was able to determine host " + hostId + " is in " + hostState.toString()); + if (logger.isDebugEnabled()) { + logger.debug(investigator.getName() + " was able to determine host " + hostId + " is in " + hostState.toString()); } return hostState; } - if (s_logger.isDebugEnabled()) { - s_logger.debug(investigator.getName() + " unable to determine the state of the host. Moving on."); + if (logger.isDebugEnabled()) { + logger.debug(investigator.getName() + " unable to determine the state of the host. Moving on."); } } @@ -230,11 +228,11 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai } if (host.getHypervisorType() == HypervisorType.VMware || host.getHypervisorType() == HypervisorType.Hyperv) { - s_logger.info("Don't restart VMs on host " + host.getId() + " as it is a " + host.getHypervisorType().toString() + " host"); + logger.info("Don't restart VMs on host " + host.getId() + " as it is a " + host.getHypervisorType().toString() + " host"); return; } - s_logger.warn("Scheduling restart for VMs on host " + host.getId() + "-" + host.getName()); + logger.warn("Scheduling restart for VMs on host " + host.getId() + "-" + host.getName()); final List<VMInstanceVO> vms = _instanceDao.listByHostId(host.getId()); final DataCenterVO dcVO = _dcDao.findById(host.getDataCenterId()); @@ -266,13 +264,13 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai "Host [" + hostDesc + "] is down." + ((sb != null) ? sb.toString() : "")); for (VMInstanceVO vm : reorderedVMList) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Notifying HA Mgr of to restart vm " + vm.getId() + "-" + vm.getInstanceName()); + if (logger.isDebugEnabled()) { + logger.debug("Notifying HA Mgr of to restart vm " + vm.getId() + "-" + vm.getInstanceName()); } vm = _instanceDao.findByUuid(vm.getUuid()); Long hostId = vm.getHostId(); if (hostId != null && !hostId.equals(host.getId())) { - s_logger.debug("VM " + vm.getInstanceName() + " is not on down host " + host.getId() + " it is on other host " + logger.debug("VM " + vm.getInstanceName() + " is not on down host " + host.getId() + " it is on other host " + hostId + " VM HA is done"); continue; } @@ -285,14 +283,14 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai assert (type == WorkType.CheckStop || type == WorkType.ForceStop || type == WorkType.Stop); if (_haDao.hasBeenScheduled(vm.getId(), type)) { - s_logger.info("There's already a job scheduled to stop " + vm); + logger.info("There's already a job scheduled to stop " + vm); return; } HaWorkVO work = new HaWorkVO(vm.getId(), vm.getType(), type, Step.Scheduled, hostId, vm.getState(), 0, vm.getUpdated()); _haDao.persist(work); - if (s_logger.isDebugEnabled()) { - s_logger.debug("Scheduled " + work); + if (logger.isDebugEnabled()) { + logger.debug("Scheduled " + work); } wakeupWorkers(); } @@ -318,7 +316,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai Long hostId = vm.getHostId(); if (hostId == null) { try { - s_logger.debug("Found a vm that is scheduled to be restarted but has no host id: " + vm); + logger.debug("Found a vm that is scheduled to be restarted but has no host id: " + vm); _itMgr.advanceStop(vm.getUuid(), true); } catch (ResourceUnavailableException e) { assert false : "How do we hit this when force is true?"; @@ -333,13 +331,13 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai } if (vm.getHypervisorType() == HypervisorType.VMware || vm.getHypervisorType() == HypervisorType.Hyperv) { - s_logger.info("Skip HA for VMware VM or Hyperv VM" + vm.getInstanceName()); + logger.info("Skip HA for VMware VM or Hyperv VM" + vm.getInstanceName()); return; } if (!investigate) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("VM does not require investigation so I'm marking it as Stopped: " + vm.toString()); + if (logger.isDebugEnabled()) { + logger.debug("VM does not require investigation so I'm marking it as Stopped: " + vm.toString()); } AlertManager.AlertType alertType = AlertManager.AlertType.ALERT_TYPE_USERVM; @@ -357,8 +355,8 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai ") stopped unexpectedly on host " + hostDesc, "Virtual Machine " + vm.getHostName() + " (id: " + vm.getId() + ") running on host [" + vm.getHostId() + "] stopped unexpectedly."); - if (s_logger.isDebugEnabled()) { - s_logger.debug("VM is not HA enabled so we're done."); + if (logger.isDebugEnabled()) { + logger.debug("VM is not HA enabled so we're done."); } } @@ -378,7 +376,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai } if (vm.getHypervisorType() == HypervisorType.VMware) { - s_logger.info("Skip HA for VMware VM " + vm.getInstanceName()); + logger.info("Skip HA for VMware VM " + vm.getInstanceName()); return; } @@ -399,8 +397,8 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai hostId != null ? hostId : 0L, vm.getState(), maxRetries + 1, vm.getUpdated()); _haDao.persist(work); - if (s_logger.isInfoEnabled()) { - s_logger.info("Schedule vm for HA: " + vm); + if (logger.isInfoEnabled()) { + logger.info("Schedule vm for HA: " + vm); } wakeupWorkers(); @@ -415,7 +413,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai str.append(item.getId()).append(", "); } str.delete(str.length() - 2, str.length()).append("]"); - s_logger.info(str.toString()); + logger.info(str.toString()); return null; } @@ -426,7 +424,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai str.append(item.getId()).append(", "); } str.delete(str.length() - 2, str.length()).append("]"); - s_logger.info(str.toString()); + logger.info(str.toString()); return (System.currentTimeMillis() >> 10) + _investigateRetryInterval; } @@ -434,13 +432,13 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai VirtualMachine vm = _itMgr.findById(work.getInstanceId()); if (vm == null) { - s_logger.info("Unable to find vm: " + vmId); + logger.info("Unable to find vm: " + vmId); return null; } - s_logger.info("HA on " + vm); + logger.info("HA on " + vm); if (vm.getState() != work.getPreviousState() || vm.getUpdated() != work.getUpdateTime()) { - s_logger.info("VM " + vm + " has been changed. Current State = " + vm.getState() + " Previous State = " + work.getPreviousState() + " last updated = " + + logger.info("VM " + vm + " has been changed. Current State = " + vm.getState() + " Previous State = " + work.getPreviousState() + " last updated = " + vm.getUpdated() + " previous updated = " + work.getUpdateTime()); return null; } @@ -459,7 +457,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai if (host == null) { host = _hostDao.findByIdIncludingRemoved(work.getHostId()); if (host != null) { - s_logger.debug("VM " + vm.toString() + " is now no longer on host " + work.getHostId() + " as the host is removed"); + logger.debug("VM " + vm.toString() + " is now no longer on host " + work.getHostId() + " as the host is removed"); isHostRemoved = true; } } @@ -472,7 +470,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai if (work.getStep() == Step.Investigating) { if (!isHostRemoved) { if (vm.getHostId() == null || vm.getHostId() != work.getHostId()) { - s_logger.info("VM " + vm.toString() + " is now no longer on host " + work.getHostId()); + logger.info("VM " + vm.toString() + " is now no longer on host " + work.getHostId()); return null; } @@ -482,19 +480,19 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai try { alive = investigator.isVmAlive(vm, host); - s_logger.info(investigator.getName() + " found " + vm + " to be alive? " + alive); + logger.info(investigator.getName() + " found " + vm + " to be alive? " + alive); break; } catch (UnknownVM e) { - s_logger.info(investigator.getName() + " could not find " + vm); + logger.info(investigator.getName() + " could not find " + vm); } } boolean fenced = false; if (alive == null) { - s_logger.debug("Fencing off VM that we don't know the state of"); + logger.debug("Fencing off VM that we don't know the state of"); for (FenceBuilder fb : fenceBuilders) { Boolean result = fb.fenceOff(vm, host); - s_logger.info("Fencer " + fb.getName() + " returned " + result); + logger.info("Fencer " + fb.getName() + " returned " + result); if (result != null && result) { fenced = true; break; @@ -504,18 +502,18 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai } else if (!alive) { fenced = true; } else { - s_logger.debug("VM " + vm.getInstanceName() + " is found to be alive by " + investigator.getName()); + logger.debug("VM " + vm.getInstanceName() + " is found to be alive by " + investigator.getName()); if (host.getStatus() == Status.Up) { - s_logger.info(vm + " is alive and host is up. No need to restart it."); + logger.info(vm + " is alive and host is up. No need to restart it."); return null; } else { - s_logger.debug("Rescheduling because the host is not up but the vm is alive"); + logger.debug("Rescheduling because the host is not up but the vm is alive"); return (System.currentTimeMillis() >> 10) + _investigateRetryInterval; } } if (!fenced) { - s_logger.debug("We were unable to fence off the VM " + vm); + logger.debug("We were unable to fence off the VM " + vm); _alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodIdToDeployIn(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc, "Insufficient capacity to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc); @@ -538,7 +536,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai work.setStep(Step.Scheduled); _haDao.update(work.getId(), work); } else { - s_logger.debug("How come that HA step is Investigating and the host is removed? Calling forced Stop on Vm anyways"); + logger.debug("How come that HA step is Investigating and the host is removed? Calling forced Stop on Vm anyways"); try { _itMgr.advanceStop(vm.getUuid(), true); } catch (ResourceUnavailableException e) { @@ -557,22 +555,22 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai vm = _itMgr.findById(vm.getId()); if (!_forceHA && !vm.isHaEnabled()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("VM is not HA enabled so we're done."); + if (logger.isDebugEnabled()) { + logger.debug("VM is not HA enabled so we're done."); } return null; // VM doesn't require HA } if ((host == null || host.getRemoved() != null || host.getState() != Status.Up) && !volumeMgr.canVmRestartOnAnotherServer(vm.getId())) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("VM can not restart on another server."); + if (logger.isDebugEnabled()) { + logger.debug("VM can not restart on another server."); } return null; } if (work.getTimesTried() > _maxRetries) { - s_logger.warn("Retried to max times so deleting: " + vmId); + logger.warn("Retried to max times so deleting: " + vmId); return null; } @@ -590,33 +588,33 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai // First try starting the vm with its original planner, if it doesn't succeed send HAPlanner as its an emergency. _itMgr.advanceStart(vm.getUuid(), params, null); }catch (InsufficientCapacityException e){ - s_logger.warn("Failed to deploy vm " + vmId + " with original planner, sending HAPlanner"); + logger.warn("Failed to deploy vm " + vmId + " with original planner, sending HAPlanner"); _itMgr.advanceStart(vm.getUuid(), params, _haPlanners.get(0)); } VMInstanceVO started = _instanceDao.findById(vm.getId()); if (started != null && started.getState() == VirtualMachine.State.Running) { - s_logger.info("VM is now restarted: " + vmId + " on " + started.getHostId()); + logger.info("VM is now restarted: " + vmId + " on " + started.getHostId()); return null; } - if (s_logger.isDebugEnabled()) { - s_logger.debug("Rescheduling VM " + vm.toString() + " to try again in " + _restartRetryInterval); + if (logger.isDebugEnabled()) { + logger.debug("Rescheduling VM " + vm.toString() + " to try again in " + _restartRetryInterval); } } catch (final InsufficientCapacityException e) { - s_logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage()); + logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage()); _alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodIdToDeployIn(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc, "Insufficient capacity to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc); } catch (final ResourceUnavailableException e) { - s_logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage()); + logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage()); _alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodIdToDeployIn(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc, "The Storage is unavailable for trying to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc); } catch (ConcurrentOperationException e) { - s_logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage()); + logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage()); _alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodIdToDeployIn(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc, "The Storage is unavailable for trying to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc); } catch (OperationTimedoutException e) { - s_logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage()); + logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage()); _alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodIdToDeployIn(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc, "The Storage is unavailable for trying to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc); } @@ -642,7 +640,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai _itMgr.migrateAway(vm.getUuid(), srcHostId); return null; } catch (InsufficientServerCapacityException e) { - s_logger.warn("Insufficient capacity for migrating a VM."); + logger.warn("Insufficient capacity for migrating a VM."); _resourceMgr.maintenanceFailed(srcHostId); return (System.currentTimeMillis() >> 10) + _migrateRetryInterval; } @@ -652,8 +650,8 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai public void scheduleDestroy(VMInstanceVO vm, long hostId) { final HaWorkVO work = new HaWorkVO(vm.getId(), vm.getType(), WorkType.Destroy, Step.Scheduled, hostId, vm.getState(), 0, vm.getUpdated()); _haDao.persist(work); - if (s_logger.isDebugEnabled()) { - s_logger.debug("Scheduled " + work.toString()); + if (logger.isDebugEnabled()) { + logger.debug("Scheduled " + work.toString()); } wakeupWorkers(); } @@ -665,29 +663,29 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai protected Long destroyVM(HaWorkVO work) { final VirtualMachine vm = _itMgr.findById(work.getInstanceId()); - s_logger.info("Destroying " + vm.toString()); + logger.info("Destroying " + vm.toString()); try { if (vm.getState() != State.Destroyed) { - s_logger.info("VM is no longer in Destroyed state " + vm.toString()); + logger.info("VM is no longer in Destroyed state " + vm.toString()); return null; } if (vm.getHostId() != null) { _itMgr.destroy(vm.getUuid()); - s_logger.info("Successfully destroy " + vm); + logger.info("Successfully destroy " + vm); return null; } else { - if (s_logger.isDebugEnabled()) { - s_logger.debug(vm + " has already been stopped"); + if (logger.isDebugEnabled()) { + logger.debug(vm + " has already been stopped"); } return null; } } catch (final AgentUnavailableException e) { - s_logger.debug("Agnet is not available" + e.getMessage()); + logger.debug("Agnet is not available" + e.getMessage()); } catch (OperationTimedoutException e) { - s_logger.debug("operation timed out: " + e.getMessage()); + logger.debug("operation timed out: " + e.getMessage()); } catch (ConcurrentOperationException e) { - s_logger.debug("concurrent operation: " + e.getMessage()); + logger.debug("concurrent operation: " + e.getMessage()); } work.setTimesTried(work.getTimesTried() + 1); @@ -697,50 +695,50 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai protected Long stopVM(final HaWorkVO work) throws ConcurrentOperationException { VirtualMachine vm = _itMgr.findById(work.getInstanceId()); if (vm == null) { - s_logger.info("No longer can find VM " + work.getInstanceId() + ". Throwing away " + work); + logger.info("No longer can find VM " + work.getInstanceId() + ". Throwing away " + work); work.setStep(Step.Done); return null; } - s_logger.info("Stopping " + vm); + logger.info("Stopping " + vm); try { if (work.getWorkType() == WorkType.Stop) { _itMgr.advanceStop(vm.getUuid(), false); - s_logger.info("Successfully stopped " + vm); + logger.info("Successfully stopped " + vm); return null; } else if (work.getWorkType() == WorkType.CheckStop) { if ((vm.getState() != work.getPreviousState()) || vm.getUpdated() != work.getUpdateTime() || vm.getHostId() == null || vm.getHostId().longValue() != work.getHostId()) { - s_logger.info(vm + " is different now. Scheduled Host: " + work.getHostId() + " Current Host: " + + logger.info(vm + " is different now. Scheduled Host: " + work.getHostId() + " Current Host: " + (vm.getHostId() != null ? vm.getHostId() : "none") + " State: " + vm.getState()); return null; } _itMgr.advanceStop(vm.getUuid(), false); - s_logger.info("Stop for " + vm + " was successful"); + logger.info("Stop for " + vm + " was successful"); return null; } else if (work.getWorkType() == WorkType.ForceStop) { if ((vm.getState() != work.getPreviousState()) || vm.getUpdated() != work.getUpdateTime() || vm.getHostId() == null || vm.getHostId().longValue() != work.getHostId()) { - s_logger.info(vm + " is different now. Scheduled Host: " + work.getHostId() + " Current Host: " + + logger.info(vm + " is different now. Scheduled Host: " + work.getHostId() + " Current Host: " + (vm.getHostId() != null ? vm.getHostId() : "none") + " State: " + vm.getState()); return null; } _itMgr.advanceStop(vm.getUuid(), true); - s_logger.info("Stop for " + vm + " was successful"); + logger.info("Stop for " + vm + " was successful"); return null; } else { assert false : "Who decided there's other steps but didn't modify the guy who does the work?"; } } catch (final ResourceUnavailableException e) { - s_logger.debug("Agnet is not available" + e.getMessage()); + logger.debug("Agnet is not available" + e.getMessage()); } catch (OperationTimedoutException e) { - s_logger.debug("operation timed out: " + e.getMessage()); + logger.debug("operation timed out: " + e.getMessage()); } work.setTimesTried(work.getTimesTried() + 1); - if (s_logger.isDebugEnabled()) { - s_logger.debug("Stop was unsuccessful. Rescheduling"); + if (logger.isDebugEnabled()) { + logger.debug("Stop was unsuccessful. Rescheduling"); } return (System.currentTimeMillis() >> 10) + _stopRetryInterval; } @@ -849,12 +847,12 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai protected class CleanupTask extends ManagedContextRunnable { @Override protected void runInContext() { - s_logger.info("HA Cleanup Thread Running"); + logger.info("HA Cleanup Thread Running"); try { _haDao.cleanup(System.currentTimeMillis() - _timeBetweenFailures); } catch (Exception e) { - s_logger.warn("Error while cleaning up", e); + logger.warn("Error while cleaning up", e); } } } @@ -866,7 +864,7 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai @Override public void run() { - s_logger.info("Starting work"); + logger.info("Starting work"); while (!_stopped) { _managedContext.runWithContext(new Runnable() { @Override @@ -875,13 +873,13 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai } }); } - s_logger.info("Time to go home!"); + logger.info("Time to go home!"); } private void runWithContext() { HaWorkVO work = null; try { - s_logger.trace("Checking the database"); + logger.trace("Checking the database"); work = _haDao.take(_serverId); if (work == null) { try { @@ -890,13 +888,13 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai } return; } catch (final InterruptedException e) { - s_logger.info("Interrupted"); + logger.info("Interrupted"); return; } } NDC.push("work-" + work.getId()); - s_logger.info("Processing " + work); + logger.info("Processing " + work); try { final WorkType wt = work.getWorkType(); @@ -915,21 +913,21 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai } if (nextTime == null) { - s_logger.info("Completed " + work); + logger.info("Completed " + work); work.setStep(Step.Done); } else { - s_logger.info("Rescheduling " + work + " to try again at " + new Date(nextTime << 10)); + logger.info("Rescheduling " + work + " to try again at " + new Date(nextTime << 10)); work.setTimeToTry(nextTime); work.setTimesTried(work.getTimesTried() + 1); work.setServerId(null); work.setDateTaken(null); } } catch (Exception e) { - s_logger.warn("Encountered unhandled exception during HA process, reschedule retry", e); + logger.warn("Encountered unhandled exception during HA process, reschedule retry", e); long nextTime = (System.currentTimeMillis() >> 10) + _restartRetryInterval; - s_logger.info("Rescheduling " + work + " to try again at " + new Date(nextTime << 10)); + logger.info("Rescheduling " + work + " to try again at " + new Date(nextTime << 10)); work.setTimeToTry(nextTime); work.setTimesTried(work.getTimesTried() + 1); work.setServerId(null); @@ -941,13 +939,13 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai work.setUpdateTime(vm.getUpdated()); work.setPreviousState(vm.getState()); if (!Step.Done.equals(work.getStep()) && work.getTimesTried() >= _maxRetries) { - s_logger.warn("Giving up, retries max times for work: " + work); + logger.warn("Giving up, retries max times for work: " + work); work.setStep(Step.Done); } } _haDao.update(work.getId(), work); } catch (final Throwable th) { - s_logger.error("Caught this throwable, ", th); + logger.error("Caught this throwable, ", th); } finally { if (work != null) { NDC.pop(); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/KVMFencer.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/KVMFencer.java b/server/src/com/cloud/ha/KVMFencer.java index b5834ef..fb76d82 100644 --- a/server/src/com/cloud/ha/KVMFencer.java +++ b/server/src/com/cloud/ha/KVMFencer.java @@ -23,7 +23,6 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.alert.AlertManager; @@ -42,7 +41,6 @@ import com.cloud.vm.VirtualMachine; @Local(value = FenceBuilder.class) public class KVMFencer extends AdapterBase implements FenceBuilder { - private static final Logger s_logger = Logger.getLogger(KVMFencer.class); @Inject HostDao _hostDao; @@ -78,7 +76,7 @@ public class KVMFencer extends AdapterBase implements FenceBuilder { @Override public Boolean fenceOff(VirtualMachine vm, Host host) { if (host.getHypervisorType() != HypervisorType.KVM && host.getHypervisorType() != HypervisorType.LXC) { - s_logger.warn("Don't know how to fence non kvm hosts " + host.getHypervisorType()); + logger.warn("Don't know how to fence non kvm hosts " + host.getHypervisorType()); return null; } @@ -101,10 +99,10 @@ public class KVMFencer extends AdapterBase implements FenceBuilder { try { answer = (FenceAnswer)_agentMgr.send(h.getId(), fence); } catch (AgentUnavailableException e) { - s_logger.info("Moving on to the next host because " + h.toString() + " is unavailable"); + logger.info("Moving on to the next host because " + h.toString() + " is unavailable"); continue; } catch (OperationTimedoutException e) { - s_logger.info("Moving on to the next host because " + h.toString() + " is unavailable"); + logger.info("Moving on to the next host because " + h.toString() + " is unavailable"); continue; } if (answer != null && answer.getResult()) { @@ -118,7 +116,7 @@ public class KVMFencer extends AdapterBase implements FenceBuilder { "Fencing off host " + host.getId() + " did not succeed after asking " + i + " hosts. " + "Check Agent logs for more information."); - s_logger.error("Unable to fence off " + vm.toString() + " on " + host.toString()); + logger.error("Unable to fence off " + vm.toString() + " on " + host.toString()); return false; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java b/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java index 9f361b0..5835fbc 100644 --- a/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java +++ b/server/src/com/cloud/ha/ManagementIPSystemVMInvestigator.java @@ -21,7 +21,6 @@ import java.util.List; import javax.ejb.Local; import javax.inject.Inject; -import org.apache.log4j.Logger; import com.cloud.host.Host; import com.cloud.host.HostVO; @@ -34,7 +33,6 @@ import com.cloud.vm.VirtualMachine; @Local(value = {Investigator.class}) public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl { - private static final Logger s_logger = Logger.getLogger(ManagementIPSystemVMInvestigator.class); @Inject private final HostDao _hostDao = null; @@ -44,28 +42,28 @@ public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl { @Override public boolean isVmAlive(VirtualMachine vm, Host host) throws UnknownVM { if (!vm.getType().isUsedBySystem()) { - s_logger.debug("Not a System Vm, unable to determine state of " + vm + " returning null"); + logger.debug("Not a System Vm, unable to determine state of " + vm + " returning null"); } - if (s_logger.isDebugEnabled()) { - s_logger.debug("Testing if " + vm + " is alive"); + if (logger.isDebugEnabled()) { + logger.debug("Testing if " + vm + " is alive"); } if (vm.getHostId() == null) { - s_logger.debug("There's no host id for " + vm); + logger.debug("There's no host id for " + vm); throw new UnknownVM(); } HostVO vmHost = _hostDao.findById(vm.getHostId()); if (vmHost == null) { - s_logger.debug("Unable to retrieve the host by using id " + vm.getHostId()); + logger.debug("Unable to retrieve the host by using id " + vm.getHostId()); throw new UnknownVM(); } List<? extends Nic> nics = _networkMgr.getNicsForTraffic(vm.getId(), TrafficType.Management); if (nics.size() == 0) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Unable to find a management nic, cannot ping this system VM, unable to determine state of " + vm + " returning null"); + if (logger.isDebugEnabled()) { + logger.debug("Unable to find a management nic, cannot ping this system VM, unable to determine state of " + vm + " returning null"); } throw new UnknownVM(); } @@ -81,8 +79,8 @@ public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl { assert vmState != null; // In case of Status.Unknown, next host will be tried if (vmState == Status.Up) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("successfully pinged vm's private IP (" + vm.getPrivateIpAddress() + "), returning that the VM is up"); + if (logger.isDebugEnabled()) { + logger.debug("successfully pinged vm's private IP (" + vm.getPrivateIpAddress() + "), returning that the VM is up"); } return Boolean.TRUE; } else if (vmState == Status.Down) { @@ -91,8 +89,8 @@ public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl { Status vmHostState = testIpAddress(otherHost, vmHost.getPrivateIpAddress()); assert vmHostState != null; if (vmHostState == Status.Up) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("successfully pinged vm's host IP (" + vmHost.getPrivateIpAddress() + + if (logger.isDebugEnabled()) { + logger.debug("successfully pinged vm's host IP (" + vmHost.getPrivateIpAddress() + "), but could not ping VM, returning that the VM is down"); } return Boolean.FALSE; @@ -101,8 +99,8 @@ public class ManagementIPSystemVMInvestigator extends AbstractInvestigatorImpl { } } - if (s_logger.isDebugEnabled()) { - s_logger.debug("unable to determine state of " + vm + " returning null"); + if (logger.isDebugEnabled()) { + logger.debug("unable to determine state of " + vm + " returning null"); } throw new UnknownVM(); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/RecreatableFencer.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/RecreatableFencer.java b/server/src/com/cloud/ha/RecreatableFencer.java index 4aa7438..fbfc1a7 100644 --- a/server/src/com/cloud/ha/RecreatableFencer.java +++ b/server/src/com/cloud/ha/RecreatableFencer.java @@ -21,7 +21,6 @@ import java.util.List; import javax.ejb.Local; import javax.inject.Inject; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; @@ -35,7 +34,6 @@ import com.cloud.vm.VirtualMachine; @Component @Local(value = FenceBuilder.class) public class RecreatableFencer extends AdapterBase implements FenceBuilder { - private static final Logger s_logger = Logger.getLogger(RecreatableFencer.class); @Inject VolumeDao _volsDao; @Inject @@ -49,22 +47,22 @@ public class RecreatableFencer extends AdapterBase implements FenceBuilder { public Boolean fenceOff(VirtualMachine vm, Host host) { VirtualMachine.Type type = vm.getType(); if (type != VirtualMachine.Type.ConsoleProxy && type != VirtualMachine.Type.DomainRouter && type != VirtualMachine.Type.SecondaryStorageVm) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Don't know how to fence off " + type); + if (logger.isDebugEnabled()) { + logger.debug("Don't know how to fence off " + type); } return null; } List<VolumeVO> vols = _volsDao.findByInstance(vm.getId()); for (VolumeVO vol : vols) { if (!vol.isRecreatable()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Unable to fence off volumes that are not recreatable: " + vol); + if (logger.isDebugEnabled()) { + logger.debug("Unable to fence off volumes that are not recreatable: " + vol); } return null; } if (vol.getPoolType().isShared()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Unable to fence off volumes that are shared: " + vol); + if (logger.isDebugEnabled()) { + logger.debug("Unable to fence off volumes that are shared: " + vol); } return null; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/UserVmDomRInvestigator.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/UserVmDomRInvestigator.java b/server/src/com/cloud/ha/UserVmDomRInvestigator.java index 63d9bf0..e747c00 100644 --- a/server/src/com/cloud/ha/UserVmDomRInvestigator.java +++ b/server/src/com/cloud/ha/UserVmDomRInvestigator.java @@ -22,7 +22,6 @@ import java.util.List; import javax.ejb.Local; import javax.inject.Inject; -import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; @@ -41,7 +40,6 @@ import com.cloud.vm.dao.UserVmDao; @Local(value = {Investigator.class}) public class UserVmDomRInvestigator extends AbstractInvestigatorImpl { - private static final Logger s_logger = Logger.getLogger(UserVmDomRInvestigator.class); @Inject private final UserVmDao _userVmDao = null; @@ -55,14 +53,14 @@ public class UserVmDomRInvestigator extends AbstractInvestigatorImpl { @Override public boolean isVmAlive(VirtualMachine vm, Host host) throws UnknownVM { if (vm.getType() != VirtualMachine.Type.User) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Not a User Vm, unable to determine state of " + vm + " returning null"); + if (logger.isDebugEnabled()) { + logger.debug("Not a User Vm, unable to determine state of " + vm + " returning null"); } throw new UnknownVM(); } - if (s_logger.isDebugEnabled()) { - s_logger.debug("testing if " + vm + " is alive"); + if (logger.isDebugEnabled()) { + logger.debug("testing if " + vm + " is alive"); } // to verify that the VM is alive, we ask the domR (router) to ping the VM (private IP) UserVmVO userVm = _userVmDao.findById(vm.getId()); @@ -76,8 +74,8 @@ public class UserVmDomRInvestigator extends AbstractInvestigatorImpl { List<VirtualRouter> routers = _vnaMgr.getRoutersForNetwork(nic.getNetworkId()); if (routers == null || routers.isEmpty()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Unable to find a router in network " + nic.getNetworkId() + " to ping " + vm); + if (logger.isDebugEnabled()) { + logger.debug("Unable to find a router in network " + nic.getNetworkId() + " to ping " + vm); } continue; } @@ -97,16 +95,16 @@ public class UserVmDomRInvestigator extends AbstractInvestigatorImpl { return result; } - if (s_logger.isDebugEnabled()) { - s_logger.debug("Returning null since we're unable to determine state of " + vm); + if (logger.isDebugEnabled()) { + logger.debug("Returning null since we're unable to determine state of " + vm); } throw new UnknownVM(); } @Override public Status isAgentAlive(Host agent) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("checking if agent (" + agent.getId() + ") is alive"); + if (logger.isDebugEnabled()) { + logger.debug("checking if agent (" + agent.getId() + ") is alive"); } if (agent.getPodId() == null) { @@ -116,29 +114,29 @@ public class UserVmDomRInvestigator extends AbstractInvestigatorImpl { List<Long> otherHosts = findHostByPod(agent.getPodId(), agent.getId()); for (Long hostId : otherHosts) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("sending ping from (" + hostId + ") to agent's host ip address (" + agent.getPrivateIpAddress() + ")"); + if (logger.isDebugEnabled()) { + logger.debug("sending ping from (" + hostId + ") to agent's host ip address (" + agent.getPrivateIpAddress() + ")"); } Status hostState = testIpAddress(hostId, agent.getPrivateIpAddress()); assert hostState != null; // In case of Status.Unknown, next host will be tried if (hostState == Status.Up) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("ping from (" + hostId + ") to agent's host ip address (" + agent.getPrivateIpAddress() + + if (logger.isDebugEnabled()) { + logger.debug("ping from (" + hostId + ") to agent's host ip address (" + agent.getPrivateIpAddress() + ") successful, returning that agent is disconnected"); } return Status.Disconnected; // the computing host ip is ping-able, but the computing agent is down, report that the agent is disconnected } else if (hostState == Status.Down) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("returning host state: " + hostState); + if (logger.isDebugEnabled()) { + logger.debug("returning host state: " + hostState); } return Status.Down; } } // could not reach agent, could not reach agent's host, unclear what the problem is but it'll require more investigation... - if (s_logger.isDebugEnabled()) { - s_logger.debug("could not reach agent, could not reach agent's host, returning that we don't have enough information"); + if (logger.isDebugEnabled()) { + logger.debug("could not reach agent, could not reach agent's host, returning that we don't have enough information"); } return null; } @@ -167,21 +165,21 @@ public class UserVmDomRInvestigator extends AbstractInvestigatorImpl { try { Answer pingTestAnswer = _agentMgr.easySend(hostId, new PingTestCommand(routerPrivateIp, privateIp)); if (pingTestAnswer != null && pingTestAnswer.getResult()) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("user vm's " + vm.getHostName() + " ip address " + privateIp + " has been successfully pinged from the Virtual Router " + + if (logger.isDebugEnabled()) { + logger.debug("user vm's " + vm.getHostName() + " ip address " + privateIp + " has been successfully pinged from the Virtual Router " + router.getHostName() + ", returning that vm is alive"); } return Boolean.TRUE; } } catch (Exception e) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Couldn't reach due to", e); + if (logger.isDebugEnabled()) { + logger.debug("Couldn't reach due to", e); } continue; } } - if (s_logger.isDebugEnabled()) { - s_logger.debug(vm + " could not be pinged, returning that it is unknown"); + if (logger.isDebugEnabled()) { + logger.debug(vm + " could not be pinged, returning that it is unknown"); } return null; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/XenServerInvestigator.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/XenServerInvestigator.java b/server/src/com/cloud/ha/XenServerInvestigator.java index 07eb76b..8cdb80c 100644 --- a/server/src/com/cloud/ha/XenServerInvestigator.java +++ b/server/src/com/cloud/ha/XenServerInvestigator.java @@ -21,7 +21,6 @@ import java.util.List; import javax.ejb.Local; import javax.inject.Inject; -import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; @@ -38,7 +37,6 @@ import com.cloud.vm.VirtualMachine; @Local(value = Investigator.class) public class XenServerInvestigator extends AdapterBase implements Investigator { - private final static Logger s_logger = Logger.getLogger(XenServerInvestigator.class); @Inject HostDao _hostDao; @Inject @@ -65,7 +63,7 @@ public class XenServerInvestigator extends AdapterBase implements Investigator { if (answer != null && answer.getResult()) { CheckOnHostAnswer ans = (CheckOnHostAnswer)answer; if (!ans.isDetermined()) { - s_logger.debug("Host " + neighbor + " couldn't determine the status of " + agent); + logger.debug("Host " + neighbor + " couldn't determine the status of " + agent); continue; } // even it returns true, that means host is up, but XAPI may not work http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/ha/dao/HighAvailabilityDaoImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/ha/dao/HighAvailabilityDaoImpl.java b/server/src/com/cloud/ha/dao/HighAvailabilityDaoImpl.java index 724f4f6..4a88695 100644 --- a/server/src/com/cloud/ha/dao/HighAvailabilityDaoImpl.java +++ b/server/src/com/cloud/ha/dao/HighAvailabilityDaoImpl.java @@ -21,7 +21,6 @@ import java.util.List; import javax.ejb.Local; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import com.cloud.ha.HaWorkVO; @@ -38,7 +37,6 @@ import com.cloud.utils.exception.CloudRuntimeException; @Component @Local(value = {HighAvailabilityDao.class}) public class HighAvailabilityDaoImpl extends GenericDaoBase<HaWorkVO, Long> implements HighAvailabilityDao { - private static final Logger s_logger = Logger.getLogger(HighAvailabilityDaoImpl.class); private final SearchBuilder<HaWorkVO> TBASearch; private final SearchBuilder<HaWorkVO> PreviousInstanceSearch; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/hypervisor/CloudZonesStartupProcessor.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/hypervisor/CloudZonesStartupProcessor.java b/server/src/com/cloud/hypervisor/CloudZonesStartupProcessor.java index d407b84..8f562c8 100644 --- a/server/src/com/cloud/hypervisor/CloudZonesStartupProcessor.java +++ b/server/src/com/cloud/hypervisor/CloudZonesStartupProcessor.java @@ -23,7 +23,6 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.api.ResourceDetail; @@ -61,7 +60,6 @@ import com.cloud.utils.net.NetUtils; @Component @Local(value = StartupCommandProcessor.class) public class CloudZonesStartupProcessor extends AdapterBase implements StartupCommandProcessor { - private static final Logger s_logger = Logger.getLogger(CloudZonesStartupProcessor.class); @Inject ClusterDao _clusterDao = null; @Inject @@ -115,8 +113,8 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo server = _hostDao.findByGuid(startup.getGuidWithoutResource()); } if (server != null && server.getRemoved() == null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Found the host " + server.getId() + " by guid: " + if (logger.isDebugEnabled()) { + logger.debug("Found the host " + server.getId() + " by guid: " + startup.getGuid()); } found = true; @@ -140,7 +138,7 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo "Agent cannot connect because the current state is " + server.getStatus().toString()); } - s_logger.info("Old " + server.getType().toString() + logger.info("Old " + server.getType().toString() + " host reconnected w/ id =" + server.getId()); } */ @@ -152,7 +150,7 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo String zoneToken = startup.getDataCenter(); if (zoneToken == null) { - s_logger.warn("No Zone Token passed in, cannot not find zone for the agent"); + logger.warn("No Zone Token passed in, cannot not find zone for the agent"); throw new AgentAuthnException("No Zone Token passed in, cannot not find zone for agent"); } @@ -171,8 +169,8 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo } } } - if (s_logger.isDebugEnabled()) { - s_logger.debug("Successfully loaded the DataCenter from the zone token passed in "); + if (logger.isDebugEnabled()) { + logger.debug("Successfully loaded the DataCenter from the zone token passed in "); } long zoneId = zone.getId(); @@ -180,8 +178,8 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo if (maxHostsInZone != null) { long maxHosts = Long.parseLong(maxHostsInZone.getValue()); long currentCountOfHosts = _hostDao.countRoutingHostsByDataCenter(zoneId); - if (s_logger.isDebugEnabled()) { - s_logger.debug("Number of hosts in Zone:" + currentCountOfHosts + ", max hosts limit: " + maxHosts); + if (logger.isDebugEnabled()) { + logger.debug("Number of hosts in Zone:" + currentCountOfHosts + ", max hosts limit: " + maxHosts); } if (currentCountOfHosts >= maxHosts) { throw new AgentAuthnException("Number of running Routing hosts in the Zone:" + zone.getName() + " is already at the max limit:" + maxHosts + @@ -192,24 +190,24 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo HostPodVO pod = null; if (startup.getPrivateIpAddress() == null) { - s_logger.warn("No private IP address passed in for the agent, cannot not find pod for agent"); + logger.warn("No private IP address passed in for the agent, cannot not find pod for agent"); throw new AgentAuthnException("No private IP address passed in for the agent, cannot not find pod for agent"); } if (startup.getPrivateNetmask() == null) { - s_logger.warn("No netmask passed in for the agent, cannot not find pod for agent"); + logger.warn("No netmask passed in for the agent, cannot not find pod for agent"); throw new AgentAuthnException("No netmask passed in for the agent, cannot not find pod for agent"); } if (host.getPodId() != null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Pod is already created for this agent, looks like agent is reconnecting..."); + if (logger.isDebugEnabled()) { + logger.debug("Pod is already created for this agent, looks like agent is reconnecting..."); } pod = _podDao.findById(host.getPodId()); if (!checkCIDR(type, pod, startup.getPrivateIpAddress(), startup.getPrivateNetmask())) { pod = null; - if (s_logger.isDebugEnabled()) { - s_logger.debug("Subnet of Pod does not match the subnet of the agent, not using this Pod: " + host.getPodId()); + if (logger.isDebugEnabled()) { + logger.debug("Subnet of Pod does not match the subnet of the agent, not using this Pod: " + host.getPodId()); } } else { updatePodNetmaskIfNeeded(pod, startup.getPrivateNetmask()); @@ -217,8 +215,8 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo } if (pod == null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Trying to detect the Pod to use from the agent's ip address and netmask passed in "); + if (logger.isDebugEnabled()) { + logger.debug("Trying to detect the Pod to use from the agent's ip address and netmask passed in "); } //deduce pod @@ -236,12 +234,12 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo } if (!podFound) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Creating a new Pod since no default Pod found that matches the agent's ip address and netmask passed in "); + if (logger.isDebugEnabled()) { + logger.debug("Creating a new Pod since no default Pod found that matches the agent's ip address and netmask passed in "); } if (startup.getGatewayIpAddress() == null) { - s_logger.warn("No Gateway IP address passed in for the agent, cannot create a new pod for the agent"); + logger.warn("No Gateway IP address passed in for the agent, cannot create a new pod for the agent"); throw new AgentAuthnException("No Gateway IP address passed in for the agent, cannot create a new pod for the agent"); } //auto-create a new pod, since pod matching the agent's ip is not found @@ -266,8 +264,8 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo ClusterVO cluster = null; if (host.getClusterId() != null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Cluster is already created for this agent, looks like agent is reconnecting..."); + if (logger.isDebugEnabled()) { + logger.debug("Cluster is already created for this agent, looks like agent is reconnecting..."); } cluster = _clusterDao.findById(host.getClusterId()); } @@ -278,8 +276,8 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo if (existingCluster != null) { cluster = existingCluster; } else { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Creating a new Cluster for this agent with name: " + clusterName + " in Pod: " + pod.getId() + ", in Zone:" + zoneId); + if (logger.isDebugEnabled()) { + logger.debug("Creating a new Cluster for this agent with name: " + clusterName + " in Pod: " + pod.getId() + ", in Zone:" + zoneId); } cluster = new ClusterVO(zoneId, pod.getId(), clusterName); @@ -293,8 +291,8 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo } } - if (s_logger.isDebugEnabled()) { - s_logger.debug("Detected Zone: " + zoneId + ", Pod: " + pod.getId() + ", Cluster:" + cluster.getId()); + if (logger.isDebugEnabled()) { + logger.debug("Detected Zone: " + zoneId + ", Pod: " + pod.getId() + ", Cluster:" + cluster.getId()); } host.setDataCenterId(zone.getId()); host.setPodId(pod.getId()); @@ -370,8 +368,8 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo server = _hostDao.findByGuid(startup.getGuidWithoutResource()); } if (server != null && server.getRemoved() == null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Found the host " + server.getId() + " by guid: " + if (logger.isDebugEnabled()) { + logger.debug("Found the host " + server.getId() + " by guid: " + startup.getGuid()); } found = true; @@ -395,7 +393,7 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo "Agent cannot connect because the current state is " + server.getStatus().toString()); } - s_logger.info("Old " + server.getType().toString() + logger.info("Old " + server.getType().toString() + " host reconnected w/ id =" + server.getId()); } */ @@ -407,7 +405,7 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo String zoneToken = startup.getDataCenter(); if (zoneToken == null) { - s_logger.warn("No Zone Token passed in, cannot not find zone for the agent"); + logger.warn("No Zone Token passed in, cannot not find zone for the agent"); throw new AgentAuthnException("No Zone Token passed in, cannot not find zone for agent"); } @@ -426,14 +424,14 @@ public class CloudZonesStartupProcessor extends AdapterBase implements StartupCo } } } - if (s_logger.isDebugEnabled()) { - s_logger.debug("Successfully loaded the DataCenter from the zone token passed in "); + if (logger.isDebugEnabled()) { + logger.debug("Successfully loaded the DataCenter from the zone token passed in "); } HostPodVO pod = findPod(startup, zone.getId(), Host.Type.Routing); //yes, routing Long podId = null; if (pod != null) { - s_logger.debug("Found pod " + pod.getName() + " for the secondary storage host " + startup.getName()); + logger.debug("Found pod " + pod.getName() + " for the secondary storage host " + startup.getName()); podId = pod.getId(); } host.setDataCenterId(zone.getId());
