Description
#### Details of the scenario you tried and the problem that is occurring
We have had the same implementation in DSC configuration for a long time and it has worked on many servers. In this last version of the DSC Resource Kit including StorageDsc 4.1.0.0 provisioning a new server, we're now getting errors formatting the E$ drive. The Disk 1 gets mounted and a volume is created. The drive actually does get formatted and later configuration is creating files and folders there. However, Test-* is failing for some reason so overall the configuration is deemed to be failing.
#### Verbose logs showing the problem
VERBOSE: [SAASMANAGE01]: LCM: [ Start Resource ] [[Disk]FormatEDrive]
VERBOSE: [SAASMANAGE01]: LCM: [ Start Test ] [[Disk]FormatEDrive]
VERBOSE: [SAASMANAGE01]: [[Disk]FormatEDrive] Test-TargetResource: Testing disk with Number '1' status for drive letter 'E'.
VERBOSE: [SAASMANAGE01]: [[Disk]FormatEDrive] Test-TargetResource: Checking if disk with Number '1' is initialized.
Failed
Activity ID: {88a8fe9c-f006-47f4-b9d4-8b7516fb9d95}
+ CategoryInfo : NotSpecified: (StorageWMI:) [], CimException
+ FullyQualifiedErrorId : StorageWMI 4,Get-PartitionSupportedSize
+ PSComputerName : localhost
VERBOSE: [SAASMANAGE01]: [[Disk]FormatEDrive] Perform operation 'Query CimInstances' with following parameters, ''queryExpression' = SELECT BlockSize from Win32_Volume WHERE DriveLetter =
'E:','queryDialect' = WQL,'namespaceName' = root\cimv2'.
VERBOSE: [SAASMANAGE01]: [[Disk]FormatEDrive] Operation 'Query CimInstances' complete.
VERBOSE: [SAASMANAGE01]: LCM: [ End Test ] [[Disk]FormatEDrive] in 1.0620 seconds.
The PowerShell DSC resource '[Disk]FormatEDrive' with SourceInfo 'C:\VisualStudio\IDIBilling\IDI_IDI\Infrastructure\DesiredStateConfiguration\Implementations\IDI\Configuration\Configuration.psm1::1500::13::Disk' threw
one or more non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : localhost
#### The DSC configuration that is used to reproduce the issue (as detailed as possible)
# Mounts hard disk 1, which is always expected to become E$.
WaitforDisk "MountEDrive" {
DiskId = Resolve-DscConfigurationProperty -Node $Node -PropertyName "EDriveDiskId"
RetryIntervalSec = Resolve-DscConfigurationProperty -Node $Node -PropertyName "WaitForDiskRetryIntervalSec"
RetryCount = Resolve-DscConfigurationProperty -Node $Node -PropertyName "WaitForDiskRetryCount"
DependsOn = @("[Script]DisableFloppyDisks", "[Script]DisableOpticalDisks")
}
# Formats the E$ drive.
Disk "FormatEDrive" {
DiskId = Resolve-DscConfigurationProperty -Node $Node -PropertyName "EDriveDiskId"
DriveLetter = "E"
FSLabel = Resolve-DscConfigurationProperty -Node $Node -PropertyName "BaseSqlServerSettings\EDriveFileSystemLabel"
AllocationUnitSize = Resolve-DscConfigurationProperty -Node $Node -PropertyName "BaseSqlServerSettings\EDriveAllocationUnitSize"
DependsOn = "[WaitforDisk]MountEDrive"
}
# PowerShell can error if new drives are added within the current session.
# This resource implements a workaround for that to ensure the drive is available before future configuration.
WaitForVolume "WaitForEDrive" {
DriveLetter = "E"
RetryIntervalSec = Resolve-DscConfigurationProperty -Node $Node -PropertyName "WaitForDiskRetryIntervalSec"
RetryCount = Resolve-DscConfigurationProperty -Node $Node -PropertyName "WaitForDiskRetryCount"
DependsOn = "[Disk]FormatEDrive"
}
#### The operating system the target node is running
OsName : Microsoft Windows Server 2016 Datacenter
OsOperatingSystemSKU : DatacenterServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.447.amd64fre.rs1_release_inmarket.161102-0100
OsLanguage : en-US
OsMuiLanguages : {en-US}
#### Version and build of PowerShell the target node is running
Name Value
PSVersion 5.1.14393.206
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.206
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
#### Version of the DSC module that was used ('dev' if using current dev branch)
StorageDsc 4.1.0.0