dsccommunity / dsccommunity/SqlServerDsc

SqlSetup: when installs fails a new folder is created and media is copied, until there are no more disk space

Open
#783 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue help wanted
Dominant language
PowerShell
Stars
385
Forks
224
PR merge metrics
No merged PRs in 30d

Description

From issue #781: "After installing SQL Server, xSQLServerSetup does not clean up the install files that were copied from SourcePath, resulting in an extra 3GB of disk usage. Not a huge deal, but if there is an error in the DSC Configuration and the install fails, DSC will keep retrying and eventually exhaust the server's disk space."

This probably happens when SourcePath is set to for example 'C:\' so there is no leaf. It should not use New-Guid to get a temporary folder, but instead some static name, but unique to the version being installed, so that robocopy is using the same folder.

https://github.com/PowerShell/xSQLServer/blob/c290c0074ad34a1a5649b25a475f850008e525f3/DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1#L889-L893

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in DSCResources/MSFT_xSQLServerSetup/MSFT_xSQLServerSetup.psm1 at lines 889-893 and inspect how SourcePath produces the temporary folder and how robocopy uses it. Reproduce the retry scenario with a SourcePath such as C:, then verify that repeated failed installs reuse the same version-specific folder instead of creating new folders and copying more media.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, sql
Domain
databases, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.