Skip to content
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

SqlAG & SqlAGReplica: Remove parameter SQLServerNetName #924

Closed
johlju opened this issue Dec 1, 2017 · 10 comments · Fixed by #938
Closed

SqlAG & SqlAGReplica: Remove parameter SQLServerNetName #924

johlju opened this issue Dec 1, 2017 · 10 comments · Fixed by #938
Assignees
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Member

johlju commented Dec 1, 2017

Details of the scenario you tried and the problem that is occurring:
The work renaming parameters in issue #308 does not mention the parameter
SQLServerNetName in the resource SqlAG.

https://github.com/PowerShell/SqlServerDsc/blob/9a1080c4da5d513eb4191388206cf37c16c0a0fd/DSCResources/MSFT_SqlAG/MSFT_SqlAG.schema.mof#L23

I suggest we rename it to NetName.

The DSC configuration that is using the resource (as detailed as possible):
n/a

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
n/a

What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
n/a

Version of the DSC module you're using, or 'dev' if you're using current dev branch:
Dev

@johlju johlju added the discussion The issue is a discussion. label Dec 1, 2017
@johlju
Copy link
Member Author

johlju commented Dec 1, 2017

@randomnote1 @nabrond next one, what do you think?

@johlju
Copy link
Member Author

johlju commented Dec 1, 2017

I'm open for other names. Maybe NetServerName would be more appropriate?

@randomnote1
Copy link
Contributor

NetName is the property off of the server object that is used. This is either the node name or the virtual computer object name of the FCI. ServerNetName would make sense to me.

@johlju
Copy link
Member Author

johlju commented Dec 1, 2017

ServerNetName works for me.

@johlju johlju added breaking change When used on an issue, the issue has been determined to be a breaking change. enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. high priority The issue or PR should be resolved first. It is of less priority than the label 'Blocking Release'. and removed discussion The issue is a discussion. labels Dec 1, 2017
@nabrond
Copy link
Contributor

nabrond commented Dec 2, 2017

Should we drop the parameter all together? It looks like it is only used in the Get-TargetResource and Test-TargetResource functions and may be a duplicate of EndpointHostName.

@johlju
Copy link
Member Author

johlju commented Dec 5, 2017

I agree, I think doing the below would result in the same thing, and we could remove the parameter.
@randomnote1 What do think? Either that, or is it a bug that we don't return the value the user set in the parameter EndPointHostName from the Get-TargetResource function?

I'm thinking of the above change, since the Set-TargetResource function already is using NetName property for the parameter EndpointHostname if it is not set.

https://github.com/PowerShell/SqlServerDsc/blob/af10f7147a77c2726521df418b3f05d87b60808d/DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1#L290-L293

So, changing this row in Get-TargetResource.

https://github.com/PowerShell/SqlServerDsc/blob/af10f7147a77c2726521df418b3f05d87b60808d/DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1#L79

Into

$alwaysOnAvailabilityGroupResource.EndpointHostName = $serverObject.NetName

and changing this code block in Test-TargetResource function

https://github.com/PowerShell/SqlServerDsc/blob/af10f7147a77c2726521df418b3f05d87b60808d/DSCResources/MSFT_SqlAG/MSFT_SqlAG.psm1#L701-L704

into

 if ( -not $EndpointHostName ) 
 { 
     $EndpointHostName = $getTargetResourceResult.EndpointHostName 
 } 

@johlju
Copy link
Member Author

johlju commented Dec 5, 2017

In the Get-TargetResource function we could also return the value of the EndpointHostName if the parameter is set. If it is not set then we return $serverObject.NetName (the above code).

@randomnote1
Copy link
Contributor

Well, I'm not entirely sure why I chose to create a read-only property for $serverObject.NetName. I'm in favor of using $EndpointHostName and dropping $SQLServerNetName.

@johlju johlju changed the title SqlAG: Rename parameter SQLServerNetName SqlAG & SqlAGReplica: Rename parameter SQLServerNetName Dec 7, 2017
@johlju
Copy link
Member Author

johlju commented Dec 7, 2017

@randomnote1 The same logic seem to exist in SqlAgReplica as well. So changing that as well.

Working on this now.

@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Dec 7, 2017
@johlju johlju changed the title SqlAG & SqlAGReplica: Rename parameter SQLServerNetName SqlAG & SqlAGReplica: Remove parameter SQLServerNetName Dec 7, 2017
johlju added a commit to johlju/SqlServerDsc that referenced this issue Dec 7, 2017
- The read-only property SQLServerNetName was removed in favor of EndpointHostName (issue dsccommunity#924).
  Get-TargetResource will return the value of property NetName as the default value if
  EndpointHostName parameter is not assigned a value.
johlju added a commit to johlju/SqlServerDsc that referenced this issue Dec 7, 2017
- The read-only property SQLServerNetName was removed in favor of EndpointHostName (issue dsccommunity#924).
  Get-TargetResource will return the value of property NetName as the default value if
  EndpointHostName parameter is not assigned a value.
@randomnote1
Copy link
Contributor

That makes sense. Thanks!

johlju added a commit that referenced this issue Dec 8, 2017
…Name (#938)

- Changes to SqlAG
  - BREAKING CHANGE: The read-only property SQLServerNetName was removed in favour of
    EndpointHostName (issue #924). Get-TargetResource will now return the value of property
    NetName for the property EndpointHostName.
- Changes to SqlAGReplica
  - BREAKING CHANGE: The read-only property SQLServerNetName was removed in favour of
    EndpointHostName (issue #924). Get-TargetResource will now return the value of property
    NetName for the property EndpointHostName.
@vors vors removed the high priority The issue or PR should be resolved first. It is of less priority than the label 'Blocking Release'. label Dec 8, 2017
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Dec 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change When used on an issue, the issue has been determined to be a breaking change. enhancement The issue is an enhancement request.
Projects
None yet
4 participants