Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-10625

puppetlabs/dsc : dsc_sqlservermemory errors when setting memory to dynamic on AWS 5th generation instances

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Won't Fix
    • None
    • None
    • dsc, sqlserver
    • None
    • MODULES Bug Template
    • Needs Assessment
    • Needs Assessment

    Description

      Basic Info
      Module Version: 1.9.3
      Puppet Version: 5.5.19
      OS Name/Version: All

      When you use any of the new 5th generation servers in AWS (R5, C5 etc) you receive an error when attempting to configure the memory allocation on SQL Server dynamically

      Desired Behavior: The memory is calculated and applied, based on what is available

      Actual Behavior: You get an error and the puppet run fails, without changing anything

      The error message you receive is as follows:

      Error: Could not set 'present' on ensure: PowerShell DSC resource MSFT_SqlServerMemory failed to execute Set-TargetResource functionality with error message: Failed to alter the server configuration memory for SERVERNAME\MSSQLSERVER. InnerException: Exception calling "Alter" with "0" argument(s): "Alter failed for Server 'SERVERNAME'.

      I believe that this issue has already been fixed by the DSC team in https://github.com/dsccommunity/SqlServerDsc/issues/914 (related to Azure, however I have tested the fix and it's valid in AWS too) so the simplest fix may be to release a new version of the module that has been rebased against the latest modules upstream.

      For reference, the actual fix is the change of retrieving the data from Win32_PhysicalMemory to Win32_OperatingSystem shown below

       

      ## Original statement
      $physicalMemory = ((Get-CimInstance -ClassName Win32_PhysicalMemory).Capacity | Measure-Object -Sum).Sum
       
      ## Fixed statement
      $physicalMemory = ((Get-CimInstance -ClassName win32_ComputerSystem).TotalPhysicalMemory | Measure-Object -Sum).Sum

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Captainuriel Andrew Robins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support