mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-10-26 08:42:29 +01:00 
			
		
		
		
	log messages (#9093)
* log messages * Apply suggestions from code review Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com> * Update plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterResourceModifierActionWorker.java Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com> --------- Co-authored-by: João Jandre <48719461+JoaoJandre@users.noreply.github.com> Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com>
This commit is contained in:
		
							parent
							
								
									19f96355ac
								
							
						
					
					
						commit
						0c615312f9
					
				| @ -948,7 +948,7 @@ public class VmwareStorageProcessor implements StorageProcessor { | |||||||
|                 dsMo.moveDatastoreFile(vmwareLayoutFilePair[i], dcMo.getMor(), dsMo.getMor(), legacyCloudStackLayoutFilePair[i], dcMo.getMor(), true); |                 dsMo.moveDatastoreFile(vmwareLayoutFilePair[i], dcMo.getMor(), dsMo.getMor(), legacyCloudStackLayoutFilePair[i], dcMo.getMor(), true); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             logger.info("detach disks from volume-wrapper VM and destroy" + vmdkName); |             logger.info("detach disks from volume-wrapper VM and destroy {}", vmdkName); | ||||||
|             vmMo.detachAllDisksAndDestroy(); |             vmMo.detachAllDisksAndDestroy(); | ||||||
| 
 | 
 | ||||||
|             String srcFile = dsMo.getDatastorePath(vmdkName, true); |             String srcFile = dsMo.getDatastorePath(vmdkName, true); | ||||||
|  | |||||||
| @ -515,9 +515,7 @@ public class KubernetesClusterManagerImpl extends ManagerBase implements Kuberne | |||||||
|                     logger.debug(String.format("Checking host ID: %s for capacity already reserved %d", hostVO.getUuid(), reserved)); |                     logger.debug(String.format("Checking host ID: %s for capacity already reserved %d", hostVO.getUuid(), reserved)); | ||||||
|                 } |                 } | ||||||
|                 if (capacityManager.checkIfHostHasCapacity(hostVO.getId(), cpu_requested * reserved, ram_requested * reserved, false, cpuOvercommitRatio, memoryOvercommitRatio, true)) { |                 if (capacityManager.checkIfHostHasCapacity(hostVO.getId(), cpu_requested * reserved, ram_requested * reserved, false, cpuOvercommitRatio, memoryOvercommitRatio, true)) { | ||||||
|                     if (logger.isDebugEnabled()) { |                     logger.debug("Found host ID == '{}' to have enough capacity, CPU={} RAM={}", hostVO.getUuid(), cpu_requested * reserved, toHumanReadableSize(ram_requested * reserved)); | ||||||
|                         logger.debug(String.format("Found host ID: %s for with enough capacity, CPU=%d RAM=%s", hostVO.getUuid(), cpu_requested * reserved, toHumanReadableSize(ram_requested * reserved))); |  | ||||||
|                     } |  | ||||||
|                     hostEntry.setValue(new Pair<HostVO, Integer>(hostVO, reserved)); |                     hostEntry.setValue(new Pair<HostVO, Integer>(hostVO, reserved)); | ||||||
|                     suitable_host_found = true; |                     suitable_host_found = true; | ||||||
|                     planCluster = cluster; |                     planCluster = cluster; | ||||||
|  | |||||||
| @ -263,9 +263,7 @@ public class KubernetesClusterResourceModifierActionWorker extends KubernetesClu | |||||||
|                     logger.debug(String.format("Checking host : %s for capacity already reserved %d", h.getName(), reserved)); |                     logger.debug(String.format("Checking host : %s for capacity already reserved %d", h.getName(), reserved)); | ||||||
|                 } |                 } | ||||||
|                 if (capacityManager.checkIfHostHasCapacity(h.getId(), cpu_requested * reserved, ram_requested * reserved, false, cpuOvercommitRatio, memoryOvercommitRatio, true)) { |                 if (capacityManager.checkIfHostHasCapacity(h.getId(), cpu_requested * reserved, ram_requested * reserved, false, cpuOvercommitRatio, memoryOvercommitRatio, true)) { | ||||||
|                     if (logger.isDebugEnabled()) { |                     logger.debug("Found host {} with enough capacity: CPU={} RAM={}", h.getName(), cpu_requested * reserved, toHumanReadableSize(ram_requested * reserved)); | ||||||
|                         logger.debug(String.format("Found host : %s for with enough capacity, CPU=%d RAM=%s", h.getName(), cpu_requested * reserved, toHumanReadableSize(ram_requested * reserved))); |  | ||||||
|                     } |  | ||||||
|                     hostEntry.setValue(new Pair<HostVO, Integer>(h, reserved)); |                     hostEntry.setValue(new Pair<HostVO, Integer>(h, reserved)); | ||||||
|                     suitable_host_found = true; |                     suitable_host_found = true; | ||||||
|                     break; |                     break; | ||||||
|  | |||||||
| @ -533,7 +533,7 @@ public class KubernetesClusterStartWorker extends KubernetesClusterResourceModif | |||||||
|         } |         } | ||||||
|         attachIsoKubernetesVMs(clusterVMs); |         attachIsoKubernetesVMs(clusterVMs); | ||||||
|         if (!KubernetesClusterUtil.isKubernetesClusterControlVmRunning(kubernetesCluster, publicIpAddress, publicIpSshPort.second(), startTimeoutTime)) { |         if (!KubernetesClusterUtil.isKubernetesClusterControlVmRunning(kubernetesCluster, publicIpAddress, publicIpSshPort.second(), startTimeoutTime)) { | ||||||
|             String msg = String.format("Failed to setup Kubernetes cluster : %s in usable state as unable to access control node VMs of the cluster", kubernetesCluster.getName()); |             String msg = String.format("Failed to setup Kubernetes cluster : %s is not in usable state as the system is unable to access control node VMs of the cluster", kubernetesCluster.getName()); | ||||||
|             if (kubernetesCluster.getControlNodeCount() > 1 && Network.GuestType.Shared.equals(network.getGuestType())) { |             if (kubernetesCluster.getControlNodeCount() > 1 && Network.GuestType.Shared.equals(network.getGuestType())) { | ||||||
|                 msg = String.format("%s. Make sure external load-balancer has port forwarding rules for SSH access on ports %d-%d and API access on port %d", |                 msg = String.format("%s. Make sure external load-balancer has port forwarding rules for SSH access on ports %d-%d and API access on port %d", | ||||||
|                         msg, |                         msg, | ||||||
|  | |||||||
| @ -266,13 +266,11 @@ public class KubernetesClusterUtil { | |||||||
|                 socket.connect(new InetSocketAddress(ipAddress, port), 10000); |                 socket.connect(new InetSocketAddress(ipAddress, port), 10000); | ||||||
|                 controlVmRunning = true; |                 controlVmRunning = true; | ||||||
|             } catch (IOException e) { |             } catch (IOException e) { | ||||||
|                 if (LOGGER.isInfoEnabled()) { |                 LOGGER.info("Waiting for Kubernetes cluster : {} control node VMs to be accessible", kubernetesCluster.getName()); | ||||||
|                     LOGGER.info(String.format("Waiting for Kubernetes cluster : %s control node VMs to be accessible", kubernetesCluster.getName())); |  | ||||||
|                 } |  | ||||||
|                 try { |                 try { | ||||||
|                     Thread.sleep(10000); |                     Thread.sleep(10000); | ||||||
|                 } catch (InterruptedException ex) { |                 } catch (InterruptedException ex) { | ||||||
|                     LOGGER.warn(String.format("Error while waiting for Kubernetes cluster : %s control node VMs to be accessible", kubernetesCluster.getName()), ex); |                     LOGGER.warn("Error while waiting for Kubernetes cluster : {} control node VMs to be accessible", kubernetesCluster.getName(), ex); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user