Skip to content

Instantly share code, notes, and snippets.

@bgelens
Last active August 29, 2015 14:18
Show Gist options
  • Save bgelens/572adaaed9cc32d1ebb5 to your computer and use it in GitHub Desktop.
Save bgelens/572adaaed9cc32d1ebb5 to your computer and use it in GitHub Desktop.
configuration SQL
{
Import-DscResource -ModuleName xSQLServer,xDisk
node sql01
{
xWaitForDisk SMAInstallDisk
{
DiskNumber = 2
RetryIntervalSec = 60
RetryCount = 60
SkipConsistencyIf = '[xSQLServerSetup]SQL'
}
xDisk Installdisk
{
DiskNumber = 2
DriveLetter = 'I'
DependsOn = '[xWaitForDisk]SMAInstallDisk'
SkipConsistencyIf = '[xSQLServerSetup]SQL'
}
xSQLServerSetup SQL
{
InstanceName = 'MyInstance'
SourcePath = "I:\"
SourceFolder = "SQL2014"
Features= "SQLENGINE,SSMS"
SecurityMode="SQL"
DependsOn = '[xDisk]Installdisk'
}
}
}
@nicholasdille
Copy link

The scenario is very valid and will probably come up in many complex environments. BTW, the example is nicely chosen because providing the installation media for role like SQL server is a PITA ;-)

Your proposal does get the job done with regard to initial installations but this configuration may fail to reach consistency in subsequent checks because the SQL Server resource may not be able to "make it so" again because of the missing installation media.

I "fear" that we need to ascertain the availability of installation media to enable the self healing powers of DSC ... well, as long as the resource was written to achieve this ;-)

Still, I am not about to dismiss you idea yet ;-) I have thought about alternatives that have always brought be back to SkipConsistencyIf. I guess we will come up with a scenario that requires it.

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