private void CallInternalCommon() { try { if (GlobalInfo.NodeId == Guid.Empty) { GlobalInfo.NodeId = new Guid(SALsA.GetInstance(Id).ICM.GetCustomField(Constants.AnalyzerNodeIdField)); } var startTime = SALsA.GetInstance(Id).ICM.ICMImpactStartTime().AddHours(-12); var endTime = new DateTime(Math.Min(startTime.AddHours(+24).Ticks, DateTime.UtcNow.Ticks)); GetAllNodeDiagnosticsFiles(GlobalInfo.Fabric, GlobalInfo.NodeId.ToString(), startTime.ToString("s"), endTime.ToString("s")); } catch (Exception ex) { Log.Critical("Failed to use GetAllNodeDiagnosticsFiles with exception : {0}", ex); Log.Exception(ex); } if (GlobalInfo.ContainerID != Guid.Empty) { ExecuteKustoContainerEnrichment(Id, GlobalInfo.ContainerID.ToString()); } if (GlobalInfo.ContainerID == GlobalInfo.NodeId) // If they are equal, it means Guid.Empty { SALsA.GetInstance(Id).State = SALsAState.MissingInfo; } SALsA.GetInstance(Id)?.ICM.QueueICMDiscussion(GlobalInfo.ToString()); }
private void ExecuteAllActionsForPaaS(RDFEDeployment dep) { var instance = dep.RoleInstances.Where(x => String.Equals(x.RoleInstanceName, VMName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); if (instance?.RoleInstanceName == null) { instance = dep.RoleInstances.Where(x => String.Equals(x.RoleInstanceName, TryConvertInstanceNameToVMName(this.VMName), StringComparison.OrdinalIgnoreCase)).FirstOrDefault(); } if (instance?.RoleInstanceName == null) { instance = dep.RoleInstances.Where(x => String.Equals(x.ID.ToString(), VMName)).FirstOrDefault(); } GlobalInfo = new ShortRDFERoleInstance { Icm = Id, Fabric = dep.FabricGeoId, DeploymentId = dep.Id, DeploymentName = dep.Name, ContainerID = instance.ID, InstanceName = instance.RoleInstanceName }; Task <string> modelTask = null; SALsA.GetInstance(Id).TaskManager.AddTask( BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerVMScreenshotOutputFilename, GenevaActions.GetClassicVMConsoleScreenshot(Id, GlobalInfo), Id), BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerNodeDiagnosticsFilename, GenevaActions.GetNodeDiagnosticsFilesByDeploymentIdorVMName(Id, GlobalInfo), Id), BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerContainerSettings, modelTask = GenevaActions.GetContainerSettings(Id, GlobalInfo), Id) ); try { var model = Utility.JsonToObject <Json2Class.ContainerSettings>(modelTask.Result); GlobalInfo.NodeId = new Guid(model.NodeId); } catch (Exception ex) { Log.Critical("Failed to populate NodeId"); Log.Exception(ex); } finally { SALsA.GetInstance(Id)?.ICM.QueueICMDiscussion(GlobalInfo.ToString()); } }