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

xSqlServerMaxDop: Measure-Resource value of Property is not valid #801

Closed
twerthi opened this issue Sep 11, 2017 · 6 comments · Fixed by #802
Closed

xSqlServerMaxDop: Measure-Resource value of Property is not valid #801

twerthi opened this issue Sep 11, 2017 · 6 comments · Fixed by #802
Labels
bug The issue is a bug.

Comments

@twerthi
Copy link

twerthi commented Sep 11, 2017

Details of the scenario you tried and the problem that is occurring:
Test section of xMaxDop is failing with: Error Message: Cannot process argument because the value of argument "Property" is not valid.

Researched module and found that Function Get-SqlDscDynamicMaxDop was causing the problem the two lines

$numProcs = (Measure-Object -InputObject $cimInstanceProc -Property NumberOfLogicalProcessors -Sum).Sum
$numCores = (Measure-Object -InputObject $cimInstanceProc -Property NumberOfCores -Sum).Sum

both fail with Measure-Object : The property "NumberOfLogicalProcessors" cannot be found in the input for any objects.

and

Measure-Object : The property "NumberOfCores" cannot be found in the input for any objects.

Replaced with

foreach($Processor in $cimInstanceProc)
{
    $numProcs += $Processor.NumberOfLogicalProcessors
    $numCores += $Processor.NumberOfCores
}

and MaxDop gets set correctly.

The DSC configuration that is using the resource (as detailed as possible):
# set max degree of parallelism
xSqlServerMaxDop $Node.NodeName
{
SQLInstanceName = $Node.InstanceName
SQLServer = $Node.SqlServerName
Ensure = "Present"
DynamicAlloc = $Node.MaxDopDynamicAlloc #($true)
MaxDop = $Node.MaxDop #$(null)
DependsOn = "[xSqlServerSetup]$($Node.NodeName)"
}

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

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

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

@twerthi
Copy link
Author

twerthi commented Sep 11, 2017

I forgot to mention that this has been working as of two weeks ago. I don't see any changes to the repository, which would lead one to conclude the problem is on my end :) However, I didn't make any changes either :)

@twerthi
Copy link
Author

twerthi commented Sep 11, 2017

Submitted the fix.

@johlju johlju added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Sep 12, 2017
@johlju
Copy link
Member

johlju commented Sep 12, 2017

Very strange that it did work, an now it doesn't. But I guess your changes as as good as the previous code, so doesn't hurt to change it if this is actually a problem with new build of some external thing.

@twerthi
Copy link
Author

twerthi commented Sep 12, 2017 via email

@johlju johlju changed the title xSqlServerMaxDop Measure-Resource value of Property is not valid xSqlServerMaxDop: Measure-Resource value of Property is not valid Sep 12, 2017
@nabrond
Copy link
Contributor

nabrond commented Sep 13, 2017

A little late to this, but I curious whether you saw any additional errors logged around the call to Get-CimInstance in this resource? After reading through this issue and looking at the existing module's code, it sounds as if that call failed to return a valid object?

@twerthi
Copy link
Author

twerthi commented Sep 13, 2017 via email

johlju pushed a commit that referenced this issue Sep 13, 2017
- Changes to xSQLServerMaxDop
  - Fixed error where Measure-Object cmdlet would fail claiming it could not
    find the specified property (issue #801).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants