public bool CompareImageStoreConnectionString(WindowsFabricSettings newWindowsFabricSettings)
        {
            var oldImageStoreConnectionChars = FabricValidatorUtility.SecureStringToCharArray(this.ImageStoreConnectionString);
            var newImageStoreConnectionChars = FabricValidatorUtility.SecureStringToCharArray(
                newWindowsFabricSettings.GetParameter(
                    this.SectionName,
                    FabricValidatorConstants.ParameterNames.ImageStoreConnectionString).GetSecureValue(this.StoreName));

            if (FabricValidatorUtility.StartsWithIgnoreCase(oldImageStoreConnectionChars, FabricValidatorConstants.FileImageStoreConnectionStringPrefix))
            {
                if (!FabricValidatorUtility.StartsWithIgnoreCase(newImageStoreConnectionChars, FabricValidatorConstants.FileImageStoreConnectionStringPrefix))
                {
                    WriteError("the old image store connection string starts with file prefix but new one is not");
                    return(false);
                }

                return(CompareFileImageStoreConnectionString(new string(oldImageStoreConnectionChars), new string(newImageStoreConnectionChars)));
            }
            else if (FabricValidatorUtility.StartsWithIgnoreCase(oldImageStoreConnectionChars, FabricValidatorConstants.XStoreImageStoreConnectionStringPrefix))
            {
                if (!FabricValidatorUtility.StartsWithIgnoreCase(newImageStoreConnectionChars, FabricValidatorConstants.XStoreImageStoreConnectionStringPrefix))
                {
                    WriteError("the old image store connection string starts with xstore prefix but new one is not");
                    return(false);
                }

                return(CompareXStoreImageStoreConnectionString(new string(oldImageStoreConnectionChars), new string(newImageStoreConnectionChars)));
            }
            else if (FabricValidatorUtility.StartsWithIgnoreCase(oldImageStoreConnectionChars, FabricValidatorConstants.FabricImageStoreConnectionStringPrefix))
            {
                if (!FabricValidatorUtility.StartsWithIgnoreCase(newImageStoreConnectionChars, FabricValidatorConstants.FabricImageStoreConnectionStringPrefix))
                {
                    WriteError("the old image store connection string starts with fabric prefix but new one is not");
                    return(false);
                }

                return(CompareFabricImageStoreConnectionString(new string(oldImageStoreConnectionChars), new string(newImageStoreConnectionChars)));
            }
            else if (FabricValidatorUtility.StartsWithIgnoreCase(oldImageStoreConnectionChars, FabricValidatorConstants.DefaultTag))
            {
                if (!FabricValidatorUtility.StartsWithIgnoreCase(newImageStoreConnectionChars, FabricValidatorConstants.DefaultTag))
                {
                    WriteError("the old image store connection string starts with default prefix but new one is not");
                    return(false);
                }
                return(true);
            }
            else
            {
                WriteError(
                    "Value for section {0} parameter {1} should start with {2}, {3} or {4}",
                    this.SectionName,
                    FabricValidatorConstants.ParameterNames.ImageStoreConnectionString,
                    FabricValidatorConstants.XStoreImageStoreConnectionStringPrefix,
                    FabricValidatorConstants.FileImageStoreConnectionStringPrefix,
                    FabricValidatorConstants.FabricImageStoreConnectionStringPrefix);
                return(false);
            }
        }
        public override void ValidateConfiguration(WindowsFabricSettings windowsFabricSettings)
        {
            var settingsForThisSection = windowsFabricSettings.GetSection(this.SectionName);

            if (settingsForThisSection.ContainsKey(FabricValidatorConstants.ParameterNames.PlacementConstraints))
            {
                FabricValidatorUtility.ValidateExpression(settingsForThisSection, FabricValidatorConstants.ParameterNames.PlacementConstraints);
            }
        }
        public override void ValidateConfiguration(WindowsFabricSettings windowsFabricSettings)
        {
            var settingsForThisSection = windowsFabricSettings.GetSection(this.SectionName);

            ValueValidator.VerifyIntValueGreaterThanInput(settingsForThisSection, FabricValidatorConstants.ParameterNames.TargetReplicaSetSize, 0, SectionName);
            ValueValidator.VerifyIntValueGreaterThanInput(settingsForThisSection, FabricValidatorConstants.ParameterNames.MinReplicaSetSize, 0, SectionName);
            ValueValidator.VerifyFirstIntParameterGreaterThanOrEqualToSecondIntParameter(settingsForThisSection, FabricValidatorConstants.ParameterNames.TargetReplicaSetSize, FabricValidatorConstants.ParameterNames.MinReplicaSetSize, SectionName);
            FabricValidatorUtility.ValidateExpression(settingsForThisSection, FabricValidatorConstants.ParameterNames.PlacementConstraints);
        }
Beispiel #4
0
        public FabricValidatorBlackbird(ClusterManifestType clusterManifest, List <InfrastructureNodeType> infrastructureInformation, WindowsFabricSettings windowsFabricSettings)
            : base(clusterManifest, infrastructureInformation, windowsFabricSettings)
        {
            ReleaseAssert.AssertIf(clusterManifest == null, "clusterManifest should be non-null");

            ReleaseAssert.AssertIfNot(
                clusterManifest.Infrastructure.Item is ClusterManifestTypeInfrastructureBlackbird,
                "Only ClusterManifestTypeInfrastructureBlackbird is supported by ServerDeployer");

            this.IsScaleMin = infrastructureInformation != null && FabricValidatorUtility.IsNodeListScaleMin(this.infrastructureInformation);
        }
        public static void WriteXml <T>(string fileName, T value)
        {
            XmlWriterSettings settings = new XmlWriterSettings();

            settings.Indent = true;
            using (FileStream filestream = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read))
            {
                using (XmlWriter writer = XmlWriter.Create(filestream, settings))
                {
                    FabricValidatorUtility.WriteXml <T>(writer, value);
                }
            }
        }
Beispiel #6
0
        public void Validate()
        {
            if (!FabricValidatorUtility.IsValidFileName(this.clusterManifest.Version))
            {
                throw new ArgumentException("cluster manifest version is not valid");
            }

            fabricSettingsValidator.ValidateSettings();
            this.ValidateNodeTypes();
            this.ValidateNodeList();
            fabricSettingsValidator.ValidateImageStore(this.IsSingleMachineDeployment);
            this.ValidateInfrastructure();
            ValidateClusterManifestVersion(this.clusterManifest);
        }
        public static T ReadXml <T>(string fileName)
        {
#if !DotNetCoreClr
            using (XmlReader reader = XmlReader.Create(fileName, new XmlReaderSettings()
            {
                XmlResolver = null
            }))
#else
            using (XmlReader reader = XmlReader.Create(fileName))
#endif
            {
                return(FabricValidatorUtility.ReadXml <T>(reader));
            }
        }
            public SecureString GetSecureValue(string storeName)
            {
                if (this.IsEncrypted)
                {
                    return(FabricValidatorUtility.DecryptValue(storeName, this.Value));
                }
                else
                {
                    if (string.IsNullOrEmpty(this.Value))
                    {
                        return(null);
                    }

                    return(FabricValidatorUtility.CharArrayToSecureString(this.Value.ToCharArray()));
                }
            }
        public static SecureString GetSecureValue(this SettingsOverridesTypeSectionParameter parameter, string storeName)
        {
            if (parameter.IsEncrypted)
            {
                return(FabricValidatorUtility.DecryptValue(storeName, parameter.Value));
            }
            else
            {
                if (string.IsNullOrEmpty(parameter.Value))
                {
                    return(null);
                }

                return(FabricValidatorUtility.CharArrayToSecureString(parameter.Value.ToCharArray()));
            }
        }
        public static bool IsNodeListScaleMin(List <InfrastructureNodeType> nodeList)
        {
            bool nodeFound = false;

            foreach (var node in nodeList)
            {
                if (FabricValidatorUtility.IsNodeForThisMachine(node))
                {
                    if (nodeFound)
                    {
                        return(true);
                    }

                    nodeFound = true;
                }
            }

            return(false);
        }
Beispiel #11
0
        public void ValidateSettings()
        {
            if (this.allTVSSettings.Count > 0)
            {
                this.IsTVSEnabled = true;

                if (!this.runAsPolicyEnabled)
                {
                    throw new ArgumentException(
                              string.Format(
                                  "RunAsPolicyEnabled should be set to true when enabling TokenValidationService"));
                }

                foreach (Dictionary <string, WindowsFabricSettings.SettingsValue> tvsSettings in this.allTVSSettings.Values)
                {
                    bool hasDSTSProvider = true;

                    if (tvsSettings.ContainsKey(FabricValidatorConstants.ParameterNames.Providers))
                    {
                        var providers = tvsSettings[FabricValidatorConstants.ParameterNames.Providers].Value.Split(
                            new char[] { ',' },
                            StringSplitOptions.RemoveEmptyEntries);

                        hasDSTSProvider = (providers.Length < 1);

                        if (!hasDSTSProvider)
                        {
                            foreach (var provider in providers)
                            {
                                if (string.Equals(provider, FabricValidatorConstants.Provider_DSTS, StringComparison.OrdinalIgnoreCase))
                                {
                                    hasDSTSProvider = true;
                                    break;
                                }
                            }
                        }
                    }

                    if (!hasDSTSProvider)
                    {
                        break;
                    }

                    if (!tvsSettings.ContainsKey(FabricValidatorConstants.ParameterNames.DSTSDnsName) ||
                        String.IsNullOrEmpty(tvsSettings[FabricValidatorConstants.ParameterNames.DSTSDnsName].Value))
                    {
                        throw new ArgumentException(
                                  string.Format(
                                      "ValidateTokenValidationServiceSettings failed as DSTSDnsName is not specified"));
                    }

                    if (!tvsSettings.ContainsKey(FabricValidatorConstants.ParameterNames.DSTSRealm) ||
                        String.IsNullOrEmpty(tvsSettings[FabricValidatorConstants.ParameterNames.DSTSRealm].Value))
                    {
                        throw new ArgumentException(
                                  string.Format(
                                      "ValidateTokenValidationServiceSettings failed as DSTSRealm is not specified"));
                    }

                    if (!tvsSettings.ContainsKey(FabricValidatorConstants.ParameterNames.DSTSWinFabServiceDnsName) ||
                        String.IsNullOrEmpty(tvsSettings[FabricValidatorConstants.ParameterNames.DSTSWinFabServiceDnsName].Value))
                    {
                        throw new ArgumentException(
                                  string.Format(
                                      "ValidateTokenValidationServiceSettings failed as DSTSMetadataServiceDnsName is not specified"));
                    }

                    if (!tvsSettings.ContainsKey(FabricValidatorConstants.ParameterNames.DSTSWinFabServiceName) ||
                        String.IsNullOrEmpty(tvsSettings[FabricValidatorConstants.ParameterNames.DSTSWinFabServiceName].Value))
                    {
                        throw new ArgumentException(
                                  string.Format(
                                      "ValidateTokenValidationServiceSettings failed as DSTSWinFabServiceName is not specified"));
                    }

                    if (tvsSettings.ContainsKey(FabricValidatorConstants.ParameterNames.PlacementConstraints))
                    {
                        FabricValidatorUtility.ValidateExpression(tvsSettings, FabricValidatorConstants.ParameterNames.PlacementConstraints);
                    }
                }

                //
                // Metadata endpoint is exposed via the httpgateway, so validate its settings according to TVS requirements.
                //
                ValidateHttpGatewaySettingsForTVS();
            }
        }
 public static bool NotEquals(string string1, string string2)
 {
     return(!FabricValidatorUtility.EqualsIgnoreCase(string1, string2));
 }
 public FabricValidatorAzure(ClusterManifestType clusterManifest, List <InfrastructureNodeType> infrastructureInformation, WindowsFabricSettings windowsFabricSettings)
     : base(clusterManifest, infrastructureInformation, windowsFabricSettings)
 {
     this.infrastructure = clusterManifest.Infrastructure;
     this.IsScaleMin     = infrastructureInformation != null && FabricValidatorUtility.IsNodeListScaleMin(this.infrastructureInformation);
 }
        protected override void ValidateInfrastructure()
        {
            TopologyProvider.TopologyProviderType topologyProviderType = TopologyProvider.GetTopologyProviderTypeFromClusterManifestTypeInfrastructure(this.infrastructure);

            if (topologyProviderType == TopologyProvider.TopologyProviderType.ServiceRuntimeTopologyProvider)
            {
                ValidateInfrastructureWithServiceRuntimeTopologyProvider(this.infrastructure.Item as ClusterManifestTypeInfrastructureWindowsAzure);
            }
            else if (topologyProviderType == TopologyProvider.TopologyProviderType.StaticTopologyProvider)
            {
                ValidateInfrastructureWithStaticTopologyProvider(this.infrastructure.Item as ClusterManifestTypeInfrastructureWindowsAzureStaticTopology);
            }

#if !DotNetCoreClr
            if (this.IsV2NodeIdGeneratorEnabled &&
                (this.NodeIdGeneratorVersion.Equals("V3", StringComparison.InvariantCultureIgnoreCase) ||
                 this.NodeIdGeneratorVersion.Equals("V4", StringComparison.InvariantCultureIgnoreCase)))
#else
            if (this.IsV2NodeIdGeneratorEnabled && (this.NodeIdGeneratorVersion.Equals("V3") || this.NodeIdGeneratorVersion.Equals("V4")))
#endif
            {
                throw new ArgumentException(FabricValidatorUtility.TraceTag, "V2 and V3/V4 NodeIdGenerator cannot be enabled simultaneously.");
            }

#if !DotNetCoreClr
            if (!string.IsNullOrEmpty(this.NodeIdGeneratorVersion) &&
                !this.NodeIdGeneratorVersion.Equals("V3", StringComparison.InvariantCultureIgnoreCase) &&
                !this.NodeIdGeneratorVersion.Equals("V4", StringComparison.InvariantCultureIgnoreCase))
#else
            if (!string.IsNullOrEmpty(this.NodeIdGeneratorVersion) &&
                !this.NodeIdGeneratorVersion.Equals("V3") &&
                !this.NodeIdGeneratorVersion.Equals("V4"))
#endif
            {
                throw new ArgumentException(FabricValidatorUtility.TraceTag, "v3/V3 and v4/V4 are the only allowed values for the NodeIdGeneratorVersion configuration.");
            }

            if (this.DiagnosticsFileStoreConnectionString != null)
            {
                char[] secureFileStoreConnection = FabricValidatorUtility.SecureStringToCharArray(this.DiagnosticsFileStoreConnectionString);
                try
                {
                    if (!FabricValidatorUtility.StartsWithIgnoreCase(secureFileStoreConnection, FabricValidatorConstants.XStoreImageStoreConnectionStringPrefix))
                    {
                        throw new ArgumentException(FabricValidatorUtility.TraceTag, "Only xstore store diagnostics file connection string is officially supported for file stores in azure deployment.");
                    }
                }
                finally
                {
                    Array.Clear(secureFileStoreConnection, 0, secureFileStoreConnection.Length);
                }
            }

            if (this.DiagnosticsTableStoreConnectionString != null)
            {
                char[] secureTableStoreConnection = FabricValidatorUtility.SecureStringToCharArray(this.DiagnosticsTableStoreConnectionString);
                try
                {
                    if (!FabricValidatorUtility.StartsWithIgnoreCase(secureTableStoreConnection, FabricValidatorConstants.XStoreImageStoreConnectionStringPrefix))
                    {
                        throw new ArgumentException("Only xstore store diagnostics table connection string is officially supported for table stores in azure deployment.");
                    }
                }
                finally
                {
                    Array.Clear(secureTableStoreConnection, 0, secureTableStoreConnection.Length);
                }
            }
        }
 public void WriteWarning(string traceTag, string format, params object[] args)
 {
     FabricValidatorUtility.WriteWarningInVSOutputFormat(traceTag, format, args);
 }
Beispiel #16
0
        private void ValidateNodeList()
        {
            if (this.infrastructureInformation == null)
            {
                FabricValidator.TraceSource.WriteWarning(
                    FabricValidatorUtility.TraceTag,
                    "Skipping node list validation as it is empty");
                return;
            }

            //Validate StartPort and EndPort number and range
            if (clusterManifest.Infrastructure.Item is ClusterManifestTypeInfrastructureWindowsAzure)
            {
                foreach (InfrastructureNodeType infra in this.infrastructureInformation)
                {
                    try
                    {
                        if (infra.Endpoints.ApplicationEndpoints.StartPort < 0 || infra.Endpoints.ApplicationEndpoints.EndPort < 0)
                        {
                            throw new ArgumentException(
                                      string.Format(
                                          StringResources.Warning_FabricValidatorStartEndPortNegative, infra.NodeName));
                        }

                        if (infra.Endpoints.ApplicationEndpoints.StartPort > infra.Endpoints.ApplicationEndpoints.EndPort)
                        {
                            throw new ArgumentException(
                                      string.Format(
                                          StringResources.Warning_FabricValidatorPortRangeInvalid, infra.NodeName));
                        }

                        //Validate the other five ports
                        ValidateEndpointsPortsHelper(infra.Endpoints.ClientConnectionEndpoint.Port, infra.NodeName, "ClientConnectionEndpoint");
                        ValidateEndpointsPortsHelper(infra.Endpoints.LeaseDriverEndpoint.Port, infra.NodeName, "LeaseDriverEndpoint");
                        ValidateEndpointsPortsHelper(infra.Endpoints.ClusterConnectionEndpoint.Port, infra.NodeName, "ClusterConnectionEndpoint");
                        ValidateEndpointsPortsHelper(infra.Endpoints.HttpGatewayEndpoint.Port, infra.NodeName, "HttpGatewayEndpoint");
                        // TODO add validation for http app gateway endpoint
                        // ValidateEndpointsPortsHelper(infra.Endpoints.HttpApplicationGatewayEndpoint.Port, infra.NodeName, "HttpApplicationGatewayEndpoint");
                        ValidateEndpointsPortsHelper(infra.Endpoints.ServiceConnectionEndpoint.Port, infra.NodeName, "ServiceConnectionEndpoint");
                    }
                    catch (NullReferenceException)
                    {
                        FabricValidator.TraceSource.WriteWarning(
                            FabricValidatorUtility.TraceTag,
                            StringResources.Info_FabricValidatorPortsNull);
                        return;
                    }
                }
            }


#if DotNetCoreClrLinux
            var isServer = clusterManifest.Infrastructure.Item is ClusterManifestTypeInfrastructureLinux;
#else
            var isServer = clusterManifest.Infrastructure.Item is ClusterManifestTypeInfrastructureWindowsServer;
#endif
            if (isServer || clusterManifest.Infrastructure.Item is ClusterManifestTypeInfrastructureWindowsAzureStaticTopology)
            {
                foreach (InfrastructureNodeType infra in this.infrastructureInformation)
                {
                    if (Helpers.isIPV6AddressAndNoBracket(infra.IPAddressOrFQDN))
                    {
                        throw new ArgumentException(StringResources.Error_BracketsAroundIPV6AddressAreMandatory, infra.NodeName);
                    }
                }
            }

            int voteCount = this.NonSeedVoteCount;
            ClusterManifestTypeInfrastructurePaaS paasInfrastructure = clusterManifest.Infrastructure.Item as ClusterManifestTypeInfrastructurePaaS;
            if (paasInfrastructure != null)
            {
                voteCount += paasInfrastructure.Votes.Count();
            }

            bool   matchingLocalNodeFound = false;
            string prevMachine            = this.infrastructureInformation[0].IPAddressOrFQDN;

            if (this.IsScaleMin && !NetworkApiHelper.IsNodeForThisMachine(this.infrastructureInformation[0]))
            {
                this.DoMachineAndNodeHaveSameIPInScaleMin = false;
            }

            bool             hasLoopbackAddressDefined = false;
            HashSet <string> nodeNameDuplicateDetector = new HashSet <string>();
            List <string>    faultDomains = new List <string>();
            foreach (InfrastructureNodeType fabricNode in this.infrastructureInformation)
            {
                ClusterManifestTypeNodeType nodeType = this.clusterManifest.NodeTypes.FirstOrDefault(nodeTypeVar => FabricValidatorUtility.EqualsIgnoreCase(nodeTypeVar.Name, fabricNode.NodeTypeRef));

                if (nodeType == null)
                {
                    if (!(this.DeploymentOperation == DeploymentOperations.Update && this.clusterManifest.Infrastructure.Item is ClusterManifestTypeInfrastructurePaaS))
                    {
                        throw new ArgumentException(
                                  string.Format(
                                      "Node '{0}' has attribute NodeTypeRef='{1}'. However, no NodeType with name {1} exists.",
                                      fabricNode.NodeName,
                                      fabricNode.NodeTypeRef));
                    }
                }

                if (fabricNode.IsSeedNode)
                {
                    voteCount++;
                }

                faultDomains.Add(fabricNode.FaultDomain);
                if (!FabricValidatorUtility.IsValidFileName(fabricNode.NodeName))
                {
                    throw new ArgumentException(
                              string.Format(
                                  "Invalid character found in node name {0}. Node name should be a valid file name.",
                                  fabricNode.NodeName));
                }

                if (!FabricValidatorUtility.IsValidIPAddressOrFQDN(fabricNode.IPAddressOrFQDN))
                {
                    throw new ArgumentException(
                              string.Format(
                                  "Malformed IPAddressOrFQDN found {0}.",
                                  fabricNode.IPAddressOrFQDN));
                }

                if (nodeNameDuplicateDetector.Contains(fabricNode.NodeName))
                {
                    throw new ArgumentException(
                              string.Format(
                                  "Duplicate node name {0} found.",
                                  fabricNode.NodeName));
                }
                else
                {
                    nodeNameDuplicateDetector.Add(fabricNode.NodeName);
                }

                if (fabricNode.IPAddressOrFQDN != prevMachine &&
                    !FabricValidatorUtility.IsNodeAddressLoopback(fabricNode))
                {
                    this.IsSingleMachineDeployment = false;
                }

                if (!hasLoopbackAddressDefined)
                {
                    hasLoopbackAddressDefined = FabricValidatorUtility.IsNodeAddressLoopback(fabricNode);
                }

                FabricValidator.TraceSource.WriteNoise(
                    FabricValidatorUtility.TraceTag,
                    "fabricNode is {0}", fabricNode);

                if (!FabricValidatorUtility.IsNodeForThisMachine(fabricNode))
                {
                    continue;
                }

                if (matchingLocalNodeFound && !this.IsScaleMin)
                {
                    throw new ArgumentException(
                              string.Format(
                                  "The IPAddressorFQDN value in node '{0}' is {1}. Another node is also configured to run on the same machine. " +
                                  "Running multiple nodes on the same machine is not valid in the specified infrastructure.",
                                  fabricNode.NodeName,
                                  fabricNode.IPAddressOrFQDN));
                }
                else
                {
                    matchingLocalNodeFound = true;
                    FabricValidatorUtility.ValidateDomainUri(fabricNode.FaultDomain, fabricNode.NodeName);
                }
            }

            int fdPathCount = -1;
            foreach (string faultDomain in faultDomains)
            {
                if (!string.IsNullOrEmpty(faultDomain))
                {
                    int currentfdPathCount = faultDomain.Split('/').Length;
                    if (fdPathCount == -1)
                    {
                        fdPathCount = currentfdPathCount;
                    }
                    if (fdPathCount != currentfdPathCount)
                    {
                        throw new ArgumentException("All FaultDomains should have the same depth.");
                    }
                }
            }

            if (!matchingLocalNodeFound)
            {
                FabricValidator.TraceSource.WriteWarning(
                    FabricValidatorUtility.TraceTag,
                    "None of the declared nodes is for the current machine.");
            }

            if (!this.IsSingleMachineDeployment && hasLoopbackAddressDefined)
            {
                throw new ArgumentException("Even though the deployment is split over multiple machines there is at least one node with a loopback address");
            }

            if (voteCount == 0)
            {
                throw new ArgumentException("No votes specified. Either seed nodes or sql vote specification is required for cluster to bootstrap");
            }

            if (!this.DoMachineAndNodeHaveSameIPInScaleMin)
            {
                FabricValidator.TraceSource.WriteWarning(
                    FabricValidatorUtility.TraceTag,
                    StringResources.Warning_FirstNodeAndMachineHaveDifferentIP);
                return;
            }
        }
        public override void ValidateConfiguration(WindowsFabricSettings windowsFabricSettings)
        {
            var settingsForThisSection = windowsFabricSettings.GetSection(this.SectionName);

            if (settingsForThisSection.ContainsKey(FabricValidatorConstants.ParameterNames.IsEnabled))
            {
                bool isEnabled = bool.Parse(settingsForThisSection[FabricValidatorConstants.ParameterNames.IsEnabled].Value);
                if (!isEnabled)
                {
                    FabricValidatorUtility.WriteWarningInVSOutputFormat(
                        FabricValidatorUtility.TraceTag,
                        "Performance counter collection on node is disabled because section '{0}' parameter '{1}' is set to 'false'.",
                        FabricValidatorConstants.SectionNames.PerformanceCounterLocalStore,
                        FabricValidatorConstants.ParameterNames.IsEnabled);
                }
            }

            if (settingsForThisSection[FabricValidatorConstants.ParameterNames.Counters].IsFromClusterManifest)
            {
                string   counterList = settingsForThisSection[FabricValidatorConstants.ParameterNames.Counters].Value;
                string[] counters    = counterList.Split(',');
                if (counters.Length == 0)
                {
                    throw new ArgumentException(
                              string.Format(
                                  "Section '{0}' parameter '{1}' should specify at least one performance counter.",
                                  FabricValidatorConstants.SectionNames.PerformanceCounterLocalStore,
                                  FabricValidatorConstants.ParameterNames.Counters));
                }

                bool defaultCountersSpecified = false;
                bool emptyStringPresent       = false;
                foreach (string counterAsIs in counters)
                {
                    string counter = counterAsIs.Trim();
                    if (String.IsNullOrEmpty(counter))
                    {
                        emptyStringPresent = true;
                    }
                    else if (counter.Equals(FabricValidatorConstants.DefaultTag, StringComparison.OrdinalIgnoreCase))
                    {
                        defaultCountersSpecified = true;
                    }
                }

                if (emptyStringPresent)
                {
                    throw new ArgumentException(
                              string.Format(
                                  "The counter list in section '{0}' parameter '{1}' contains at least one empty string.",
                                  FabricValidatorConstants.SectionNames.PerformanceCounterLocalStore,
                                  FabricValidatorConstants.ParameterNames.Counters));
                }

                if (false == defaultCountersSpecified)
                {
                    FabricValidatorUtility.WriteWarningInVSOutputFormat(
                        FabricValidatorUtility.TraceTag,
                        "Section '{0}' parameter '{1}' does not include the default performance counters representation ({2}). Therefore, the default performance counters will not be collected.",
                        FabricValidatorConstants.SectionNames.PerformanceCounterLocalStore,
                        FabricValidatorConstants.ParameterNames.Counters,
                        FabricValidatorConstants.DefaultTag);
                }
            }

            if (settingsForThisSection[FabricValidatorConstants.ParameterNames.NewCounterBinaryFileCreationIntervalMinutes].IsFromClusterManifest)
            {
                int minRecommendedNewFileCreationIntervalMinutes = 5;
                int maxNewFileCreationIntervalMinutes            = int.MaxValue / 60;

                ValueValidator.VerifyIntValueGreaterThanEqualToInput(
                    settingsForThisSection,
                    FabricValidatorConstants.ParameterNames.NewCounterBinaryFileCreationIntervalMinutes,
                    minRecommendedNewFileCreationIntervalMinutes,
                    this.SectionName);

                ValueValidator.VerifyIntValueLessThanEqualToInput(
                    settingsForThisSection,
                    FabricValidatorConstants.ParameterNames.NewCounterBinaryFileCreationIntervalMinutes,
                    maxNewFileCreationIntervalMinutes,
                    this.SectionName);
            }

            if (settingsForThisSection[FabricValidatorConstants.ParameterNames.TestOnlyCounterFilePath].IsFromClusterManifest)
            {
                string testOnlyCounterFilePath = settingsForThisSection[FabricValidatorConstants.ParameterNames.TestOnlyCounterFilePath].Value;
                if (String.IsNullOrEmpty(testOnlyCounterFilePath))
                {
                    throw new ArgumentException(String.Format(
                                                    "Section '{0}' parameter '{1}' should not be an empty string.",
                                                    FabricValidatorConstants.SectionNames.PerformanceCounterLocalStore,
                                                    FabricValidatorConstants.ParameterNames.TestOnlyCounterFilePath));
                }
            }

            if (settingsForThisSection[FabricValidatorConstants.ParameterNames.TestOnlyCounterFileNamePrefix].IsFromClusterManifest)
            {
                string testOnlyCounterFileNamePrefix = settingsForThisSection[FabricValidatorConstants.ParameterNames.TestOnlyCounterFileNamePrefix].Value;
                if (String.IsNullOrEmpty(testOnlyCounterFileNamePrefix))
                {
                    throw new ArgumentException(String.Format(
                                                    "Section '{0}' parameter '{1}' should not be an empty string.",
                                                    FabricValidatorConstants.SectionNames.PerformanceCounterLocalStore,
                                                    FabricValidatorConstants.ParameterNames.TestOnlyCounterFileNamePrefix));
                }
            }
        }