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

Comments

Projects
None yet
3 participants
@twerthi
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@twerthi

twerthi Sep 11, 2017

Contributor

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 :)

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@twerthi

twerthi Sep 11, 2017

Contributor

Submitted the fix.

Contributor

twerthi commented Sep 11, 2017

Submitted the fix.

@johlju

This comment has been minimized.

Show comment
Hide comment
@johlju

johlju Sep 12, 2017

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@twerthi

twerthi Sep 12, 2017

Contributor
Contributor

twerthi commented Sep 12, 2017

@johlju johlju changed the title from xSqlServerMaxDop Measure-Resource value of Property is not valid to xSqlServerMaxDop: Measure-Resource value of Property is not valid Sep 12, 2017

@nabrond

This comment has been minimized.

Show comment
Hide comment
@nabrond

nabrond Sep 13, 2017

Contributor

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?

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

This comment has been minimized.

Show comment
Hide comment
@twerthi

twerthi Sep 13, 2017

Contributor
Contributor

twerthi commented Sep 13, 2017

@johlju johlju closed this in #802 Sep 13, 2017

johlju added a commit that referenced this issue Sep 13, 2017

xSQLServerMaxDop: Measure-Resource value of Property is not valid (#802)
- 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 label Oct 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment