// Token: 0x060008AF RID: 2223 RVA: 0x00029954 File Offset: 0x00027B54 internal static bool IsQuorumTypeFileShareWitness(IAmCluster cluster) { using (AmClusterResource amClusterResource = cluster.OpenQuorumResource()) { if (amClusterResource != null && amClusterResource.GetTypeName() == "File Share Witness") { return(true); } } return(false); }
// 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 :; } }
private void DumpResource(AmClusterResource resource) { string typeName = resource.GetTypeName(); List <string> list = new List <string>(resource.EnumeratePossibleOwnerNames()); string text = string.Join(",", list.ToArray()); this.WriteLine("Resource: {0} [{1}, type = {2}, PossibleOwners = {3} ]", new object[] { resource.Name, resource.GetState(), typeName, text }); if (SharedHelper.StringIEquals(typeName, "IP Address") || SharedHelper.StringIEquals(typeName, "IPv6 Address")) { this.DumpResourceIpAddress(resource, typeName); return; } if (SharedHelper.StringIEquals(typeName, "Network Name")) { this.DumpResourceNetName(resource); } }