Skip to content

Commit

Permalink
Changes to xFailOverCluster
Browse files Browse the repository at this point in the history
  - Added 'Code of Conduct' text to the README.md (issue dsccommunity#44).
  - Added TOC for all resources in the README.md (issue dsccommunity#43).
  - Fixed typos and lint errors in README.md.
  - Fixed style issue in example in README.md.
  - Removed 'Unreleased' "tag" from the resources xClusterQuorum and xClusterDisk (issue dsccommunity#36)
  - Added new sections to each resource (Requirements, Parameters and Examples) in the README.md. Some does not yet have any examples, so they are set to 'None.'.
  - Added GitHub templates PULL\_REQUEST\_TEMPLATE, ISSUE_TEMPLATE and CONTRIBUTING.md (issue dsccommunity#45).
  - Split the change log from README.md to a seperate file CHANGELOG.md.
  • Loading branch information
johlju committed Jun 13, 2017
1 parent 3ec8570 commit f08025d
Show file tree
Hide file tree
Showing 5 changed files with 190 additions and 74 deletions.
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
If you'd like to contribute to this project, please review the [Contribution Guidelines](https://github.com/PowerShell/DscResources/blob/master/CONTRIBUTING.md).
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!--
Your feedback and support is greatly appreciated, thanks for contributing!

Please prefix the issue title with the resource name, i.e. 'xCluster: Short description of my issue'
Please provide the following information regarding your issue (place N/A if the fields that don't apply to your issue):
-->
**Details of the scenario you tried and the problem that is occurring:**

**The DSC configuration that is using the resource (as detailed as possible):**

**Version of the Operating System and PowerShell the DSC Target Node is running:**

**Version of the DSC module you're using, or 'dev' if you're using current dev branch:**
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
Thanks for submitting a Pull Request (PR) to this project. Your contribution to this project is greatly appreciated!
Please prefix the PR title with the resource name, i.e. 'xCluster: My short description'
If this is a breaking change, then also prefix the PR title with 'BREAKING CHANGE:', i.e. 'BREAKING CHANGE: xCluster: My short description'
To aid community reviewers in reviewing and merging your PR, please take the time to run through the below checklist.
Change to [x] for each task in the task list that applies to this PR.
-->
**Pull Request (PR) description**
<!-- Replace this with a description of your pull request -->

**This Pull Request (PR) fixes the following issues:**
<!-- Replace this with the list of issues or n/a. Use format: Fixes #123 -->

**Task list:**
- [ ] Change details added to Unreleased section of CHANGELOG.md?
- [ ] Added/updated documentation, comment-based help and descriptions in .schema.mof files where appropriate?
- [ ] Examples appropriately updated?
- [ ] New/changed code adheres to [Style Guidelines](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md)?
- [ ] [Unit and (optional) Integration tests](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md) created/updated where possible?
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Change log for xFailOverCluster

## Unreleased

- Changes to xFailOverCluster
- Added 'Code of Conduct' text to the README.md (issue #44).
- Added TOC for all resources in the README.md (issue #43).
- Fixed typos and lint errors in README.md.
- Fixed style issue in example in README.md.
- Removed 'Unreleased' "tag" from the resources xClusterQuorum and xClusterDisk (issue #36)
- Added new sections to each resource (Requirements, Parameters and Examples) in the README.md. Some does not yet have any examples, so they are set to 'None.'.
- Added GitHub templates PULL\_REQUEST\_TEMPLATE, ISSUE_TEMPLATE and CONTRIBUTING.md (issue #45).
- Split the change log from README.md to a seperate file CHANGELOG.md.

### 1.6.0.0

- xCluster: Fixed bug in which failure to create a new cluster would hang

### 1.5.0.0

- Added xClusterQuorum resource with options *NodeMajority*, *NodeAndDiskMajority*, *NodeAndFileShareMajority*, *DiskOnly*
- Currently does not implement cloud witness for Windows 2016.
- Added xClusterDisk resource

### 1.2.0.0

- xCluster: Added -NoStorage switch to Add-ClusterNode. This prevents disks from being automatically added when joining a node to a cluster

### 1.1.0.0

- Removed requirement for CredSSP

### 1.0.0.0

- Initial release with the following resources:
- xCluster and xWaitForCluster
193 changes: 119 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,144 +1,190 @@
# xFailOverCluster

The **xFailOverCluster** module contains DSC resources for deployment and configuration of Failover Clustering.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

## Branches

### master

[![Build status](https://ci.appveyor.com/api/projects/status/6a59vfritv4kbc7d/branch/master?svg=true)](https://ci.appveyor.com/project/PowerShell/xfailovercluster/branch/master)

# xFailOverCluster
This is the branch containing the latest release - no contributions should be made directly to this branch.

### dev

[![Build status](https://ci.appveyor.com/api/projects/status/6a59vfritv4kbc7d/branch/dev?svg=true)](https://ci.appveyor.com/project/PowerShell/xfailovercluster/branch/dev)

The **xFailOverCluster** DSC modules contains **xCluster** and **xWaitForCluster** resources for creating and configuring failover clusters.
This is the development branch to which contributions should be proposed by contributors as pull requests. This development branch will periodically be merged to the master branch, and be released to [PowerShell Gallery](https://www.powershellgallery.com/).

## Contributing

Please check out common DSC Resources [contributing guidelines](https://github.com/PowerShell/DscResource.Kit/blob/master/CONTRIBUTING.md).

## Change log

A full list of changes in each version can be found in the [change log](CHANGELOG.md).

## Resources

* **xCluster** ensures that a group of machines form a cluster.
* **xWaitForCluster** ensures that a node waits for a remote cluster is created.
* [**xCluster**](#xcluster) Ensures that a group of machines form a cluster.
* [**xClusterQuorum**](#xclusterquorum) Configures quorum in a cluster.
* [**xClusterDisk**](#xclusterdisk) Configures shared disks in a cluster.
* [**xWaitForCluster**](#xwaitforcluster) Ensures that a node waits for a remote cluster is created.

### xCluster

Ensures that a group of machines form a cluster.

#### Requirements

* Target machine must be running Windows Server 2008 R2 or later

#### Parameters

* **Name**: Name of the cluster
* **StaticIPAddress**: Static IP Address of the cluster
* **DomainAdministratorCredential**: Credential used to create the cluster

### xClusterQuorum (Unreleased)
#### Examples

[Cluster example](#clusterexample)

### xClusterQuorum

Configures quorum in a cluster.

#### Requirements

* Target machine must be running Windows Server 2008 R2 or later

#### Parameters

* **IsSingleInstance** Always set to `Yes` to prevent multiple quorum settings per cluster.
* **Type** Quorum type to use: *NodeMajority*, *NodeAndDiskMajority*, *NodeAndFileShareMajority*, *DiskOnly*
* **Resource** The name of the disk or file share resource to use as witness. Is optional with *NodeMajority* type.
* **Resource** The name of the disk or file share resource to use as witness. Is optional with *NodeMajority* type.

### xClusterDisk (Unreleased)
#### Examples

* **Number**: Number of the cluster disk
* **Ensure**: Define if the cluster disk should be added (Present) or removed (Absent)
* **Label**: The disk label inside the Failover Cluster
None.

### xWaitForCluster
### xClusterDisk

* **Name**: Name of the cluster to wait for
* **RetryIntervalSec**: Interval to check for cluster existence
* **RetryCount**: Maximum number of retries to check for cluster existance
* **Credential**: Credential used to join or leave domain
Configures shared disks in a cluster.

## Versions
#### Requirements

### Unreleased
* Target machine must be running Windows Server 2008 R2 or later

### 1.6.0.0
#### Parameters

* xCluster: Fixed bug in which failure to create a new cluster would hang
* **Number**: Number of the cluster disk
* **Ensure**: Define if the cluster disk should be added (Present) or removed (Absent)
* **Label**: The disk label inside the Failover Cluster

### 1.5.0.0
#### Examples

* Added xClusterQuorum resource with options *NodeMajority*, *NodeAndDiskMajority*, *NodeAndFileShareMajority*, *DiskOnly*
* Currently does not implement cloudwitness for Windows 2016.
* Added xClusterDisk resource
None.

### 1.2.0.0
### xWaitForCluster

* xCluster: Added -NoStorage switch to add-clusterNode. This prevents disks from being automatically added when joining a node to a cluster
Ensures that a node waits for a remote cluster is created.

### 1.1.0.0
#### Requirements

* Removed requirement for CredSSP
* Target machine must be running Windows Server 2008 R2 or later

### 1.0.0.0
#### Parameters

* Initial release with the following resources:
- xCluster and xWaitForCluster
* **Name**: Name of the cluster to wait for
* **RetryIntervalSec**: Interval to check for cluster existence
* **RetryCount**: Maximum number of retries to check for cluster existance
* **Credential**: Credential used to join or leave domain

#### Examples

## Examples
[Cluster example](#clusterexample)

## xFailOverCluster Examples

### Cluster example

In this example, we will create a failover cluster from two VMs.
We will assume that a Domain Controller already exists, and that both VMs are already domain joined.
In this example, we will create a failover cluster from two VMs.
We will assume that a Domain Controller already exists, and that both VMs are already domain joined.
Furthermore, the example assumes that your certificates are installed such that DSC can appropriately handle secrets such as the Domain Administrator Credential.
Finally, the xCluster module must also be installed on the VMs, as specified above.
For an example of an end to end scenario, check out the SQL HA Group blog post on the PowerShell Team Blog.

```powershell
Configuration ClusterDemo
{
param([Parameter(Mandatory=$true)]
[ValidateNotNullorEmpty()]
[PsCredential] $domainAdminCred)
Node $AllNodes.Where{$_.Role -eq "PrimaryClusterNode" }.NodeName
param
(
[Parameter(Mandatory = $true)]
[ValidateNotNullorEmpty()]
[PsCredential]
$domainAdminCredential
)
Node $AllNodes.Where{$_.Role -eq 'PrimaryClusterNode' }.NodeName
{
WindowsFeature FailoverFeature
{
Ensure = "Present"
Name = "Failover-clustering"
Ensure = 'Present'
Name = 'Failover-clustering'
}
WindowsFeature RSATClusteringPowerShell
{
Ensure = "Present"
Name = "RSAT-Clustering-PowerShell"
Ensure = 'Present'
Name = 'RSAT-Clustering-PowerShell'
DependsOn = "[WindowsFeature]FailoverFeature"
DependsOn = '[WindowsFeature]FailoverFeature'
}
WindowsFeature RSATClusteringCmdInterface
{
Ensure = "Present"
Name = "RSAT-Clustering-CmdInterface"
Ensure = 'Present'
Name = 'RSAT-Clustering-CmdInterface'
DependsOn = "[WindowsFeature]RSATClusteringPowerShell"
DependsOn = '[WindowsFeature]RSATClusteringPowerShell'
}
xCluster ensureCreated
{
Name = $Node.ClusterName
StaticIPAddress = $Node.ClusterIPAddress
DomainAdministratorCredential = $domainAdminCred
DomainAdministratorCredential = $domainAdminCredential
DependsOn = “[WindowsFeature]RSATClusteringCmdInterface”
}
}
}
Node $AllNodes.Where{ $_.Role -eq "ReplicaServerNode" }.NodeName
{
Node $AllNodes.Where{ $_.Role -eq 'ReplicaServerNode' }.NodeName
{
WindowsFeature FailoverFeature
{
Ensure = "Present"
Name = "Failover-clustering"
Ensure = 'Present'
Name = 'Failover-clustering'
}
WindowsFeature RSATClusteringPowerShell
{
Ensure = "Present"
Name = "RSAT-Clustering-PowerShell"
Ensure = 'Present'
Name = 'RSAT-Clustering-PowerShell'
DependsOn = "[WindowsFeature]FailoverFeature"
DependsOn = '[WindowsFeature]FailoverFeature'
}
WindowsFeature RSATClusteringCmdInterface
{
Ensure = "Present"
Name = "RSAT-Clustering-CmdInterface"
Ensure = 'Present'
Name = 'RSAT-Clustering-CmdInterface'
DependsOn = "[WindowsFeature]RSATClusteringPowerShell"
DependsOn = '[WindowsFeature]RSATClusteringPowerShell'
}
xWaitForCluster waitForCluster
Expand All @@ -147,50 +193,49 @@ Configuration ClusterDemo
RetryIntervalSec = 10
RetryCount = 60
DependsOn = [WindowsFeature]RSATClusteringCmdInterface
DependsOn = '[WindowsFeature]RSATClusteringCmdInterface'
}
xCluster joinCluster
{
Name = $Node.ClusterName
StaticIPAddress = $Node.ClusterIPAddress
DomainAdministratorCredential = $domainAdminCred
DependsOn = "[xWaitForCluster]waitForCluster"
}
DomainAdministratorCredential = $domainAdminCredential
DependsOn = '[xWaitForCluster]waitForCluster'
}
}
}
$ConfigData = @{
AllNodes = @(
@{
NodeName= "*"
NodeName= '*'
CertificateFile = "C:\keys\Dscdemo.cer" # use your own certificate
CertificateFile = 'C:\keys\Dscdemo.cer' # use your own certificate
Thumbprint = "E513EEFCB763E6954C52BA66A1A81231BF3F551E" # assume both machines have the same certificate to hold private key
# replace the value of thumbprint with your own.
ClusterName = "Cluster"
ClusterIPAddress = "192.168.100.20/24" # replace the ipaddress of your own.
ClusterName = 'Cluster'
ClusterIPAddress = '192.168.100.20/24' # replace the ip address of your own.
},
# Node01
@{
NodeName= "Node01" # rename to actual machine name of VM
Role = "PrimaryClusterNode"
NodeName= 'Node01' # rename to actual machine name of VM
Role = 'PrimaryClusterNode'
},
# Node02
@{
NodeName= "Node02" # rename to actual machine name of VM
Role = "ReplicaServerNode"
NodeName= 'Node02' # rename to actual machine name of VM
Role = 'ReplicaServerNode'
}
);
)
}
$domainAdminCred = Get-Credential -UserName "ClusterDemo\Administrator" -Message "Enter password for private domain Administrator"
$domainAdminCred = Get-Credential -UserName 'ClusterDemo\Administrator' -Message 'Enter password for private domain Administrator'
ClusterDemo -ConfigurationData $ConfigData -domainAdminCred $domainAdminCred
ClusterDemo -ConfigurationData $ConfigData -domainAdminCred $domainAdminCredential
```

0 comments on commit f08025d

Please sign in to comment.