-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cluster: Cluster created with path CN= is not idempotent #195
Comments
This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close. |
Thoughts? |
This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close. |
I don't think I can label this, correct? |
@jdwhited Sorry for not labeling this before this, I have been busy with the day job. But starting to get some time to focus on issues and reviewing PR's now. |
@jdwhited It would be great to add an example file for this change as well when this issue is resolved. |
Details of the scenario you tried and the problem that is occurring
I created a cluster with a custom path for the CNO. Example:
Name = CN=mycluster,OU=ClusterOU,OU=Main,DC=example,DC=com
This actually worked great, but it is not idempotent. Even though the New-Cluster that the DSC calls allows for a custom path /name, the DSC doesn't expect that when calling the Test.
Verbose logs showing the problem
Error Message: PowerShell DSC resource MSFT_xCluster failed to execute Set-TargetResource functionality with error message: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: There was an error adding node 'myserver' to the cluster
The computer 'myserver.example.com' is joined to a cluster
Suggested solution to the issue
There are multiple ways to handle this (including adding a path parameter), but from a coding perspective the easiest is to just check the $Name for a CN= prefix and pull out the actual cluster name. If there is no CN= prefix just use the name with the original intent:
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
OsName : Microsoft Windows Server 2012 R2 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 9600.19153.amd64fre.winblue_ltsb.180908-0600
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
Name Value
PSVersion 5.1.14409.1012
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14409.1012
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Version of the DSC module that was used ('dev' if using current dev branch)
dev
The text was updated successfully, but these errors were encountered: