Beispiel #1
0
        private void ExecuteAllActionsForVMSS(ARMDeployment dep)
        {
            int instanceId = TryConvertInstanceNameToInstanceId(this.VMName);

            // TODO instead of using 0, take 5 random and use them
            instanceId = instanceId == -1 ? 0 : instanceId;

            Task <string> modelTask = null;

            SALsA.GetInstance(Id).ICM.QueueICMDiscussion(dep.ToString());
            SALsA.GetInstance(Id).TaskManager.AddTask(
                BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerConsoleSerialOutputFilename, GenevaActions.GetVMConsoleSerialLogs(Id, dep, instanceId), Id),
                BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerVMScreenshotOutputFilename, GenevaActions.GetVMConsoleScreenshot(Id, dep, instanceId), Id),
                BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerVMModelAndViewOutputFilename, modelTask = GenevaActions.GetVMModelAndInstanceView(Id, dep, instanceId), Id),
                BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerInspectIaaSDiskOutputFilename, GenevaActions.InspectIaaSDiskForARMVM(Id, dep, instanceId), Id)
                );
            var rawInfo = LogContainerId(modelTask, Id);

            if (rawInfo != null)
            {
                GlobalInfo.Update(
                    new Guid(rawInfo.ContainerId),
                    new Guid(rawInfo.NodeId),
                    rawInfo.Cluster
                    );
                SALsA.GetInstance(Id).TaskManager.AddTask(
                    BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerNodeDiagnosticsFilename, GenevaActions.GetNodeDiagnosticsFilesByContainerId(Id, GlobalInfo), Id)
                    );
            }
        }
Beispiel #2
0
        /*
         * private bool AnalyzeHost()
         * {
         *  var currentICM = SALsA.GetInstance(Id).ICM;
         *  var title = currentICM.CurrentICM.Title;
         *  var isHostIssue = Regex.Match(title, @"HostGAPlugin.*Cluster.*Node.*(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}", RegexOptions.IgnoreCase).Success;
         *  if (isHostIssue)
         *  {
         *      var splitTitle = title.ToLowerInvariant().Replace(" :", ":").Replace(": ", ":").Replace(",", " ").Replace(".", " ").Replace("nodeid", "node").Split(' ');
         *      splitTitle = Array.FindAll(splitTitle, s => s.Contains(":"));
         *      var dict = splitTitle.ToDictionary(
         *          k => k.Split(':')[0],
         *          e => e.Split(':')[1]
         *      );
         *      var cluster = dict["cluster"];
         *      var nodeid = dict["node"];
         *      var creationTime = currentICM.CurrentICM.CreateDate;
         *      var startTime = creationTime.AddHours(-12);
         *      var endTime = new DateTime(Math.Min(creationTime.AddHours(+12).Ticks, DateTime.UtcNow.Ticks));
         *      SALsA.GetInstance(Id).TaskManager.AddTask(
         *      Utility.SaveAndSendBlobTask(Constants.AnalyzerHostGAPluginFilename,
         *          GenevaActions.GetNodeDiagnosticsFiles(Id, cluster, nodeid, startTime.ToString("s"), endTime.ToString("s")), Id)
         *      );
         *  }
         *  return isHostIssue;
         * }
         */
        private void ExecuteAllActionsForIaaS(ARMDeployment dep)
        {
            Task <string> modelTask = null;

            SALsA.GetInstance(Id).ICM.QueueICMDiscussion(dep.ToString());
            SALsA.GetInstance(Id).TaskManager.AddTask(
                BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerConsoleSerialOutputFilename, GenevaActions.GetVMConsoleSerialLogs(Id, dep), Id),
                BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerVMScreenshotOutputFilename, GenevaActions.GetVMConsoleScreenshot(Id, dep), Id),
                BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerVMModelAndViewOutputFilename, modelTask = GenevaActions.GetVMModelAndInstanceView(Id, dep), Id),
                BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerInspectIaaSDiskOutputFilename, GenevaActions.InspectIaaSDiskForARMVM(Id, dep), Id)
                );

            var rawInfo = LogContainerId(modelTask, Id);

            if (rawInfo != null)
            {
                GlobalInfo.Update(
                    new Guid(rawInfo.ContainerId),
                    new Guid(rawInfo.NodeId),
                    rawInfo.Cluster
                    );
                var startTime = SALsA.GetInstance(Id).ICM.ICMImpactStartTime().AddHours(-12);
                var endTime   = new DateTime(Math.Min(startTime.AddHours(+24).Ticks, DateTime.UtcNow.Ticks));
                SALsA.GetInstance(Id).TaskManager.AddTask(
                    BlobStorageUtility.SaveAndSendBlobTask(Constants.AnalyzerNodeDiagnosticsFilename, GenevaActions.GetNodeDiagnosticsFilesByContainerId(Id, GlobalInfo), Id)
                    );
            }
        }