Пример #1
0
 // Token: 0x060008AE RID: 2222 RVA: 0x00029798 File Offset: 0x00027998
 internal static void RevertToMnsQuorum(ILogTraceHelper output, IAmCluster cluster)
 {
     using (IAmClusterGroup amClusterGroup = cluster.FindCoreClusterGroup())
     {
         string text;
         uint   maxLogSize;
         string quorumResourceInformation = cluster.GetQuorumResourceInformation(out text, out maxLogSize);
         if (string.IsNullOrEmpty(quorumResourceInformation))
         {
             output.AppendLogMessage("RevertToMnsQuorum: It's already using MNS!", new object[0]);
             using (IAmClusterResource amClusterResource = amClusterGroup.FindResourceByTypeName("File Share Witness"))
             {
                 if (amClusterResource != null)
                 {
                     output.AppendLogMessage("Even though the quorum is set to MNS, there is a FSW resource present named '{0}', which will be deleted shortly.", new object[]
                     {
                         amClusterResource.Name
                     });
                     amClusterResource.DeleteResource();
                     output.AppendLogMessage("The resource has been deleted!", new object[0]);
                 }
                 goto IL_13D;
             }
         }
         using (AmClusterResource amClusterResource2 = cluster.OpenResource(quorumResourceInformation))
         {
             output.AppendLogMessage("Setting cluster quorum to MNS", new object[0]);
             if (cluster.CnoName == string.Empty)
             {
                 cluster.ClearQuorumResource();
             }
             else
             {
                 using (IAmClusterResource amClusterResource3 = amClusterGroup.FindResourceByTypeName("Network Name"))
                 {
                     output.AppendLogMessage("Setting cluster quorum resource to the netname resource (i.e. MNS quorum).", new object[0]);
                     cluster.SetQuorumResource(amClusterResource3, null, maxLogSize);
                     if (amClusterResource2 != null && amClusterResource2.GetTypeName() == "File Share Witness")
                     {
                         output.AppendLogMessage("Offlining and deleting the old FSW resource '{0}'.", new object[]
                         {
                             quorumResourceInformation
                         });
                         amClusterResource2.OfflineResource();
                         amClusterResource2.DeleteResource();
                     }
                 }
             }
         }
         IL_13D :;
     }
 }